@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | public function __construct(Invoice $invoice, $settings) |
| 36 | 36 | { |
| 37 | 37 | $this->invoice($invoice); |
| 38 | - $this->settings = (object)$settings; |
|
| 38 | + $this->settings = (object) $settings; |
|
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | /** |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | $params = $this->preparePurchaseData(); |
| 62 | 62 | $result = $client->RequestOperation($params); |
| 63 | 63 | |
| 64 | - if (! $result) { |
|
| 64 | + if (!$result) { |
|
| 65 | 65 | throw new PurchaseFailedException('خطای فراخوانی متد درخواست تراکنش.'); |
| 66 | 66 | } |
| 67 | 67 | |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | $payGateTranID = $returningParams[5]; |
| 123 | 123 | |
| 124 | 124 | if ($resCode != '0' && $resCode != '00') { |
| 125 | - $message = "خطای شماره " . $resCode . " رخ داده و تراکنش ناموفق بوده است."; |
|
| 125 | + $message = "خطای شماره ".$resCode." رخ داده و تراکنش ناموفق بوده است."; |
|
| 126 | 126 | throw new InvalidPaymentException($message); |
| 127 | 127 | } |
| 128 | 128 | |
@@ -141,7 +141,7 @@ discard block |
||
| 141 | 141 | // step1: verify |
| 142 | 142 | $result = $client->RequestVerification($params); |
| 143 | 143 | |
| 144 | - if (! $result) { |
|
| 144 | + if (!$result) { |
|
| 145 | 145 | throw new InvalidPaymentException("خطای فراخوانی متد وريفای رخ داده است."); |
| 146 | 146 | } |
| 147 | 147 | |
@@ -154,7 +154,7 @@ discard block |
||
| 154 | 154 | // step2: settle |
| 155 | 155 | $result = $client->RequestReconciliation($params); |
| 156 | 156 | |
| 157 | - if (! $result) { |
|
| 157 | + if (!$result) { |
|
| 158 | 158 | throw new InvalidPaymentException('خطای فراخوانی متد تسويه رخ داده است.'); |
| 159 | 159 | } |
| 160 | 160 | |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | public function __construct(Invoice $invoice, $settings) |
| 44 | 44 | { |
| 45 | 45 | $this->invoice($invoice); |
| 46 | - $this->settings = (object)$settings; |
|
| 46 | + $this->settings = (object) $settings; |
|
| 47 | 47 | $this->client = new Client(); |
| 48 | 48 | } |
| 49 | 49 | |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | |
| 91 | 91 | $body = json_decode($response->getBody()->getContents(), true); |
| 92 | 92 | |
| 93 | - if ($body->ResCode!=0) { |
|
| 93 | + if ($body->ResCode != 0) { |
|
| 94 | 94 | throw new PurchaseFailedException($body->Description); |
| 95 | 95 | } |
| 96 | 96 | |
@@ -129,7 +129,7 @@ discard block |
||
| 129 | 129 | $resCode = request()->get('ResCode'); |
| 130 | 130 | $message = 'تراکنش نا موفق بود در صورت کسر مبلغ از حساب شما حداکثر پس از 72 ساعت مبلغ به حسابتان برمیگردد.'; |
| 131 | 131 | |
| 132 | - if ($resCode==0) { |
|
| 132 | + if ($resCode == 0) { |
|
| 133 | 133 | throw new InvalidPaymentException($message); |
| 134 | 134 | } |
| 135 | 135 | |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | public function __construct(Invoice $invoice, $settings) |
| 44 | 44 | { |
| 45 | 45 | $this->invoice($invoice); |
| 46 | - $this->settings = (object)$settings; |
|
| 46 | + $this->settings = (object) $settings; |
|
| 47 | 47 | $this->client = new Client(); |
| 48 | 48 | } |
| 49 | 49 | |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | if (strtolower($this->getMode()) == 'zaringate') { |
| 100 | 100 | $payUrl = str_replace(':authority', $transactionId, $paymentUrl); |
| 101 | 101 | } else { |
| 102 | - $payUrl = $paymentUrl . $transactionId; |
|
| 102 | + $payUrl = $paymentUrl.$transactionId; |
|
| 103 | 103 | } |
| 104 | 104 | |
| 105 | 105 | // redirect using laravel logic |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | public function __construct(Invoice $invoice, $settings) |
| 36 | 36 | { |
| 37 | 37 | $this->invoice($invoice); |
| 38 | - $this->settings = (object)$settings; |
|
| 38 | + $this->settings = (object) $settings; |
|
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | /** |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | */ |
| 106 | 106 | public function verify() : ReceiptInterface |
| 107 | 107 | { |
| 108 | - $resCode = request()->get('ResCode'); |
|
| 108 | + $resCode = request()->get('ResCode'); |
|
| 109 | 109 | if ($resCode != '0') { |
| 110 | 110 | $message = $resCode ?? 'تراکنش نا موفق بوده است.'; |
| 111 | 111 | throw new InvalidPaymentException($message); |