Passed
Push — main ( 536cb4...ad2370 )
by
unknown
08:47
created
src/Message/PurchaseRequest.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -85,8 +85,8 @@  discard block
 block discarded – undo
85 85
             'oxipay', 'visacheckout', 'wechat'
86 86
         ];
87 87
 
88
-        foreach ( $list as $method ) {
89
-            if ( !in_array($method, $options) ) {
88
+        foreach ($list as $method) {
89
+            if (!in_array($method, $options)) {
90 90
                 throw new InvalidRequestException("Unknown payment method: {$method}");
91 91
             }
92 92
         }
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
             'resubmission', 'reauthorisation', 'delayedcharges', 'noshow'
149 149
         ];
150 150
 
151
-        if ( ! in_array($value, $options) ) {
151
+        if (!in_array($value, $options)) {
152 152
             throw new InvalidRequestException("Invalid option '{$value}' set for StoredCardIndicator.");
153 153
         }
154 154
 
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
             'twomonthly', 'threemonthly', 'fourmonthly', 'sixmonthly', 'annually'
180 180
         ];
181 181
 
182
-        if ( ! in_array($value, $options) ) {
182
+        if (!in_array($value, $options)) {
183 183
             throw new InvalidRequestException("Invalid option '{$value}' set for RecurringFrequency.");
184 184
         }
185 185
 
@@ -203,35 +203,35 @@  discard block
 block discarded – undo
203 203
         $data['storeCard'] = (bool) $this->getStoreCard() ?? false;
204 204
         $data['callbackUrls'] = [];
205 205
 
206
-        if ( is_array($this->getPaymentMethods()) ) {
206
+        if (is_array($this->getPaymentMethods())) {
207 207
             $data['methods'] = $this->getPaymentMethods();
208 208
         }
209 209
 
210
-        if ( is_array($this->getCardTypes()) ) {
210
+        if (is_array($this->getCardTypes())) {
211 211
             $data['cardTypes'] = $this->getCardTypes();
212 212
         }
213 213
 
214
-        if ( is_array($this->getMetadata()) ) {
214
+        if (is_array($this->getMetadata())) {
215 215
             $data['metaData'] = $this->getMetadata();
216 216
         }
217 217
 
218
-        if ( $this->getMerchantReference() ) {
218
+        if ($this->getMerchantReference()) {
219 219
             $data['merchantReference'] = $this->getMerchantReference();
220 220
         }
221 221
 
222
-        if ( $this->getReturnUrl() ) {
222
+        if ($this->getReturnUrl()) {
223 223
             $data['callbackUrls']['approved'] = $this->getReturnUrl();
224 224
         }
225 225
 
226
-        if ( $this->getDeclineUrl() ) {
226
+        if ($this->getDeclineUrl()) {
227 227
             $data['callbackUrls']['declined'] = $this->getDeclineUrl();
228 228
         }
229 229
 
230
-        if ( $this->getCancelUrl() ) {
230
+        if ($this->getCancelUrl()) {
231 231
             $data['callbackUrls']['cancelled'] = $this->getCancelUrl();
232 232
         }
233 233
 
234
-        if ( $this->getNotifyUrl() ) {
234
+        if ($this->getNotifyUrl()) {
235 235
             $data['notificationUrl'] = $this->getNotifyUrl();
236 236
         }
237 237
 
@@ -243,7 +243,7 @@  discard block
 block discarded – undo
243 243
         $headers = [
244 244
             'Accept' => 'application/json',
245 245
             'Content-Type' => 'application/json',
246
-            'Authorization' => 'Basic ' . $this->getAuthorization()
246
+            'Authorization' => 'Basic '.$this->getAuthorization()
247 247
         ];
248 248
 
249 249
         $httpResponse = $this->httpClient->request('POST', $this->getEndpoint('sessions'), $headers, json_encode($data));
@@ -267,7 +267,7 @@  discard block
 block discarded – undo
267 267
      */
268 268
     protected function getEndpoint($path = '')
269 269
     {
270
-        return ($this->getTestMode() ? self::endpointTest : self::endpointLive) . '/' . $path;
270
+        return ($this->getTestMode() ? self::endpointTest : self::endpointLive).'/'.$path;
271 271
     }
272 272
 
273 273
     protected function getAuthorization()
Please login to merge, or discard this patch.