Skip to content

Commit c9502e6

Browse files
committed
Set vaulted_paypal_email to empty string before returning early
1 parent 483777d commit c9502e6

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

modules/ppcp-wc-subscriptions/src/WcSubscriptionsModule.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,8 +396,10 @@ function () use ( $c ) {
396396
add_filter(
397397
'woocommerce_paypal_payments_localized_script_data',
398398
function ( array $localized_script_data ) use ( $c ) {
399-
// Return early if save payment methods (Vault v3) is enabled.
399+
// When Vault v3 is enabled, set empty vaulted_paypal_email to prevent
400+
// undefined JS property from affecting button visibility logic.
400401
if ( $c->has( 'save-payment-methods.eligible' ) && $c->get( 'save-payment-methods.eligible' ) ) {
402+
$localized_script_data['vaulted_paypal_email'] = '';
401403
return $localized_script_data;
402404
}
403405

0 commit comments

Comments
 (0)