Merge pull request #3067 from woocommerce/PCP-4122-unfortunately-your-credit-card-details-are-not-valid-shown-with-actually-valid-card-during-checkout-with-invalid-postcode

Unfortunately, your credit card details are not valid" shown with actually valid card during checkout with invalid postcode (4122)
This commit is contained in:
Emili Castells 2025-03-21 17:17:27 +01:00 committed by GitHub
commit 51a2f4d4f9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -56,9 +56,9 @@ class CardFieldsRenderer {
onApprove( data ) { onApprove( data ) {
return contextConfig.onApprove( data ); return contextConfig.onApprove( data );
}, },
onError( error ) { onError: ( error ) => {
console.error( error ); console.error( error );
this.spinner.unblock(); this.spinner.unblock();
}, },
} ); } );
@ -105,11 +105,13 @@ class CardFieldsRenderer {
} }
cardFields.submit().catch( ( error ) => { cardFields.submit().catch( ( error ) => {
this.spinner.unblock(); this.spinner.unblock();
console.error( error ); if (!error.type || error.type !== 'create-order-error') {
this.errorHandler.message( console.error( error );
this.defaultConfig.hosted_fields.labels.fields_not_valid this.errorHandler.message(
); this.defaultConfig.hosted_fields.labels.fields_not_valid
);
}
} ); } );
} ); } );
} }