@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | return ( |
| 32 | 32 | $transaction && |
| 33 | 33 | ($transaction['authorised'] ?? false) && |
| 34 | - ( strtoupper($transaction['responseText'] ?? '') ) === 'APPROVED' |
|
| 34 | + (strtoupper($transaction['responseText'] ?? '')) === 'APPROVED' |
|
| 35 | 35 | ) ?? false; |
| 36 | 36 | } |
| 37 | 37 | |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | |
| 91 | 91 | public function getCardExpiry() |
| 92 | 92 | { |
| 93 | - return ($this->getCard()['dateExpiryMonth'] ?? '') . '/' . ($this->getCard()['dateExpiryYear'] ?? ''); |
|
| 93 | + return ($this->getCard()['dateExpiryMonth'] ?? '').'/'.($this->getCard()['dateExpiryYear'] ?? ''); |
|
| 94 | 94 | } |
| 95 | 95 | |
| 96 | 96 | public function getCardType() |
@@ -25,8 +25,8 @@ |
||
| 25 | 25 | { |
| 26 | 26 | // echo '<pre>'; print_r($this->data); echo '</pre>'; |
| 27 | 27 | |
| 28 | - foreach ( $this->data->links ?? [] as $link ) { |
|
| 29 | - if ( $link->rel === 'hpp' ) { |
|
| 28 | + foreach ($this->data->links ?? [] as $link) { |
|
| 29 | + if ($link->rel === 'hpp') { |
|
| 30 | 30 | return $link->href; |
| 31 | 31 | } |
| 32 | 32 | } |
@@ -16,7 +16,7 @@ discard block |
||
| 16 | 16 | } |
| 17 | 17 | public function sendData($data) |
| 18 | 18 | { |
| 19 | - if ( !$data['sessionId'] ) { |
|
| 19 | + if (!$data['sessionId']) { |
|
| 20 | 20 | throw new InvalidRequestException('Session id is required'); |
| 21 | 21 | } |
| 22 | 22 | |
@@ -25,11 +25,11 @@ discard block |
||
| 25 | 25 | $headers = [ |
| 26 | 26 | 'Accept' => 'application/json', |
| 27 | 27 | 'Content-Type' => 'application/json', |
| 28 | - 'Authorization' => 'Basic ' . $this->getAuthorization() |
|
| 28 | + 'Authorization' => 'Basic '.$this->getAuthorization() |
|
| 29 | 29 | ]; |
| 30 | 30 | |
| 31 | 31 | try { |
| 32 | - $httpResponse = $this->httpClient->request('GET', $this->getEndpoint('sessions/' . $sessionId), $headers); |
|
| 32 | + $httpResponse = $this->httpClient->request('GET', $this->getEndpoint('sessions/'.$sessionId), $headers); |
|
| 33 | 33 | } catch (\Exception $exception) { |
| 34 | 34 | throw new InvalidRequestException($exception->getMessage()); |
| 35 | 35 | } |
@@ -150,35 +150,35 @@ discard block |
||
| 150 | 150 | $data['storeCard'] = (bool) $this->getStoreCard() ?? false; |
| 151 | 151 | $data['callbackUrls'] = []; |
| 152 | 152 | |
| 153 | - if ( is_array($this->getPaymentMethods()) ) { |
|
| 153 | + if (is_array($this->getPaymentMethods())) { |
|
| 154 | 154 | $data['methods'] = $this->getPaymentMethods(); |
| 155 | 155 | } |
| 156 | 156 | |
| 157 | - if ( is_array($this->getCardTypes()) ) { |
|
| 157 | + if (is_array($this->getCardTypes())) { |
|
| 158 | 158 | $data['cardTypes'] = $this->getCardTypes(); |
| 159 | 159 | } |
| 160 | 160 | |
| 161 | - if ( is_array($this->getMetadata()) ) { |
|
| 161 | + if (is_array($this->getMetadata())) { |
|
| 162 | 162 | $data['metaData'] = $this->getMetadata(); |
| 163 | 163 | } |
| 164 | 164 | |
| 165 | - if ( $this->getMerchantReference() ) { |
|
| 165 | + if ($this->getMerchantReference()) { |
|
| 166 | 166 | $data['merchantReference'] = $this->getMerchantReference(); |
| 167 | 167 | } |
| 168 | 168 | |
| 169 | - if ( $this->getReturnUrl() ) { |
|
| 169 | + if ($this->getReturnUrl()) { |
|
| 170 | 170 | $data['callbackUrls']['approved'] = $this->getReturnUrl(); |
| 171 | 171 | } |
| 172 | 172 | |
| 173 | - if ( $this->getDeclineUrl() ) { |
|
| 173 | + if ($this->getDeclineUrl()) { |
|
| 174 | 174 | $data['callbackUrls']['declined'] = $this->getDeclineUrl(); |
| 175 | 175 | } |
| 176 | 176 | |
| 177 | - if ( $this->getCancelUrl() ) { |
|
| 177 | + if ($this->getCancelUrl()) { |
|
| 178 | 178 | $data['callbackUrls']['cancelled'] = $this->getCancelUrl(); |
| 179 | 179 | } |
| 180 | 180 | |
| 181 | - if ( $this->getNotifyUrl() ) { |
|
| 181 | + if ($this->getNotifyUrl()) { |
|
| 182 | 182 | $data['notificationUrl'] = $this->getNotifyUrl(); |
| 183 | 183 | } |
| 184 | 184 | |
@@ -190,7 +190,7 @@ discard block |
||
| 190 | 190 | $headers = [ |
| 191 | 191 | 'Accept' => 'application/json', |
| 192 | 192 | 'Content-Type' => 'application/json', |
| 193 | - 'Authorization' => 'Basic ' . $this->getAuthorization() |
|
| 193 | + 'Authorization' => 'Basic '.$this->getAuthorization() |
|
| 194 | 194 | ]; |
| 195 | 195 | |
| 196 | 196 | $httpResponse = $this->httpClient->request('POST', $this->getEndpoint('sessions'), $headers, json_encode($data)); |
@@ -214,7 +214,7 @@ discard block |
||
| 214 | 214 | */ |
| 215 | 215 | protected function getEndpoint($path = '') |
| 216 | 216 | { |
| 217 | - return ($this->getTestMode() ? self::endpointTest : self::endpointLive) . '/' . $path; |
|
| 217 | + return ($this->getTestMode() ? self::endpointTest : self::endpointLive).'/'.$path; |
|
| 218 | 218 | } |
| 219 | 219 | |
| 220 | 220 | protected function getAuthorization() |