Move subscription id session clear to payment handlers

This commit is contained in:
Emili Castells Guasch 2023-09-15 16:27:36 +02:00
parent ac22a25f4f
commit f161ca7ec8
2 changed files with 2 additions and 1 deletions

View file

@ -543,7 +543,6 @@ class PayPalGateway extends \WC_Payment_Gateway {
} }
$wc_order->payment_complete(); $wc_order->payment_complete();
WC()->session->set( 'ppcp_subscription_id', '' );
return $this->handle_payment_success( $wc_order ); return $this->handle_payment_success( $wc_order );
} }

View file

@ -77,6 +77,7 @@ trait ProcessPaymentTrait {
} }
$this->session_handler->destroy_session_data(); $this->session_handler->destroy_session_data();
WC()->session->set( 'ppcp_subscription_id', '' );
wc_add_notice( $error->getMessage(), 'error' ); wc_add_notice( $error->getMessage(), 'error' );
@ -100,6 +101,7 @@ trait ProcessPaymentTrait {
} }
$this->session_handler->destroy_session_data(); $this->session_handler->destroy_session_data();
WC()->session->set( 'ppcp_subscription_id', '' );
return array( return array(
'result' => 'success', 'result' => 'success',