Skip to content

Latest commit

 

History

History
194 lines (171 loc) · 6.29 KB

README.md

File metadata and controls

194 lines (171 loc) · 6.29 KB

alt text

Total Downloads Latest Stable Version License

Laravel-payments

package laravel multi payment support form (Zarinpal, Zibal, Idpay, Payir)

Install package for laravel ^7

composer require abolfazlrastegar/laravel-payments

Publish config

  php artisan vendor:publish --tag="config"

Docs drivers

zarinpal

zibal

idpay

payir

Use methode request

    Payment::create('IdPay')
        ->amount(10000)
        ->api(true) // time use form api add methode api()
        ->callbackUrl('http://127.0.0.1:8000/verify')
         ->infoUser([
            'name' => $user->name .' '. $user->family,
            'mobile' => $user->mobile,
            'email' => $user->email,
        ])
        ->request();

or

    Payment::create('IdPay')
    ->amount(10000)
    ->callbackUrl('http://127.0.0.1:8000/verify')
     ->infoUser([
        'name' => $user->name .' '. $user->family,
        'mobile' => $user->mobile,
        'email' => $user->email,
    ])
    ->request();

or

    Payment::create()
    ->defaultBank() // set name bank to payments/config
    ->api(true) // time use form api add methode api()
    ->amount(10000)
    ->callbackUrl('http://127.0.0.1:8000/verify')
     ->infoUser([
        'name' => $user->name .' '. $user->family,
        'mobile' => $user->mobile,
        'email' => $user->email,
    ])
    ->request();

infoUser method request

zarinpal zibal idpay payir
[
'mobile' => $user->mobile,
'email' => $user->email
]
[
'mobile' => $user->mobile
]
[
'name' => $user->name .' '. $user->family,
'mobile' => $user->mobile,
'email' => $user->email
]
[
'mobile' => $user->mobile,
'name' => $user->name .' '. $user->family
]

Use methode verify

     Payment::create('IdPay')
        ->params(['id' => '612218274d3f1e755e1684fe7db63e35','order_id' => '1655381732'])
        ->verfiy();

or

     Payment::create()
        ->defaultBank() // set name bank to payments/config
        ->params(['id' => '612218274d3f1e755e1684fe7db63e35','order_id' => '1655381732']) 
        ->verify();

Params method verify

zarinpal zibal idpay payir
[
'amount' => 10000,
'authority' => 'A00000000000000000000000000202690354'
]
$trackId = 15966442233311 [
'id' => "d2e353189823079e1e4181772cff5292",
'order_id' => '101'
]
$token = "توکن پرداخت"

Use methods zarinpal

To read more go to the Docs zarinpal

    // method checkout for Shared settlement
    
    Payment::create('Zarinpal')
       ->amount(10000)
       ->callbackUrl('http://127.0.0.1:8000/verify')
       ->api(true) // time use form api add methode api()
        ->params([
           [
               "iban" => "IR130570028780010957775103",
               "amount" => 1000,
               "description" => "....تسهیم سود فروش از محصول به "
           ],
           [
               "iban" => "IR670170000000352965862009",
               "amount" => 5000,
               "description" => "....تسهیم سود فروش از محصول به "
           ]
       ])
       ->checkout()

Method refund zarinpal

        // method refund for return amount to user
        
       Payment::create('Zarinpal')
       ->refund('A00000000000000000000000000243676791')

Method unVerified zarinpal

        // method unVerified for show payments unVerified On behalf of the user
        
       Payment::create('Zarinpal')
       ->unVerified()

config

    /*
    |----------------------------------------------
    | set type payment [ریال = rtr] [ تومان = rtt]
    |-----------------------------------------------
    */
    'currency' => 'rtt',

    /*
    |--------------------------------------------
    | set default payment
    |--------------------------------------------
    | from 'Zibal', 'PayIr', 'IdPay', 'Zarinpal'
    */

    'Default_payment' => 'IdPay',

    /*
    |-------------------------------------------
    | set description payment
    |-------------------------------------------
    */
    'Description_payment' => 'شارژ کیف پول',

    /*
    |-------------------------------------------
    | set test payment 
    |-------------------------------------------
    */
    'Test_payment' => false,

    /*
     |------------------------------------------
     | set setting drivers
     |------------------------------------------
     | active = 'true'  and inactive = 'false'
     */
    'drivers' => [
        'Zarinpal' => [
            'key' => '',
            'access_Token' => '',
            'status' => true,
            'api_test_request' => 'https://sandbox.zarinpal.com/pg/v4/payment/request.json',
            'api_test_py' => 'https://sandbox.zarinpal.com/pg/StartPay/',
            'api_test_verify' => 'https://sandbox.zarinpal.com/pg/v4/payment/verify.json',
        ],

        'Zibal' =>  [
            'key' => '',
            'status' => true
        ],

        'PayIr' =>  [
            'key' => '',
            'status' => true
        ],

        'IdPay' =>  [
            'key' => '',
            'status' => true
        ],
    ]