From ac22a25f4f65fe14f7003cc46838bd14ec1a4896 Mon Sep 17 00:00:00 2001 From: Emili Castells Guasch Date: Fri, 15 Sep 2023 13:13:13 +0200 Subject: [PATCH] Clear PayPal subscription id from session when payment is complete --- modules/ppcp-wc-gateway/src/Gateway/PayPalGateway.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/ppcp-wc-gateway/src/Gateway/PayPalGateway.php b/modules/ppcp-wc-gateway/src/Gateway/PayPalGateway.php index 933e6ce51..0cd9c2eed 100644 --- a/modules/ppcp-wc-gateway/src/Gateway/PayPalGateway.php +++ b/modules/ppcp-wc-gateway/src/Gateway/PayPalGateway.php @@ -543,6 +543,8 @@ class PayPalGateway extends \WC_Payment_Gateway { } $wc_order->payment_complete(); + WC()->session->set( 'ppcp_subscription_id', '' ); + return $this->handle_payment_success( $wc_order ); }