@@ -236,7 +236,7 @@ |
||
| 236 | 236 | 'apiPaymentUrl' => 'https://pna.shaparak.ir/mhui/home/index/', |
| 237 | 237 | 'apiConfirmationUrl' => 'https://pna.shaparak.ir/mhipg/api/Payment/confirm', |
| 238 | 238 | 'CorporationPin' => '', |
| 239 | - 'currency' => 'R',//Can be R, T (Rial, Toman) |
|
| 239 | + 'currency' => 'R', //Can be R, T (Rial, Toman) |
|
| 240 | 240 | 'callbackUrl' => 'http://yoursite.com/path/to', |
| 241 | 241 | 'description' => 'payment using pna', |
| 242 | 242 | ], |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | public function __construct(Invoice $invoice, $settings) |
| 47 | 47 | { |
| 48 | 48 | $this->invoice($invoice); |
| 49 | - $this->settings = (object)$settings; |
|
| 49 | + $this->settings = (object) $settings; |
|
| 50 | 50 | $this->client = new Client(); |
| 51 | 51 | } |
| 52 | 52 | |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | if (isset($result['errors'])) { |
| 90 | 90 | throw new PurchaseFailedException($result['title'] ?? 'اطلاعات وارد شده اشتباه می باشد.', $result['status'] ?? 400); |
| 91 | 91 | } |
| 92 | - if (!isset($result['status']) || (string)$result['status'] !== '0') { |
|
| 92 | + if (!isset($result['status']) || (string) $result['status'] !== '0') { |
|
| 93 | 93 | throw new PurchaseFailedException($result['message'] ?? "خطای ناشناخته رخ داده است. در صورت کسر مبلغ از حساب حداکثر پس از 72 ساعت به حسابتان برمیگردد", $result['status'] ?? 400); |
| 94 | 94 | } |
| 95 | 95 | $this->invoice->transactionId($result['token']); |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | $transactionId = $this->invoice->getTransactionId(); |
| 107 | 107 | $paymentUrl = $this->settings->apiPaymentUrl; |
| 108 | 108 | |
| 109 | - $payUrl = $paymentUrl . $transactionId; |
|
| 109 | + $payUrl = $paymentUrl.$transactionId; |
|
| 110 | 110 | |
| 111 | 111 | return $this->redirectWithForm($payUrl, [], 'GET'); |
| 112 | 112 | } |
@@ -135,13 +135,13 @@ discard block |
||
| 135 | 135 | ); |
| 136 | 136 | $result = json_decode($response->getBody()->getContents(), true); |
| 137 | 137 | if (!isset($result['status']) |
| 138 | - || ((string)$result['status'] !== '0' |
|
| 139 | - && (string)$result['status'] !== '2') |
|
| 140 | - || (string)$result['rrn'] === '0') { |
|
| 138 | + || ((string) $result['status'] !== '0' |
|
| 139 | + && (string) $result['status'] !== '2') |
|
| 140 | + || (string) $result['rrn'] === '0') { |
|
| 141 | 141 | throw new InvalidPaymentException("خطای ناشناخته رخ داده است. در صورت کسر مبلغ از حساب حداکثر پس از 72 ساعت به حسابتان برمیگردد", $result['status'] ?? 400); |
| 142 | 142 | } |
| 143 | 143 | $refId = $result['rrn']; |
| 144 | - $receipt = new Receipt('pna', $refId); |
|
| 144 | + $receipt = new Receipt('pna', $refId); |
|
| 145 | 145 | $receipt->detail([ |
| 146 | 146 | 'cardNumberMasked'=>$result['cardNumberMasked'], |
| 147 | 147 | 'token'=>$result['token'], |