Do not process payment for oxxo in return url endpoint

This commit is contained in:
dinamiko 2022-07-15 16:33:49 +02:00
parent d1c4850c4d
commit abf61a14b8

View file

@ -10,6 +10,7 @@ declare(strict_types=1);
namespace WooCommerce\PayPalCommerce\WcGateway\Endpoint; namespace WooCommerce\PayPalCommerce\WcGateway\Endpoint;
use WooCommerce\PayPalCommerce\ApiClient\Endpoint\OrderEndpoint; use WooCommerce\PayPalCommerce\ApiClient\Endpoint\OrderEndpoint;
use WooCommerce\PayPalCommerce\WcGateway\Gateway\OXXO\OXXOGateway;
use WooCommerce\PayPalCommerce\WcGateway\Gateway\PayPalGateway; use WooCommerce\PayPalCommerce\WcGateway\Gateway\PayPalGateway;
use WooCommerce\PayPalCommerce\Webhooks\Handler\PrefixTrait; use WooCommerce\PayPalCommerce\Webhooks\Handler\PrefixTrait;
@ -72,6 +73,11 @@ class ReturnUrlEndpoint {
exit(); 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 ); $success = $this->gateway->process_payment( $wc_order_id );
if ( isset( $success['result'] ) && 'success' === $success['result'] ) { if ( isset( $success['result'] ) && 'success' === $success['result'] ) {
add_filter( add_filter(