Skip to content

Commit

Permalink
Fix parspal driver (#274)
Browse files Browse the repository at this point in the history
* Fix cache expiration in parspal driver

* Add parspal driver to class maps in config
  • Loading branch information
sadegh19b authored Sep 22, 2024
1 parent f4f2bf3 commit 0685fe4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion config/payment.php
Original file line number Diff line number Diff line change
Expand Up @@ -190,9 +190,10 @@
'sandboxApiPurchaseUrl' => ' https://sandbox.api.parspal.com/v1/payment/request',
'sandboxApiVerificationUrl' => 'https://sandbox.api.parspal.com/v1/payment/verify',

// You can change the token storage path in Laravel like this
// You can change the cache path in Laravel like this
// 'cachePath' => function_exists('storage_path') ? storage_path('parspal/') : 'parspal/'
'cachePath' => 'parspal/',
'cacheExpireTTL' => 3600, // Cache expire time in seconds

'sandbox' => false, // Set it to true for test environments
'merchantId' => '', // Set `00000000aaaabbbbcccc000000000000` for test environments (sandbox)
Expand Down Expand Up @@ -531,6 +532,7 @@
'nextpay' => \Shetabit\Multipay\Drivers\Nextpay\Nextpay::class,
'omidpay' => \Shetabit\Multipay\Drivers\Omidpay\Omidpay::class,
'parsian' => \Shetabit\Multipay\Drivers\Parsian\Parsian::class,
'parspal' => \Shetabit\Multipay\Drivers\Parspal\Parspal::class,
'pasargad' => \Shetabit\Multipay\Drivers\Pasargad\Pasargad::class,
'payir' => \Shetabit\Multipay\Drivers\Payir\Payir::class,
'paypal' => \Shetabit\Multipay\Drivers\Paypal\Paypal::class,
Expand Down
2 changes: 1 addition & 1 deletion src/Drivers/Parspal/Parspal.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ public function purchase()

$this->invoice->transactionId($body['payment_id']);

$this->cache->set('payment_link_' . $body['payment_id'], $body['link'], 3600);
$this->cache->set('payment_link_' . $body['payment_id'], $body['link'], $this->settings->cacheExpireTTL);

// return the transaction's id
return $this->invoice->getTransactionId();
Expand Down

0 comments on commit 0685fe4

Please sign in to comment.