@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | ); |
68 | 68 | |
69 | 69 | if (isset($this->invoice->getDetails()['customer_phone'])) { |
70 | - $data['customer_phone']=$this->invoice->getDetails()['customer_phone']; |
|
70 | + $data['customer_phone'] = $this->invoice->getDetails()['customer_phone']; |
|
71 | 71 | } |
72 | 72 | |
73 | 73 | $response = $this |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | |
86 | 86 | if (empty($body['code']) || $body['code'] != -1) { |
87 | 87 | // error has happened |
88 | - throw new PurchaseFailedException($body['message'], $body['code']??0); |
|
88 | + throw new PurchaseFailedException($body['message'], $body['code'] ?? 0); |
|
89 | 89 | } |
90 | 90 | |
91 | 91 | $this->invoice->transactionId($body['trans_id']); |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | if (!isset($body['code']) || $body['code'] != 0) { |
142 | 142 | $message = $body['message'] ?? 'خطای ناشناخته ای رخ داده است'; |
143 | 143 | |
144 | - throw new InvalidPaymentException($message, $body['code']??0); |
|
144 | + throw new InvalidPaymentException($message, $body['code'] ?? 0); |
|
145 | 145 | } |
146 | 146 | |
147 | 147 | return $this->createReceipt($transactionId); |
@@ -193,7 +193,7 @@ |
||
193 | 193 | $terminalCode = $this->settings->terminalCode; |
194 | 194 | $amount = $this->invoice->getAmount(); //rial |
195 | 195 | $redirectAddress = $this->settings->callbackUrl; |
196 | - $invoiceNumber = $this->invoice->getUuid(true) . rand(0, time()); |
|
196 | + $invoiceNumber = $this->invoice->getUuid(true).rand(0, time()); |
|
197 | 197 | $timeStamp = date("Y/m/d H:i:s"); |
198 | 198 | $invoiceDate = date("Y/m/d H:i:s"); |
199 | 199 |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | public function __construct(Invoice $invoice, $settings) |
38 | 38 | { |
39 | 39 | $this->invoice($invoice); |
40 | - $this->settings = (object)$settings; |
|
40 | + $this->settings = (object) $settings; |
|
41 | 41 | } |
42 | 42 | |
43 | 43 | /** |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | |
69 | 69 | $response = $soap->RequestToken($data['MID'], $data['ResNum'], $data['Amount'], $data['CellNumber']); |
70 | 70 | |
71 | - $status = (int)$response; |
|
71 | + $status = (int) $response; |
|
72 | 72 | |
73 | 73 | if ($status < 0) { // if something has done in a wrong way |
74 | 74 | $this->purchaseFailed($response); |
@@ -116,13 +116,13 @@ discard block |
||
116 | 116 | ); |
117 | 117 | |
118 | 118 | $soap = new \SoapClient($this->settings->apiVerificationUrl); |
119 | - $status = (int)$soap->VerifyTransaction($data['RefNum'], $data['merchantId']); |
|
119 | + $status = (int) $soap->VerifyTransaction($data['RefNum'], $data['merchantId']); |
|
120 | 120 | |
121 | 121 | if ($status < 0) { |
122 | 122 | $this->notVerified($status); |
123 | 123 | } |
124 | 124 | |
125 | - $receipt = $this->createReceipt($data['RefNum']); |
|
125 | + $receipt = $this->createReceipt($data['RefNum']); |
|
126 | 126 | $receipt->detail([ |
127 | 127 | 'traceNo' => Request::input('TRACENO'), |
128 | 128 | 'referenceNo' => Request::input('RRN'), |
@@ -176,9 +176,9 @@ discard block |
||
176 | 176 | ); |
177 | 177 | |
178 | 178 | if (array_key_exists($status, $translations)) { |
179 | - throw new PurchaseFailedException($translations[$status], is_numeric($status)?$status:0); |
|
179 | + throw new PurchaseFailedException($translations[$status], is_numeric($status) ? $status : 0); |
|
180 | 180 | } else { |
181 | - throw new PurchaseFailedException('خطای ناشناخته ای رخ داده است.', is_numeric($status)?$status:0); |
|
181 | + throw new PurchaseFailedException('خطای ناشناخته ای رخ داده است.', is_numeric($status) ? $status : 0); |
|
182 | 182 | } |
183 | 183 | } |
184 | 184 | |
@@ -211,9 +211,9 @@ discard block |
||
211 | 211 | ); |
212 | 212 | |
213 | 213 | if (array_key_exists($status, $translations)) { |
214 | - throw new InvalidPaymentException($translations[$status], is_numeric($status)?$status:0); |
|
214 | + throw new InvalidPaymentException($translations[$status], is_numeric($status) ? $status : 0); |
|
215 | 215 | } else { |
216 | - throw new InvalidPaymentException('خطای ناشناخته ای رخ داده است.', is_numeric($status)?$status:0); |
|
216 | + throw new InvalidPaymentException('خطای ناشناخته ای رخ داده است.', is_numeric($status) ? $status : 0); |
|
217 | 217 | } |
218 | 218 | } |
219 | 219 | } |