@@ -95,7 +95,7 @@ |
||
| 95 | 95 | public function getPaymentMethods() |
| 96 | 96 | { |
| 97 | 97 | $params = [ |
| 98 | - "allowedPaymentMethods" => ["paypal","card"], |
|
| 98 | + "allowedPaymentMethods" => ["paypal", "card"], |
|
| 99 | 99 | "merchantAccount" => $this->merchantAccount, |
| 100 | 100 | "countryCode" => $this->settingsService->getSetting('settings-customer-country'), |
| 101 | 101 | "shopperLocale" => $this->settingsService->getSetting('settings-customer-locale'), |
@@ -55,7 +55,7 @@ |
||
| 55 | 55 | return $this->doPaypalApiCall( |
| 56 | 56 | $requestBody, |
| 57 | 57 | 'https://api.sandbox.paypal.com/v1/payments/payment', |
| 58 | - ['PAYPAL-CLIENT-METADATA-ID: '.$fraudnetSession] |
|
| 58 | + ['PAYPAL-CLIENT-METADATA-ID: ' . $fraudnetSession] |
|
| 59 | 59 | ); |
| 60 | 60 | } |
| 61 | 61 | |
@@ -35,7 +35,7 @@ |
||
| 35 | 35 | $statusCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); |
| 36 | 36 | curl_close($ch); |
| 37 | 37 | } catch (Exception $e) { |
| 38 | - $this->logger->error('Error on PayPal::'.$url.' = ' . $e->getMessage()); |
|
| 38 | + $this->logger->error('Error on PayPal::' . $url . ' = ' . $e->getMessage()); |
|
| 39 | 39 | return null; |
| 40 | 40 | } |
| 41 | 41 | return ([ |
@@ -24,7 +24,7 @@ discard block |
||
| 24 | 24 | WebhookNotification::LOCAL_PAYMENT_COMPLETED => |
| 25 | 25 | $this->processLocalPaymentMethodWebhook($webhookNotification), |
| 26 | 26 | WebhookNotification::PAYMENT_METHOD_REVOKED_BY_CUSTOMER => |
| 27 | - $this->processPaymentMethodRevokedByCustomer($webhookNotification),default => |
|
| 27 | + $this->processPaymentMethodRevokedByCustomer($webhookNotification), default => |
|
| 28 | 28 | $this->processOthers($webhookNotification) |
| 29 | 29 | }; |
| 30 | 30 | } |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | public function generateTestNotification(string $type): array |
| 37 | 37 | { |
| 38 | 38 | return $this->gateway->webhookTesting()->sampleNotification( |
| 39 | - constant(WebhookNotification::class .'::'. $type), |
|
| 39 | + constant(WebhookNotification::class . '::' . $type), |
|
| 40 | 40 | sha1(time()) |
| 41 | 41 | ); |
| 42 | 42 | } |
@@ -25,7 +25,7 @@ |
||
| 25 | 25 | { |
| 26 | 26 | $customerId = $this->settingsService->getSetting('settings-customer-id'); |
| 27 | 27 | $dataUserIdToken = $this->paypalService->getVaultService()->getDataUserIdToken($customerId); |
| 28 | - return $this->render('paypal/vault/'. $action .'.html.twig', [ |
|
| 28 | + return $this->render('paypal/vault/' . $action . '.html.twig', [ |
|
| 29 | 29 | 'dataUserIdToken' => $dataUserIdToken, |
| 30 | 30 | |
| 31 | 31 | ]); |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | * @param string $orderId |
| 31 | 31 | * @return object|array |
| 32 | 32 | */ |
| 33 | - public function capturePayment(string $orderId): object|array |
|
| 33 | + public function capturePayment(string $orderId): object | array |
|
| 34 | 34 | { |
| 35 | 35 | try { |
| 36 | 36 | $request = new OrdersCaptureRequest($orderId); |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | * @param array $headers |
| 55 | 55 | * @return object|array |
| 56 | 56 | */ |
| 57 | - public function createOrder(string $body, array $headers = []): object|array |
|
| 57 | + public function createOrder(string $body, array $headers = []): object | array |
|
| 58 | 58 | { |
| 59 | 59 | try { |
| 60 | 60 | $request = new OrdersCreateRequest(); |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST'); |
| 84 | 84 | curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($body, true)); |
| 85 | 85 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); |
| 86 | - curl_setopt($ch, CURLOPT_HEADERFUNCTION, function ($curl, $header) use (&$headers) { |
|
| 86 | + curl_setopt($ch, CURLOPT_HEADERFUNCTION, function($curl, $header) use (&$headers) { |
|
| 87 | 87 | $len = strlen($header); |
| 88 | 88 | $header = explode(':', $header, 2); |
| 89 | 89 | if (count($header) < 2) { |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | |
| 98 | 98 | curl_close($ch); |
| 99 | 99 | } catch (Exception $e) { |
| 100 | - $this->logger->error('Error on ForwardAPI::'.$this->ENDPOINT.' = ' . $e->getMessage()); |
|
| 100 | + $this->logger->error('Error on ForwardAPI::' . $this->ENDPOINT . ' = ' . $e->getMessage()); |
|
| 101 | 101 | return null; |
| 102 | 102 | } |
| 103 | 103 | return ([ |
@@ -114,8 +114,8 @@ |
||
| 114 | 114 | [], |
| 115 | 115 | 'https://api.sandbox.paypal.com/v1/identity/generate-token' |
| 116 | 116 | ); |
| 117 | - if (array_key_exists('statusCode',$response) && $response['statusCode'] == Response::HTTP_OK) { |
|
| 118 | - $result = (object) json_decode($response['result'],true); |
|
| 117 | + if (array_key_exists('statusCode', $response) && $response['statusCode'] == Response::HTTP_OK) { |
|
| 118 | + $result = (object) json_decode($response['result'], true); |
|
| 119 | 119 | return $result->client_token; |
| 120 | 120 | } else { |
| 121 | 121 | $this->logger->error('Error on PayPal::getClientToken'); |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | */ |
| 36 | 36 | public function payments(string $action) |
| 37 | 37 | { |
| 38 | - return $this->render('paypal/payments/'. $action .'.html.twig'); |
|
| 38 | + return $this->render('paypal/payments/' . $action . '.html.twig'); |
|
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | /** |
@@ -128,7 +128,7 @@ discard block |
||
| 128 | 128 | { |
| 129 | 129 | $clientToken = $this->paypalService->getIdentityService()->getClientToken(); |
| 130 | 130 | return $this->render( |
| 131 | - 'paypal/payments/'. $action .'.html.twig', |
|
| 131 | + 'paypal/payments/' . $action . '.html.twig', |
|
| 132 | 132 | [ |
| 133 | 133 | 'clientToken' => $clientToken, |
| 134 | 134 | ] |