@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | public function __construct(Invoice $invoice, $settings) |
| 61 | 61 | { |
| 62 | 62 | $this->invoice($invoice); |
| 63 | - $this->settings = (object)$settings; |
|
| 63 | + $this->settings = (object) $settings; |
|
| 64 | 64 | $this->client = new Client(); |
| 65 | 65 | $this->holder = new PasargadHolder(); |
| 66 | 66 | } |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | */ |
| 103 | 103 | public function pay(): RedirectionForm |
| 104 | 104 | { |
| 105 | - $paymentUrl = $this->settings->apiBaseUrl . $this->holder->getUrlId(); |
|
| 105 | + $paymentUrl = $this->settings->apiBaseUrl.$this->holder->getUrlId(); |
|
| 106 | 106 | |
| 107 | 107 | // redirect using HTML form |
| 108 | 108 | return $this->redirectWithForm($paymentUrl, ['Token' => $this->holder->getUrlId()]); |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | throw new InvalidPaymentException("This transaction is fail."); |
| 134 | 134 | } |
| 135 | 135 | |
| 136 | - if($payment_inquiry['data']['transactionId'] !== $transactionId) { |
|
| 136 | + if ($payment_inquiry['data']['transactionId'] !== $transactionId) { |
|
| 137 | 137 | throw new InvalidPaymentException("This transaction is fail."); |
| 138 | 138 | } |
| 139 | 139 | |
@@ -151,7 +151,7 @@ discard block |
||
| 151 | 151 | throw new InvalidPaymentException("This transaction is fail."); |
| 152 | 152 | } |
| 153 | 153 | |
| 154 | - $receipt = $this->createReceipt($$verifyResult['data']['referenceNumber']); |
|
| 154 | + $receipt = $this->createReceipt($$verifyResult['data']['referenceNumber']); |
|
| 155 | 155 | |
| 156 | 156 | $receipt->detail([ |
| 157 | 157 | 'resultCode' => $verifyResult['resultCode'], |
@@ -207,7 +207,7 @@ discard block |
||
| 207 | 207 | $terminalCode = $this->settings->terminalCode; |
| 208 | 208 | $amount = $this->invoice->getAmount() * ($this->settings->currency == 'T' ? 10 : 1); |
| 209 | 209 | $redirectAddress = $this->settings->callbackUrl; |
| 210 | - $invoiceNumber = crc32($this->invoice->getUuid()) . rand(0, time()); |
|
| 210 | + $invoiceNumber = crc32($this->invoice->getUuid()).rand(0, time()); |
|
| 211 | 211 | |
| 212 | 212 | $iranTime = new DateTime('now', new DateTimeZone('Asia/Tehran')); |
| 213 | 213 | $invoiceDate = $iranTime->format("Y/m/d H:i:s"); |
@@ -283,7 +283,7 @@ discard block |
||
| 283 | 283 | |
| 284 | 284 | try { |
| 285 | 285 | return $this->request($getTokenUrl, $data)['token']; |
| 286 | - } catch (GuzzleException|InvalidPaymentException $e) { |
|
| 286 | + } catch (GuzzleException | InvalidPaymentException $e) { |
|
| 287 | 287 | throw new InvalidPaymentException($e->getMessage()); |
| 288 | 288 | } |
| 289 | 289 | } |