Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/abolfazlrastegar/laravel-payments

package multi payments laravel
https://github.com/abolfazlrastegar/laravel-payments

idpay laravel-payments multi-payment payir payment zarinpal zibal

Last synced: about 1 month ago
JSON representation

package multi payments laravel

Awesome Lists containing this project

README

        

![alt text](https://github.com/abolfazlrastegar/laravel-payments/blob/main/laravel-payment.png?raw=true)


Total Downloads
Latest Stable Version
License

### Laravel-payments
package laravel multi payment support form (Zarinpal, Zibal, Idpay, Payir)

### Install package for laravel ^7
```bash
composer require abolfazlrastegar/laravel-payments
```
### Publish config
```bash
php artisan vendor:publish --tag="config"
```
### Docs drivers

zarinpal

zibal

idpay

payir

### Use methode `request`
```bash
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
```bash
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
```bash
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`
```bash
Payment::create('IdPay')
->params(['id' => '612218274d3f1e755e1684fe7db63e35','order_id' => '1655381732'])
->verfiy();
```
### or
```bash
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
```bash
// 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
```bash
// method refund for return amount to user

Payment::create('Zarinpal')
->refund('A00000000000000000000000000243676791')
```
#### Method unVerified zarinpal
```bash
// method unVerified for show payments unVerified On behalf of the user

Payment::create('Zarinpal')
->unVerified()
```
### config
```bash
/*
|----------------------------------------------
| 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
],
]
```