Add permit multiple tokens so Venmo can work alongside PayPal

This commit is contained in:
Pedro Silva 2024-01-26 17:57:59 +00:00
parent 0d4fbc4c0b
commit 2167c7c78b
No known key found for this signature in database
GPG key ID: E2EE20C0669D24B3
2 changed files with 7 additions and 5 deletions

View file

@ -113,8 +113,9 @@ class SavePaymentMethodsModule implements ModuleInterface {
'venmo' => array(
'attributes' => array(
'vault' => array(
'store_in_vault' => 'ON_SUCCESS',
'usage_type' => 'MERCHANT',
'store_in_vault' => 'ON_SUCCESS',
'usage_type' => 'MERCHANT',
'permit_multiple_payment_tokens' => true,
),
),
),
@ -138,8 +139,9 @@ class SavePaymentMethodsModule implements ModuleInterface {
'paypal' => array(
'attributes' => array(
'vault' => array(
'store_in_vault' => 'ON_SUCCESS',
'usage_type' => 'MERCHANT',
'store_in_vault' => 'ON_SUCCESS',
'usage_type' => 'MERCHANT',
'permit_multiple_payment_tokens' => true,
),
),
),

View file

@ -301,7 +301,7 @@ class WcSubscriptionsModule implements ModuleInterface {
foreach ( $tokens as $token ) {
$output .= '<li>';
$output .= sprintf( '<input name="saved_paypal_payment" type="radio" value="%s" style="width:auto;" checked="checked">', $token->get_id() );
$output .= sprintf( '<label for="saved_paypal_payment">%s</label>', $token->get_meta( 'email' ) ?? '' );
$output .= sprintf( '<label for="saved_paypal_payment">%s / %s</label>', $token->get_type(), $token->get_meta( 'email' ) ?? '' );
$output .= '</li>';
}
$output .= '</ul>';