mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 18:16:38 +08:00
Add target customer id when creating id token
This commit is contained in:
parent
ffb279115c
commit
b07ac130dc
2 changed files with 19 additions and 3 deletions
|
@ -57,7 +57,12 @@ class SavePaymentMethodsModule implements ModuleInterface {
|
|||
assert( $api instanceof UserIdToken );
|
||||
|
||||
try {
|
||||
$id_token = $api->id_token();
|
||||
$target_customer_id = '';
|
||||
if ( get_current_user_id() !== 0 ) {
|
||||
$target_customer_id = get_user_meta( get_current_user_id(), '_ppcp_target_customer_id', true );
|
||||
}
|
||||
|
||||
$id_token = $api->id_token( $target_customer_id );
|
||||
$localized_script_data['save_payment_methods'] = array(
|
||||
'id_token' => $id_token,
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue