package laravel multi payment support form (Zarinpal, Zibal, Idpay, Payir)
composer require abolfazlrastegar/laravel-payments
php artisan vendor:publish --tag="config"
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();
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();
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();
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 ] |
Payment::create('IdPay')
->params(['id' => '612218274d3f1e755e1684fe7db63e35','order_id' => '1655381732'])
->verfiy();
Payment::create()
->defaultBank() // set name bank to payments/config
->params(['id' => '612218274d3f1e755e1684fe7db63e35','order_id' => '1655381732'])
->verify();
zarinpal | zibal | idpay | payir |
---|---|---|---|
[ 'amount' => 10000, 'authority' => 'A00000000000000000000000000202690354' ] |
$trackId = 15966442233311 | [ 'id' => "d2e353189823079e1e4181772cff5292", 'order_id' => '101' ] |
$token = "توکن پرداخت" |
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 for return amount to user
Payment::create('Zarinpal')
->refund('A00000000000000000000000000243676791')
// method unVerified for show payments unVerified On behalf of the user
Payment::create('Zarinpal')
->unVerified()
/*
|----------------------------------------------
| 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
],
]