diff --git a/client/checkout/classic/upe.js b/client/checkout/classic/upe.js index 17fa279a17b..f6a24515dfe 100644 --- a/client/checkout/classic/upe.js +++ b/client/checkout/classic/upe.js @@ -761,6 +761,15 @@ jQuery( function ( $ ) { // Handle the add payment method form for WooCommerce Payments. $( 'form#add_payment_method' ).on( 'submit', function () { + // Skip adding legacy cards as UPE payment methods. + if ( + 'woocommerce_payments' === + $( + "#add_payment_method input:checked[name='payment_method']" + ).val() + ) { + return; + } if ( ! $( '#wcpay-setup-intent' ).val() ) { const paymentMethodType = getSelectedGatewayPaymentMethod(); const paymentIntentId =