From 752d32718867d4195b896567b3bb67828fdeccd6 Mon Sep 17 00:00:00 2001 From: dinamiko Date: Fri, 15 Jul 2022 12:38:38 +0200 Subject: [PATCH] Fix phpcs --- modules/ppcp-wc-gateway/services.php | 2 +- .../src/Gateway/OXXO/OXXOEndpoint.php | 35 +++++++++++++++---- 2 files changed, 30 insertions(+), 7 deletions(-) diff --git a/modules/ppcp-wc-gateway/services.php b/modules/ppcp-wc-gateway/services.php index 80198ff2f..8cff73c1d 100644 --- a/modules/ppcp-wc-gateway/services.php +++ b/modules/ppcp-wc-gateway/services.php @@ -2246,7 +2246,7 @@ return array( $container->get( 'woocommerce.logger.woocommerce' ) ); }, - 'wcgateway.endpoint.oxxo' => static function (ContainerInterface $container): OXXOEndpoint { + 'wcgateway.endpoint.oxxo' => static function ( ContainerInterface $container ): OXXOEndpoint { return new OXXOEndpoint( $container->get( 'button.request-data' ), $container->get( 'api.endpoint.order' ), diff --git a/modules/ppcp-wc-gateway/src/Gateway/OXXO/OXXOEndpoint.php b/modules/ppcp-wc-gateway/src/Gateway/OXXO/OXXOEndpoint.php index 668c7a4b4..0d6e4fc3c 100644 --- a/modules/ppcp-wc-gateway/src/Gateway/OXXO/OXXOEndpoint.php +++ b/modules/ppcp-wc-gateway/src/Gateway/OXXO/OXXOEndpoint.php @@ -1,6 +1,6 @@ request_data = $request_data; + $this->request_data = $request_data; $this->purchase_unit_factory = $purchase_unit_factory; $this->shipping_preference_factory = $shipping_preference_factory; $this->order_endpoint = $order_endpoint; $this->logger = $logger; } + /** + * The nonce + * + * @return string + */ public static function nonce(): string { return 'ppc-oxxo'; } + /** + * Handles the request. + * + * @return bool + */ public function handle_request(): bool { - $data = $this->request_data->read_request( $this->nonce() ); - $purchase_unit = $this->purchase_unit_factory->from_wc_cart(); + $payer_action = ''; - $payer_action = ''; try { $shipping_preference = $this->shipping_preference_factory->from_state( $purchase_unit,