@@ -25,57 +25,57 @@ discard block |
||
| 25 | 25 | $data['currency'] = $this->getCurrency(); |
| 26 | 26 | $data['callbackUrls'] = []; |
| 27 | 27 | |
| 28 | - if ( $this->getStoreCard() ) { |
|
| 28 | + if ($this->getStoreCard()) { |
|
| 29 | 29 | $data['storeCard'] = true; |
| 30 | 30 | } |
| 31 | 31 | |
| 32 | - if ( $this->getStoredCardIndicator() ) { |
|
| 32 | + if ($this->getStoredCardIndicator()) { |
|
| 33 | 33 | $data['storedCardIndicator'] = $this->getStoredCardIndicator(); |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | - if ( $this->getRecurringExpiry() ) { |
|
| 36 | + if ($this->getRecurringExpiry()) { |
|
| 37 | 37 | $data['recurringExpiry'] = $this->getRecurringExpiry(); |
| 38 | 38 | } |
| 39 | 39 | |
| 40 | - if ( $this->getRecurringFrequency() ) { |
|
| 40 | + if ($this->getRecurringFrequency()) { |
|
| 41 | 41 | $data['recurringFrequency'] = $this->getRecurringFrequency(); |
| 42 | 42 | } |
| 43 | 43 | |
| 44 | - if ( $this->getToken() ) { |
|
| 44 | + if ($this->getToken()) { |
|
| 45 | 45 | $data['cardId'] = $this->getToken(); |
| 46 | 46 | } |
| 47 | 47 | |
| 48 | - if ( is_array($this->getPaymentMethods()) ) { |
|
| 48 | + if (is_array($this->getPaymentMethods())) { |
|
| 49 | 49 | $data['methods'] = $this->getPaymentMethods(); |
| 50 | 50 | } |
| 51 | 51 | |
| 52 | - if ( is_array($this->getCardTypes()) ) { |
|
| 52 | + if (is_array($this->getCardTypes())) { |
|
| 53 | 53 | $data['cardTypes'] = $this->getCardTypes(); |
| 54 | 54 | } |
| 55 | 55 | |
| 56 | - if ( is_array($this->getMetadata()) ) { |
|
| 56 | + if (is_array($this->getMetadata())) { |
|
| 57 | 57 | $data['metaData'] = $this->getMetadata(); |
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | $merchantReference = $this->getMerchantReference() ?? $this->getDescription(); |
| 61 | 61 | |
| 62 | - if ( $merchantReference ) { |
|
| 62 | + if ($merchantReference) { |
|
| 63 | 63 | $data['merchantReference'] = $merchantReference; |
| 64 | 64 | } |
| 65 | 65 | |
| 66 | - if ( $this->getReturnUrl() ) { |
|
| 66 | + if ($this->getReturnUrl()) { |
|
| 67 | 67 | $data['callbackUrls']['approved'] = $this->getReturnUrl(); |
| 68 | 68 | } |
| 69 | 69 | |
| 70 | - if ( $this->getDeclineUrl() ) { |
|
| 70 | + if ($this->getDeclineUrl()) { |
|
| 71 | 71 | $data['callbackUrls']['declined'] = $this->getDeclineUrl(); |
| 72 | 72 | } |
| 73 | 73 | |
| 74 | - if ( $this->getCancelUrl() ) { |
|
| 74 | + if ($this->getCancelUrl()) { |
|
| 75 | 75 | $data['callbackUrls']['cancelled'] = $this->getCancelUrl(); |
| 76 | 76 | } |
| 77 | 77 | |
| 78 | - if ( $this->getNotifyUrl() ) { |
|
| 78 | + if ($this->getNotifyUrl()) { |
|
| 79 | 79 | $data['notificationUrl'] = $this->getNotifyUrl(); |
| 80 | 80 | } |
| 81 | 81 | |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | $headers = [ |
| 88 | 88 | 'Accept' => 'application/json', |
| 89 | 89 | 'Content-Type' => 'application/json', |
| 90 | - 'Authorization' => 'Basic ' . $this->getAuthorization(), |
|
| 90 | + 'Authorization' => 'Basic '.$this->getAuthorization(), |
|
| 91 | 91 | ]; |
| 92 | 92 | |
| 93 | 93 | $httpResponse = $this->httpClient->request('POST', $this->getEndpoint('sessions'), $headers, json_encode($data)); |