From 6b843bc698651564b8df0b7db5b4dc20e344989e Mon Sep 17 00:00:00 2001 From: Emili Castells Guasch Date: Wed, 20 Dec 2023 11:58:46 +0100 Subject: [PATCH] Ensure payment saved with vault v2 works in v3 --- .../ppcp-save-payment-methods/src/SavePaymentMethodsModule.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/ppcp-save-payment-methods/src/SavePaymentMethodsModule.php b/modules/ppcp-save-payment-methods/src/SavePaymentMethodsModule.php index 7534a6951..76c456793 100644 --- a/modules/ppcp-save-payment-methods/src/SavePaymentMethodsModule.php +++ b/modules/ppcp-save-payment-methods/src/SavePaymentMethodsModule.php @@ -357,6 +357,9 @@ class SavePaymentMethodsModule implements ModuleInterface { $target_customer_id = ''; if ( is_user_logged_in() ) { $target_customer_id = get_user_meta( get_current_user_id(), '_ppcp_target_customer_id', true ); + if ( ! $target_customer_id ) { + $target_customer_id = get_user_meta( get_current_user_id(), 'ppcp_customer_id', true ); + } } $id_token = $api->id_token( $target_customer_id );