@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | public function __construct(Invoice $invoice, $settings) |
| 64 | 64 | { |
| 65 | 65 | $this->invoice($invoice); |
| 66 | - $this->settings = (object)$settings; |
|
| 66 | + $this->settings = (object) $settings; |
|
| 67 | 67 | $this->client = new Client(); |
| 68 | 68 | $this->holder = new Pasargadholder(); |
| 69 | 69 | } |
@@ -87,8 +87,7 @@ discard block |
||
| 87 | 87 | $this->createToken() |
| 88 | 88 | ); |
| 89 | 89 | |
| 90 | - $response['data']['urlId'] ? $this->holder->urlId($response['data']['urlId']) : |
|
| 91 | - throw new InvalidPaymentException("urlId is not set."); |
|
| 90 | + $response['data']['urlId'] ? $this->holder->urlId($response['data']['urlId']) : throw new InvalidPaymentException("urlId is not set."); |
|
| 92 | 91 | |
| 93 | 92 | |
| 94 | 93 | return $this->invoice->getTransactionId(); |
@@ -101,7 +100,7 @@ discard block |
||
| 101 | 100 | */ |
| 102 | 101 | public function pay(): RedirectionForm |
| 103 | 102 | { |
| 104 | - $paymentUrl = $this->settings->apiBaseUrl . $this->holder->getUrlId(); |
|
| 103 | + $paymentUrl = $this->settings->apiBaseUrl.$this->holder->getUrlId(); |
|
| 105 | 104 | |
| 106 | 105 | $data = [ |
| 107 | 106 | 'Token' => $this->holder->getUrlId(), |
@@ -132,7 +131,7 @@ discard block |
||
| 132 | 131 | |
| 133 | 132 | $invoiceId = $verifyResult['data']['invoiceId']; |
| 134 | 133 | |
| 135 | - $receipt = $this->createReceipt($invoiceId); |
|
| 134 | + $receipt = $this->createReceipt($invoiceId); |
|
| 136 | 135 | |
| 137 | 136 | $receipt->detail([ |
| 138 | 137 | 'resultMsg' => $verifyResult['resultCode'], |
@@ -187,7 +186,7 @@ discard block |
||
| 187 | 186 | $terminalCode = $this->settings->terminalCode; |
| 188 | 187 | $amount = $this->invoice->getAmount(); |
| 189 | 188 | $redirectAddress = $this->settings->callbackUrl; |
| 190 | - $invoiceNumber = crc32($this->invoice->getUuid()) . rand(0, time()); |
|
| 189 | + $invoiceNumber = crc32($this->invoice->getUuid()).rand(0, time()); |
|
| 191 | 190 | |
| 192 | 191 | $iranTime = new DateTime('now', new DateTimeZone('Asia/Tehran')); |
| 193 | 192 | $invoiceDate = $iranTime->format("Y/m/d H:i:s"); |