abolfazlrastegar / laravel-payments
package multi payments for Laravel Framework.
v1.0.0
2022-06-16 12:09 UTC
Requires
- php: ^7.1 || ^8.1
Requires (Dev)
- phpunit/phpunit: ^9.5
README
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
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
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
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 ], ]