@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | { |
| 64 | 64 | |
| 65 | 65 | $this->invoice($invoice); |
| 66 | - $this->settings = (object)$settings; |
|
| 66 | + $this->settings = (object) $settings; |
|
| 67 | 67 | $this->client = new Client(); |
| 68 | 68 | $this->oauthToken = $this->oauth(); |
| 69 | 69 | } |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | // Check if the number starts with '0' and is 11 digits long |
| 82 | 82 | if (strlen($phoneNumber) === 11 && $phoneNumber[0] === '0') { |
| 83 | 83 | // Replace the leading '0' with '+98' |
| 84 | - $phoneNumber = '+98' . substr($phoneNumber, 1); |
|
| 84 | + $phoneNumber = '+98'.substr($phoneNumber, 1); |
|
| 85 | 85 | } |
| 86 | 86 | $data = [ |
| 87 | 87 | "amount" => $this->invoice->getAmount() * ($this->settings->currency == 'T' ? 10 : 1), |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | RequestOptions::BODY => json_encode($data), |
| 123 | 123 | RequestOptions::HEADERS => [ |
| 124 | 124 | 'Content-Type' => 'application/json', |
| 125 | - 'Authorization' => 'Bearer ' . $this->oauthToken, |
|
| 125 | + 'Authorization' => 'Bearer '.$this->oauthToken, |
|
| 126 | 126 | ], |
| 127 | 127 | RequestOptions::HTTP_ERRORS => false, |
| 128 | 128 | ] |
@@ -161,7 +161,7 @@ discard block |
||
| 161 | 161 | RequestOptions::BODY => json_encode(['paymentToken' => $this->invoice->getTransactionId()]), |
| 162 | 162 | RequestOptions::HEADERS => [ |
| 163 | 163 | 'Content-Type' => 'application/json', |
| 164 | - 'Authorization' => 'Bearer ' . $this->oauthToken, |
|
| 164 | + 'Authorization' => 'Bearer '.$this->oauthToken, |
|
| 165 | 165 | ], |
| 166 | 166 | RequestOptions::HTTP_ERRORS => false, |
| 167 | 167 | ] |
@@ -171,7 +171,7 @@ discard block |
||
| 171 | 171 | $body = json_decode($response->getBody()->getContents(), true); |
| 172 | 172 | if ($response->getStatusCode() != 200) { |
| 173 | 173 | $message = $body['result']['message'] ?? 'تراکنش تایید نشد'; |
| 174 | - throw new InvalidPaymentException($message, (int)$response->getStatusCode()); |
|
| 174 | + throw new InvalidPaymentException($message, (int) $response->getStatusCode()); |
|
| 175 | 175 | } |
| 176 | 176 | |
| 177 | 177 | return (new Receipt('snapppay', $body["response"]['transactionId']))->detail($body); |
@@ -190,7 +190,7 @@ discard block |
||
| 190 | 190 | $this->settings->apiOauthUrl, |
| 191 | 191 | [ |
| 192 | 192 | RequestOptions::HEADERS => [ |
| 193 | - 'Authorization' => 'Basic ' . base64_encode("{$this->settings->client_id}:{$this->settings->client_secret}"), |
|
| 193 | + 'Authorization' => 'Basic '.base64_encode("{$this->settings->client_id}:{$this->settings->client_secret}"), |
|
| 194 | 194 | ], |
| 195 | 195 | RequestOptions::MULTIPART => [ |
| 196 | 196 | [ |