diff --git a/modules/ppcp-axo-block/src/AxoBlockPaymentMethod.php b/modules/ppcp-axo-block/src/AxoBlockPaymentMethod.php index 2add989f0..fb23730b2 100644 --- a/modules/ppcp-axo-block/src/AxoBlockPaymentMethod.php +++ b/modules/ppcp-axo-block/src/AxoBlockPaymentMethod.php @@ -258,7 +258,7 @@ class AxoBlockPaymentMethod extends AbstractPaymentMethodType { 'icons_directory' => esc_url( $this->wcgateway_module_url ) . 'assets/images/axo/', 'module_url' => untrailingslashit( $this->module_url ), 'ajax' => array( - 'frontend_logger' => array( + 'frontend_logger' => array( 'endpoint' => \WC_AJAX::get_endpoint( FrontendLogger::ENDPOINT ), 'nonce' => wp_create_nonce( FrontendLogger::nonce() ), ), diff --git a/modules/ppcp-axo/services.php b/modules/ppcp-axo/services.php index 17e4bfcd6..12dd4aebb 100644 --- a/modules/ppcp-axo/services.php +++ b/modules/ppcp-axo/services.php @@ -293,7 +293,7 @@ return array( return new AxoScriptAttributes( $container->get( 'button.request-data' ), $container->get( 'woocommerce.logger.woocommerce' ), - $container->get('api.sdk-client-token') + $container->get( 'api.sdk-client-token' ) ); }, diff --git a/modules/ppcp-axo/src/Assets/AxoManager.php b/modules/ppcp-axo/src/Assets/AxoManager.php index 2a932eae6..d577033cc 100644 --- a/modules/ppcp-axo/src/Assets/AxoManager.php +++ b/modules/ppcp-axo/src/Assets/AxoManager.php @@ -225,7 +225,7 @@ class AxoManager { 'icons_directory' => esc_url( $this->wcgateway_module_url ) . 'assets/images/axo/', 'module_url' => untrailingslashit( $this->module_url ), 'ajax' => array( - 'frontend_logger' => array( + 'frontend_logger' => array( 'endpoint' => \WC_AJAX::get_endpoint( FrontendLogger::ENDPOINT ), 'nonce' => wp_create_nonce( FrontendLogger::nonce() ), ), diff --git a/modules/ppcp-axo/src/Endpoint/AxoScriptAttributes.php b/modules/ppcp-axo/src/Endpoint/AxoScriptAttributes.php index 143c883b6..15e8fc609 100644 --- a/modules/ppcp-axo/src/Endpoint/AxoScriptAttributes.php +++ b/modules/ppcp-axo/src/Endpoint/AxoScriptAttributes.php @@ -8,6 +8,9 @@ use WooCommerce\PayPalCommerce\ApiClient\Exception\PayPalApiException; use WooCommerce\PayPalCommerce\Button\Endpoint\EndpointInterface; use WooCommerce\PayPalCommerce\Button\Endpoint\RequestData; +/** + * Handles the request for the PayPal Axo script attributes. + */ class AxoScriptAttributes implements EndpointInterface { const ENDPOINT = 'ppc-axo-script-attributes'; @@ -21,8 +24,8 @@ class AxoScriptAttributes implements EndpointInterface { LoggerInterface $logger, SdkClientToken $sdk_client_token ) { - $this->request_data = $request_data; - $this->logger = $logger; + $this->request_data = $request_data; + $this->logger = $logger; $this->sdk_client_token = $sdk_client_token; } @@ -35,15 +38,15 @@ class AxoScriptAttributes implements EndpointInterface { try { $token = $this->sdk_client_token->sdk_client_token(); - } catch (PayPalApiException $exception) { - $this->logger->error($exception->getMessage()); - wp_send_json_error($exception->getMessage()); + } catch ( PayPalApiException $exception ) { + $this->logger->error( $exception->getMessage() ); + wp_send_json_error( $exception->getMessage() ); return false; } wp_send_json_success( array( - 'sdk_client_token' => $token, + 'sdk_client_token' => $token, ) ); diff --git a/modules/ppcp-wc-gateway/src/Gateway/PayUponInvoice/PayUponInvoiceGateway.php b/modules/ppcp-wc-gateway/src/Gateway/PayUponInvoice/PayUponInvoiceGateway.php index 952df2c8a..0661e3273 100644 --- a/modules/ppcp-wc-gateway/src/Gateway/PayUponInvoice/PayUponInvoiceGateway.php +++ b/modules/ppcp-wc-gateway/src/Gateway/PayUponInvoice/PayUponInvoiceGateway.php @@ -248,7 +248,7 @@ class PayUponInvoiceGateway extends WC_Payment_Gateway { public function process_payment( $order_id ) { $wc_order = wc_get_order( $order_id ); // phpcs:disable WordPress.Security.NonceVerification - $birth_date = wc_clean( wp_unslash( $_POST['billing_birth_date'] ?? '' ) ); + $birth_date = wc_clean( wp_unslash( $_POST['billing_birth_date'] ?? '' ) ); $pay_for_order = wc_clean( wp_unslash( $_GET['pay_for_order'] ?? '' ) ); if ( 'true' === $pay_for_order ) { if ( ! $this->checkout_helper->validate_birth_date( $birth_date ) ) {