@@ -24,7 +24,7 @@ |
||
24 | 24 | /** |
25 | 25 | * Bind to service container. |
26 | 26 | */ |
27 | - $this->app->bind('shetabit-payment', function () { |
|
27 | + $this->app->bind('shetabit-payment', function() { |
|
28 | 28 | return new PaymentManager(config('payment')); |
29 | 29 | }); |
30 | 30 | } |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | public function __construct(Invoice $invoice, $settings) |
33 | 33 | { |
34 | 34 | $this->invoice($invoice); |
35 | - $this->settings = (object)$settings; |
|
35 | + $this->settings = (object) $settings; |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | /** |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | $soap = new \SoapClient($this->settings->apiVerificationUrl); |
118 | 118 | $response = $soap->KicccPaymentsVerification($data); |
119 | 119 | |
120 | - $status = (int)($response->KicccPaymentsVerificationResult); |
|
120 | + $status = (int) ($response->KicccPaymentsVerificationResult); |
|
121 | 121 | |
122 | 122 | if ($status != $data['amount']) { |
123 | 123 | $this->notVerified($status); |
@@ -113,7 +113,7 @@ |
||
113 | 113 | * $resMessage = $returningParams[4]; |
114 | 114 | * $rrn = $returningParams[6]; |
115 | 115 | * $lastFourDigitOfPAN = $returningParams[7]; |
116 | - **/ |
|
116 | + **/ |
|
117 | 117 | |
118 | 118 | $resCode = $returningParams[3]; |
119 | 119 | $payGateTranID = $returningParams[5]; |
@@ -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 |
@@ -99,7 +99,7 @@ |
||
99 | 99 | */ |
100 | 100 | public function pay() |
101 | 101 | { |
102 | - $apiUrl = $this->settings->apiPaymentUrl; |
|
102 | + $apiUrl = $this->settings->apiPaymentUrl; |
|
103 | 103 | |
104 | 104 | // use sandbox url if we are in sandbox mode |
105 | 105 | if (!empty($this->settings->sandbox)) { |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | public function __construct(Invoice $invoice, $settings) |
33 | 33 | { |
34 | 34 | $this->invoice($invoice); |
35 | - $this->settings = (object)$settings; |
|
35 | + $this->settings = (object) $settings; |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | /** |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | $data->merchantId = $this->settings->merchantId; |
67 | 67 | $data->amount = $this->invoice->getAmount(); |
68 | 68 | $data->callback = $this->settings->callbackUrl; |
69 | - $data->orderNumber = intval(1, time()) . crc32($this->invoice->getUuid()); |
|
69 | + $data->orderNumber = intval(1, time()).crc32($this->invoice->getUuid()); |
|
70 | 70 | |
71 | 71 | $data->fromCurrencyCode = 978; |
72 | 72 | $data->toCurrencyCode = 364; |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | */ |
104 | 104 | public function pay() |
105 | 105 | { |
106 | - $payUrl = $this->settings->apiPaymentUrl . $this->invoice->getTransactionId(); |
|
106 | + $payUrl = $this->settings->apiPaymentUrl.$this->invoice->getTransactionId(); |
|
107 | 107 | |
108 | 108 | // redirect using laravel logic |
109 | 109 | return redirect()->to($payUrl); |
@@ -97,8 +97,8 @@ |
||
97 | 97 | */ |
98 | 98 | public function pay() |
99 | 99 | { |
100 | - $apiUrl = $this->settings->apiPaymentUrl; |
|
101 | - $payUrl = $apiUrl . $this->invoice->getTransactionId(); |
|
100 | + $apiUrl = $this->settings->apiPaymentUrl; |
|
101 | + $payUrl = $apiUrl.$this->invoice->getTransactionId(); |
|
102 | 102 | |
103 | 103 | // redirect using laravel logic |
104 | 104 | return redirect()->to($payUrl); |
@@ -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); |