@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | public function __construct(Invoice $invoice, $settings) |
| 59 | 59 | { |
| 60 | 60 | $this->invoice($invoice); |
| 61 | - $this->settings = (object)$settings; |
|
| 61 | + $this->settings = (object) $settings; |
|
| 62 | 62 | |
| 63 | 63 | if ($this->settings->currency == 'T') { // convert amount to rial, payment gateways need rial |
| 64 | 64 | $this->invoice->amount($this->invoice->getAmount() * 10); |
@@ -195,9 +195,9 @@ discard block |
||
| 195 | 195 | public function token(): array |
| 196 | 196 | { |
| 197 | 197 | if (strpos($this->settings->callbackUrl, '?') !== false) { |
| 198 | - $query = '&' . http_build_query(['invoice' => $this->invoice->getUuid()]); |
|
| 198 | + $query = '&'.http_build_query(['invoice' => $this->invoice->getUuid()]); |
|
| 199 | 199 | } else { |
| 200 | - $query = '?' . http_build_query(['invoice' => $this->invoice->getUuid()]); |
|
| 200 | + $query = '?'.http_build_query(['invoice' => $this->invoice->getUuid()]); |
|
| 201 | 201 | } |
| 202 | 202 | |
| 203 | 203 | return $this->callApi('POST', self::TokenURL, [ |
@@ -206,7 +206,7 @@ discard block |
||
| 206 | 206 | 'localInvoiceId' => $this->invoice->getUuid(), |
| 207 | 207 | 'amountInRials' => $this->invoice->getAmount(), |
| 208 | 208 | 'localDate' => $this->getTime()['content'], |
| 209 | - 'callbackURL' => $this->settings->callbackUrl . $query, |
|
| 209 | + 'callbackURL' => $this->settings->callbackUrl.$query, |
|
| 210 | 210 | 'paymentId' => "0", |
| 211 | 211 | 'additionalData' => '', |
| 212 | 212 | ]); |
@@ -220,8 +220,8 @@ discard block |
||
| 220 | 220 | public function reverse(): array |
| 221 | 221 | { |
| 222 | 222 | return $this->callApi('POST', self::ReverseURL, [ |
| 223 | - 'merchantConfigurationId' => (int)$this->settings->merchantConfigID, |
|
| 224 | - 'payGateTranId' => (int)$this->invoice->getUuid() |
|
| 223 | + 'merchantConfigurationId' => (int) $this->settings->merchantConfigID, |
|
| 224 | + 'payGateTranId' => (int) $this->invoice->getUuid() |
|
| 225 | 225 | ]); |
| 226 | 226 | } |
| 227 | 227 | |
@@ -233,8 +233,8 @@ discard block |
||
| 233 | 233 | public function cancel(): array |
| 234 | 234 | { |
| 235 | 235 | return $this->callApi('POST', self::CancelURL, [ |
| 236 | - 'merchantConfigurationId' => (int)$this->settings->merchantConfigID, |
|
| 237 | - 'payGateTranId' => (int)$this->payGateTransactionId |
|
| 236 | + 'merchantConfigurationId' => (int) $this->settings->merchantConfigID, |
|
| 237 | + 'payGateTranId' => (int) $this->payGateTransactionId |
|
| 238 | 238 | ]); |
| 239 | 239 | } |
| 240 | 240 | |
@@ -246,8 +246,8 @@ discard block |
||
| 246 | 246 | public function verifyTransaction(): array |
| 247 | 247 | { |
| 248 | 248 | return $this->callApi('POST', self::VerifyURL, [ |
| 249 | - 'merchantConfigurationId' => (int)$this->settings->merchantConfigID, |
|
| 250 | - 'payGateTranId' => (int)$this->payGateTransactionId |
|
| 249 | + 'merchantConfigurationId' => (int) $this->settings->merchantConfigID, |
|
| 250 | + 'payGateTranId' => (int) $this->payGateTransactionId |
|
| 251 | 251 | ]); |
| 252 | 252 | } |
| 253 | 253 | |
@@ -259,8 +259,8 @@ discard block |
||
| 259 | 259 | public function settlement(): array |
| 260 | 260 | { |
| 261 | 261 | return $this->callApi('POST', self::SettlementURL, [ |
| 262 | - 'merchantConfigurationId' => (int)$this->settings->merchantConfigID, |
|
| 263 | - 'payGateTranId' => (int)$this->payGateTransactionId |
|
| 262 | + 'merchantConfigurationId' => (int) $this->settings->merchantConfigID, |
|
| 263 | + 'payGateTranId' => (int) $this->payGateTransactionId |
|
| 264 | 264 | ]); |
| 265 | 265 | } |
| 266 | 266 | |
@@ -271,7 +271,7 @@ discard block |
||
| 271 | 271 | */ |
| 272 | 272 | public function cardHash(): array |
| 273 | 273 | { |
| 274 | - return $this->callApi('GET', self::CardHashURL . '?merchantConfigurationId=' . $this->settings->merchantConfigID . '&localInvoiceId=' . $this->invoice->getTransactionId(), []); |
|
| 274 | + return $this->callApi('GET', self::CardHashURL.'?merchantConfigurationId='.$this->settings->merchantConfigID.'&localInvoiceId='.$this->invoice->getTransactionId(), []); |
|
| 275 | 275 | } |
| 276 | 276 | |
| 277 | 277 | /** |
@@ -281,7 +281,7 @@ discard block |
||
| 281 | 281 | */ |
| 282 | 282 | public function transactionResult(): array |
| 283 | 283 | { |
| 284 | - return $this->callApi('GET', self::TranResultURL . '?merchantConfigurationId=' . $this->settings->merchantConfigID . '&localInvoiceId=' . $this->invoice->getTransactionId(), []); |
|
| 284 | + return $this->callApi('GET', self::TranResultURL.'?merchantConfigurationId='.$this->settings->merchantConfigID.'&localInvoiceId='.$this->invoice->getTransactionId(), []); |
|
| 285 | 285 | } |
| 286 | 286 | |
| 287 | 287 | /** |