From abf61a14b827b91d1afaaeda3eb2d8df2b70c79a Mon Sep 17 00:00:00 2001 From: dinamiko Date: Fri, 15 Jul 2022 16:33:49 +0200 Subject: [PATCH] Do not process payment for oxxo in return url endpoint --- modules/ppcp-wc-gateway/src/Endpoint/ReturnUrlEndpoint.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/modules/ppcp-wc-gateway/src/Endpoint/ReturnUrlEndpoint.php b/modules/ppcp-wc-gateway/src/Endpoint/ReturnUrlEndpoint.php index 6239e39e2..0270dae48 100644 --- a/modules/ppcp-wc-gateway/src/Endpoint/ReturnUrlEndpoint.php +++ b/modules/ppcp-wc-gateway/src/Endpoint/ReturnUrlEndpoint.php @@ -10,6 +10,7 @@ declare(strict_types=1); namespace WooCommerce\PayPalCommerce\WcGateway\Endpoint; use WooCommerce\PayPalCommerce\ApiClient\Endpoint\OrderEndpoint; +use WooCommerce\PayPalCommerce\WcGateway\Gateway\OXXO\OXXOGateway; use WooCommerce\PayPalCommerce\WcGateway\Gateway\PayPalGateway; use WooCommerce\PayPalCommerce\Webhooks\Handler\PrefixTrait; @@ -72,6 +73,11 @@ class ReturnUrlEndpoint { exit(); } + if ( $wc_order->get_payment_method() === OXXOGateway::ID ) { + wp_safe_redirect( wc_get_checkout_url() ); + exit(); + } + $success = $this->gateway->process_payment( $wc_order_id ); if ( isset( $success['result'] ) && 'success' === $success['result'] ) { add_filter(