@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | public function __construct(Invoice $invoice, $settings) |
63 | 63 | { |
64 | 64 | $this->invoice($invoice); |
65 | - $this->settings = (object)$settings; |
|
65 | + $this->settings = (object) $settings; |
|
66 | 66 | $this->client = new Client(); |
67 | 67 | $this->oauthToken = $this->oauth(); |
68 | 68 | } |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | // Check if the number starts with '0' and is 11 digits long |
79 | 79 | if (strlen($phoneNumber) === 11 && $phoneNumber[0] === '0') { |
80 | 80 | // Replace the leading '0' with '+98' |
81 | - $phoneNumber = '+98' . substr($phoneNumber, 1); |
|
81 | + $phoneNumber = '+98'.substr($phoneNumber, 1); |
|
82 | 82 | } |
83 | 83 | $data = [ |
84 | 84 | "amount" => $this->invoice->getAmount() * ($this->settings->currency == 'T' ? 10 : 1), |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | RequestOptions::BODY => json_encode($data), |
120 | 120 | RequestOptions::HEADERS => [ |
121 | 121 | 'Content-Type' => 'application/json', |
122 | - 'Authorization' => 'Bearer ' . $this->oauthToken, |
|
122 | + 'Authorization' => 'Bearer '.$this->oauthToken, |
|
123 | 123 | ], |
124 | 124 | RequestOptions::HTTP_ERRORS => false, |
125 | 125 | ] |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | RequestOptions::BODY => json_encode(['paymentToken' => $this->invoice->getTransactionId()]), |
157 | 157 | RequestOptions::HEADERS => [ |
158 | 158 | 'Content-Type' => 'application/json', |
159 | - 'Authorization' => 'Bearer ' . $this->oauthToken, |
|
159 | + 'Authorization' => 'Bearer '.$this->oauthToken, |
|
160 | 160 | ], |
161 | 161 | RequestOptions::HTTP_ERRORS => false, |
162 | 162 | ] |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | $body = json_decode($response->getBody()->getContents(), true); |
165 | 165 | if ($response->getStatusCode() != 200) { |
166 | 166 | $message = $body['result']['message'] ?? 'تراکنش تایید نشد'; |
167 | - throw new InvalidPaymentException($message, (int)$response->getStatusCode()); |
|
167 | + throw new InvalidPaymentException($message, (int) $response->getStatusCode()); |
|
168 | 168 | } |
169 | 169 | |
170 | 170 | return (new Receipt('snapppay', $body["response"]['transactionId']))->detail($body); |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | $this->settings->apiOauthUrl, |
183 | 183 | [ |
184 | 184 | RequestOptions::HEADERS => [ |
185 | - 'Authorization' => 'Basic ' . base64_encode("{$this->settings->client_id}:{$this->settings->client_secret}"), |
|
185 | + 'Authorization' => 'Basic '.base64_encode("{$this->settings->client_id}:{$this->settings->client_secret}"), |
|
186 | 186 | ], |
187 | 187 | RequestOptions::MULTIPART => [ |
188 | 188 | [ |