Ensure payment saved with vault v2 works in v3

This commit is contained in:
Emili Castells Guasch 2023-12-20 11:58:46 +01:00
parent 5b15283834
commit 6b843bc698

View file

@ -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 );