@@ -131,23 +131,23 @@ discard block |
||
131 | 131 | $data['storeCard'] = (bool) $this->getStoreCard() ?? false; |
132 | 132 | $data['callbackUrls'] = []; |
133 | 133 | |
134 | - if ( $this->getMerchantReference() ) { |
|
134 | + if ($this->getMerchantReference()) { |
|
135 | 135 | $data['merchantReference'] = $this->getMerchantReference(); |
136 | 136 | } |
137 | 137 | |
138 | - if ( $this->getReturnUrl() ) { |
|
138 | + if ($this->getReturnUrl()) { |
|
139 | 139 | $data['callbackUrls']['approved'] = $this->getReturnUrl(); |
140 | 140 | } |
141 | 141 | |
142 | - if ( $this->getDeclineUrl() ) { |
|
142 | + if ($this->getDeclineUrl()) { |
|
143 | 143 | $data['callbackUrls']['declined'] = $this->getDeclineUrl(); |
144 | 144 | } |
145 | 145 | |
146 | - if ( $this->getCancelUrl() ) { |
|
146 | + if ($this->getCancelUrl()) { |
|
147 | 147 | $data['callbackUrls']['cancelled'] = $this->getCancelUrl(); |
148 | 148 | } |
149 | 149 | |
150 | - if ( $this->getNotifyUrl() ) { |
|
150 | + if ($this->getNotifyUrl()) { |
|
151 | 151 | $data['notificationUrl'] = $this->getNotifyUrl(); |
152 | 152 | } |
153 | 153 | |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | $headers = [ |
162 | 162 | 'Accept' => 'application/json', |
163 | 163 | 'Content-Type' => 'application/json', |
164 | - 'Authorization' => 'Basic ' . $this->getAuthorization() |
|
164 | + 'Authorization' => 'Basic '.$this->getAuthorization() |
|
165 | 165 | ]; |
166 | 166 | |
167 | 167 | $httpResponse = $this->httpClient->request('POST', $this->getEndpoint('sessions'), $headers, json_encode($data)); |
@@ -185,7 +185,7 @@ discard block |
||
185 | 185 | */ |
186 | 186 | protected function getEndpoint($path = '') |
187 | 187 | { |
188 | - return ($this->getTestMode() ? self::endpointTest : self::endpointLive) . '/' . $path; |
|
188 | + return ($this->getTestMode() ? self::endpointTest : self::endpointLive).'/'.$path; |
|
189 | 189 | } |
190 | 190 | |
191 | 191 | protected function getAuthorization() |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | |
31 | 31 | public function sendData($data) |
32 | 32 | { |
33 | - if ( !$data['sessionId'] ) { |
|
33 | + if (!$data['sessionId']) { |
|
34 | 34 | throw new InvalidRequestException('Session id is required'); |
35 | 35 | } |
36 | 36 | |
@@ -39,11 +39,11 @@ discard block |
||
39 | 39 | $headers = [ |
40 | 40 | 'Accept' => 'application/json', |
41 | 41 | 'Content-Type' => 'application/json', |
42 | - 'Authorization' => 'Basic ' . $this->getAuthorization() |
|
42 | + 'Authorization' => 'Basic '.$this->getAuthorization() |
|
43 | 43 | ]; |
44 | 44 | |
45 | 45 | try { |
46 | - $httpResponse = $this->httpClient->request('GET', $this->getEndpoint('sessions/' . $sessionId), $headers); |
|
46 | + $httpResponse = $this->httpClient->request('GET', $this->getEndpoint('sessions/'.$sessionId), $headers); |
|
47 | 47 | } catch (\Exception $exception) { |
48 | 48 | throw new InvalidRequestException($exception->getMessage()); |
49 | 49 | } |
@@ -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 | } |