@@ -214,7 +214,7 @@ discard block |
||
| 214 | 214 | $headers = [ |
| 215 | 215 | 'Accept' => 'application/json', |
| 216 | 216 | 'Content-Type' => 'application/json', |
| 217 | - 'Authorization' => 'Basic ' . $this->getAuthorization() |
|
| 217 | + 'Authorization' => 'Basic '.$this->getAuthorization() |
|
| 218 | 218 | ]; |
| 219 | 219 | |
| 220 | 220 | $httpResponse = $this->httpClient->request('POST', $this->getEndpoint('sessions'), $headers, json_encode($data)); |
@@ -238,7 +238,7 @@ discard block |
||
| 238 | 238 | * @return string |
| 239 | 239 | */ |
| 240 | 240 | protected function getEndpoint($path = '') { |
| 241 | - return ($this->getTestMode() ? self::endpointTest : self::endpointLive) . '/' . $path; |
|
| 241 | + return ($this->getTestMode() ? self::endpointTest : self::endpointLive).'/'.$path; |
|
| 242 | 242 | } |
| 243 | 243 | |
| 244 | 244 | protected function getAuthorization() { |
@@ -221,8 +221,7 @@ |
||
| 221 | 221 | |
| 222 | 222 | try { |
| 223 | 223 | $responseData = json_decode($httpResponse->getBody()->getContents()); |
| 224 | - } |
|
| 225 | - catch (\Exception $exception) { |
|
| 224 | + } catch (\Exception $exception) { |
|
| 226 | 225 | $responseData = []; |
| 227 | 226 | } |
| 228 | 227 | |
@@ -23,11 +23,11 @@ |
||
| 23 | 23 | $headers = [ |
| 24 | 24 | 'Accept' => 'application/json', |
| 25 | 25 | 'Content-Type' => 'application/json', |
| 26 | - 'Authorization' => 'Basic ' . $this->getAuthorization() |
|
| 26 | + 'Authorization' => 'Basic '.$this->getAuthorization() |
|
| 27 | 27 | ]; |
| 28 | 28 | |
| 29 | 29 | try { |
| 30 | - $httpResponse = $this->httpClient->request('GET', $this->getEndpoint('sessions/' . $sessionId), $headers); |
|
| 30 | + $httpResponse = $this->httpClient->request('GET', $this->getEndpoint('sessions/'.$sessionId), $headers); |
|
| 31 | 31 | } |
| 32 | 32 | catch (\Exception $exception) { |
| 33 | 33 | throw new InvalidRequestException($exception->getMessage()); |
@@ -28,8 +28,7 @@ |
||
| 28 | 28 | |
| 29 | 29 | try { |
| 30 | 30 | $httpResponse = $this->httpClient->request('GET', $this->getEndpoint('sessions/' . $sessionId), $headers); |
| 31 | - } |
|
| 32 | - catch (\Exception $exception) { |
|
| 31 | + } catch (\Exception $exception) { |
|
| 33 | 32 | throw new InvalidRequestException($exception->getMessage()); |
| 34 | 33 | } |
| 35 | 34 | |
@@ -27,11 +27,11 @@ discard block |
||
| 27 | 27 | $headers = [ |
| 28 | 28 | 'Accept' => 'application/json', |
| 29 | 29 | 'Content-Type' => 'application/json', |
| 30 | - 'Authorization' => 'Basic ' . $this->getAuthorization() |
|
| 30 | + 'Authorization' => 'Basic '.$this->getAuthorization() |
|
| 31 | 31 | ]; |
| 32 | 32 | |
| 33 | 33 | try { |
| 34 | - $httpResponse = $this->httpClient->request('GET', $this->getEndpoint('sessions/' . $sessionId), $headers); |
|
| 34 | + $httpResponse = $this->httpClient->request('GET', $this->getEndpoint('sessions/'.$sessionId), $headers); |
|
| 35 | 35 | } |
| 36 | 36 | catch (\Exception $exception) { |
| 37 | 37 | throw new InvalidRequestException($exception->getMessage()); |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | public function getTransactionStatus() { |
| 57 | - if ($this->getTransaction() && $this->getAuthorised() && $this->getResponseText() === 'APPROVED') { |
|
| 57 | + if ($this->getTransaction() && $this->getAuthorised() && $this->getResponseText() === 'APPROVED') { |
|
| 58 | 58 | return static::STATUS_COMPLETED; |
| 59 | 59 | } |
| 60 | 60 | |
@@ -32,8 +32,7 @@ |
||
| 32 | 32 | |
| 33 | 33 | try { |
| 34 | 34 | $httpResponse = $this->httpClient->request('GET', $this->getEndpoint('sessions/' . $sessionId), $headers); |
| 35 | - } |
|
| 36 | - catch (\Exception $exception) { |
|
| 35 | + } catch (\Exception $exception) { |
|
| 37 | 36 | throw new InvalidRequestException($exception->getMessage()); |
| 38 | 37 | } |
| 39 | 38 | |
@@ -75,7 +75,7 @@ |
||
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | public function getCardExpiry() { |
| 78 | - return ($this->getCard()['dateExpiryMonth'] ?? '') . '/' . ($this->getCard()['dateExpiryYear'] ?? ''); |
|
| 78 | + return ($this->getCard()['dateExpiryMonth'] ?? '').'/'.($this->getCard()['dateExpiryYear'] ?? ''); |
|
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | public function getCardType() { |
@@ -20,7 +20,7 @@ |
||
| 20 | 20 | } |
| 21 | 21 | |
| 22 | 22 | public function getRedirectUrl() { |
| 23 | - foreach ( $this->data->links ?? [] as $link ) { |
|
| 23 | + foreach ($this->data->links ?? [] as $link) { |
|
| 24 | 24 | if ($link->rel === 'hpp') { |
| 25 | 25 | return $link->href; |
| 26 | 26 | } |