@@ -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); |
@@ -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); |
@@ -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 | /** |
@@ -119,7 +119,7 @@ discard block |
||
| 119 | 119 | (!isset($result['Status']) || $result['Status'] != 0) || (!isset($result['RRN']) || $result['RRN'] <= 0); |
| 120 | 120 | |
| 121 | 121 | if ($hasBankError) { |
| 122 | - $message = 'خطا از سمت بانک با کد ' . $result['Status'] . ' رخ داده است.'; |
|
| 122 | + $message = 'خطا از سمت بانک با کد '.$result['Status'].' رخ داده است.'; |
|
| 123 | 123 | throw new InvalidPaymentException($message); |
| 124 | 124 | } |
| 125 | 125 | |