Skip to content

Commit

Permalink
sandbox removed
Browse files Browse the repository at this point in the history
  • Loading branch information
FaridAghili committed Aug 15, 2021
1 parent 2190519 commit 306349a
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 19 deletions.
8 changes: 0 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,6 @@ To change currency to Rial
ZARINPAL_CURRENCY=IRR
```

To enable sandbox mode

برای فعالسازی حالت تست

```dotenv
ZARINPAL_SANDBOX_ENABLED=true
```

## روش استفاده | How to use

### ارسال مشتری به درگاه پرداخت | Send customer to payment gateway
Expand Down
2 changes: 0 additions & 2 deletions config/zarinpal.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,4 @@
// IRR for Rial or IRT for Toman
'currency' => env('ZARINPAL_CURRENCY', 'IRT'),

'sandbox_enabled' => env('ZARINPAL_SANDBOX_ENABLED', true),

];
4 changes: 1 addition & 3 deletions src/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,7 @@ public function __construct(string $merchantId, int $amount)

public function send(): RequestResponse
{
$url = config('zarinpal.sandbox_enabled')
? 'https://sandbox.zarinpal.com/pg/v4/payment/request.json'
: 'https://api.zarinpal.com/pg/v4/payment/request.json';
$url = 'https://api.zarinpal.com/pg/v4/payment/request.json';

$data = [
'merchant_id' => $this->merchantId,
Expand Down
4 changes: 1 addition & 3 deletions src/RequestResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,7 @@ public function url(): string
return '';
}

$url = config('zarinpal.sandbox_enabled')
? 'https://sandbox.zarinpal.com/pg/StartPay/'
: 'https://www.zarinpal.com/pg/StartPay/';
$url = 'https://www.zarinpal.com/pg/StartPay/';

return $url.$this->authority;
}
Expand Down
4 changes: 1 addition & 3 deletions src/Verification.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@ public function __construct(string $merchantId, int $amount)

public function send(): VerificationResponse
{
$url = config('zarinpal.sandbox_enabled')
? 'https://sandbox.zarinpal.com/pg/v4/payment/verify.json'
: 'https://api.zarinpal.com/pg/v4/payment/verify.json';
$url = 'https://api.zarinpal.com/pg/v4/payment/verify.json';

$data = [
'merchant_id' => $this->merchantId,
Expand Down

2 comments on commit 306349a

@ahmadina
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why?!

@FaridAghili
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why?!

ZarinPal removed sandbox functionality from its v4 API, so I removed it from this package.

#6
#7

Please sign in to comment.