The customer is still typing. Checkout already says no.
Card field errors should help shoppers finish checkout. Distinguish incomplete typing, correctable input, unavailable actions and a real payment decline.
In this article
The shopper enters the first part of an expiry date. The field turns red. They finish typing, but the warning remains. At the bottom of the phone screen, Pay is unavailable and gives no reason.
The store sees a checkout that correctly prevents incomplete information from proceeding. The customer sees a card that appears not to work.
Preventing an invalid submission is only half the job. The other half is helping the person make a valid one without asking them to diagnose the form.
Let an unfinished answer become an answer
An expiry date is incomplete for most of the time it takes to enter it. That does not make every intermediate keystroke a useful moment to announce an error. A warning that repeatedly describes the normal act of typing can lose its meaning before there is anything to correct.
W3C’s form guidance distinguishes feedback during entry from checks after focus moves or the form is submitted. Its date example illustrates why some format checks make more sense after the user leaves the field. There is no need to choose one timing rule for every piece of information.
The merchant’s web team should observe the actual supported payment fields. Try typing slowly, pasting supported input, correcting a digit and using the browser’s permitted autofill. A warning should not survive after the condition it describes has been corrected. Nor should a green indicator promise that a card will be authorized; a field check cannot make that decision.
When a provider supplies hosted fields, work within its documented behavior and customization options. Do not replace secure payment fields or copy their sensitive contents into another form merely to produce a preferred visual effect. The surrounding labels and recovery explanation can still be improved.
Give the customer a correction they can make
“Invalid payment” leaves the buyer searching across the whole purchase. If the known problem is an incomplete expiry date, identify that field and its required format. If a required billing field is empty, name it. The explanation should use the same label the customer can see.
W3C’s Error Suggestion criterion calls for known corrections when an input error is detected, unless providing them would jeopardize security or the purpose of the content. That qualification matters in payments. Helpful does not mean exposing private fraud reasoning or inventing a diagnosis for a result the provider has not explained.
A local formatting problem and a bank declining an attempted payment need different messages. Do not tell a buyer to contact their bank when the store has only identified missing information. Do not say the card number is wrong because a payment was declined. Follow the permitted response for the actual result; our card decline article covers that later decision.
Make the correction reachable. On a phone, an error above the visible screen can remain hidden behind the keyboard. A message beside the field, a usable way to reach it and appropriate focus after a failed submission do more than changing the border color alone. The buyer should not lose unrelated order information while fixing one answer.