Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
omalizadeh committed May 26, 2023
1 parent 0ae9b79 commit b174cbd
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 17 deletions.
16 changes: 7 additions & 9 deletions README-FA.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@

## حداقل نیازمندی‌ها

- **PHP v7.4**
- **Laravel v7.0**
- **PHP v8.1**
- **Laravel v8.0**

## درگاه های پشتیبانی شده

Expand Down Expand Up @@ -54,14 +54,12 @@
```

<div dir="rtl">
انتشار فایل تنظیمات درگاه مورد نظر با استفاده از تگ هر درگاه
انتشار فایل تنظیمات درگاه مورد نظر با استفاده از تگ هر درگاه، مانند:
</div>

- zarinpal-config
- mellat-config
- saman-config
- pasargad-config
- novin-config

<div dir="rtl">
به عنوان مثال از دستور زیر می توان برای انتشار فایل تنظیمات درگاه زرین پال استفاده کرد:
Expand Down Expand Up @@ -92,7 +90,7 @@
*
* valid pattern --> GATEWAY_NAME.GATEWAY_CONFIG_KEY
*/
'default_gateway' => env('DEFAULT_GATEWAY', 'zarinpal.second'),
'default_gateway' => env('DEFAULT_PAYMENT_GATEWAY', 'zarinpal.second'),

/**
* set to false if your in-app currency is IRR
Expand Down Expand Up @@ -155,14 +153,14 @@

<div dir="rtl">

با افزودن شماره همراه کاربر به صورتحساب، درگاه برای تجربه کاربری بهتر، شماره کارت های ثبت شده با آن را هنگام پرداخت به پرداخت کننده پیشنهاد می دهد. قبل از صدا زدن متد purchase برای خرید، می توان با استفاده از متد setGateway درگاه مورد استفاده را تغییر داد.
با افزودن شماره همراه کاربر به صورتحساب، درگاه برای تجربه کاربری بهتر، شماره کارت های ثبت شده با آن را هنگام پرداخت به پرداخت کننده پیشنهاد می دهد. قبل از صدا زدن متد purchase برای خرید، می توان با استفاده از متد setProvider درگاه مورد استفاده را تغییر داد.

</div>

```php
$invoice = new Invoice(10000);

return PaymentGateway::setGateway('mellat.app')
return PaymentGateway::setProvider('mellat', 'first')
->purchase($invoice, function (string $transactionId) {
// Save transaction_id and do stuff...
})->view();
Expand Down Expand Up @@ -197,7 +195,7 @@
خروجی تایید پرداخت، یک شیء از کلاس `Receipt` است که می توان از متدهای مختلف آن برای بدست آوردن اطلاعات مختلف استفاده
کرد.

- `getInvoiceId`: شناسه صورتحساب
- `getInvoiceId`: شناسه صورتحساب/فاکتور
- `getTransactionId`: شناسه تراکنش
- `getTraceNumber`: شماره پیگیری
- `getReferenceId`: شماره ارجاع بانکی
Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# Laravel Online Payment Gateway Package

This is a laravel gateway payment package with multi driver support. Each driver can have multiple configurations.
Supports laravel **v7.0+** and requires php **v7.4+**
Supports laravel **v8.0+** and requires php **v8.1+**

> Star! if you liked this package.
Expand Down Expand Up @@ -41,7 +41,7 @@ Publish main config file
php artisan vendor:publish --tag=multipayment-config
```

Publish gateway config file based on these tags.
Publish gateway config file based on tags. like:
- zarinpal-config
- mellat-config
- saman-config
Expand All @@ -67,15 +67,15 @@ In main config file `multipayment.php`, you can specify default driver. For exam
*
* valid pattern --> GATEWAY_NAME.GATEWAY_CONFIG_KEY
*/
'default_gateway' => env('DEFAULT_GATEWAY', 'zarinpal.second'),
'default_gateway' => env('DEFAULT_PAYMENT_GATEWAY', 'zarinpal.second'),

/**
* set to false if your in-app currency is IRR
*/
'convert_to_rials' => true
```

In each gateway config file, you can specify multiple credentials and therefore you may have multiple gateways for your app.
In each gateway config file, you can specify multiple credentials, therefore you may have multiple gateways for your app from same provider.

```php
/**
Expand All @@ -98,12 +98,12 @@ In each gateway config file, you can specify multiple credentials and therefore
## Usage

Gateway payment has two major phases. first is purchase (start process by calling gateway api for a
transaction_id/token) and opening gateway payment web page. second is verification (checking
transaction_id/token) and opening gateway payment web page with received data. second is verification (checking
payment was successful).

### Purchase

`Inovice` objects hold payment data. first you create an invoice, set amount and other information, then you pass invoice to `PaymentGateway` Facade to start payment process. you can use `setGateway` method on facade to change gateway before payment.
`Inovice` objects hold payment data. first you create an invoice, set amount and other information, then you pass invoice to `PaymentGateway` Facade to start payment process. you can use `setProvider` method on facade to change gateway before payment.

```php
// On top...
Expand Down Expand Up @@ -142,11 +142,11 @@ After payment gateway redirection to your app, you must create an invoice and se

#### Unverified Payments

There is also a method (supported by zarinpal) to get a list of successful unverified payments. use `unverifiedPayments` method in `PaymentGateway` facade for this feature.
There is also a method (supported by zarinpal only for now) to get a list of successful unverified payments. use `unverifiedPayments` method in `PaymentGateway` facade for this feature.

#### Refund

Using `refund` method, you can refund a successful payment back to customer. Make sure you have authorization token in config file.
Using `refund` method, you can refund a successful payment back to customer.

[readme-link-fa]: README-FA.md

Expand Down

0 comments on commit b174cbd

Please sign in to comment.