Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CVV length validation issues #889

Open
jobs4mvr opened this issue Jul 16, 2024 · 2 comments
Open

CVV length validation issues #889

jobs4mvr opened this issue Jul 16, 2024 · 2 comments

Comments

@jobs4mvr
Copy link

Say, I have an American Express Credit Card I am inputting into the Payment Form, and I stop after inputting 3 numbers, the error (correctly) prompting me to input 4 char shows. AFTER I input 4 chars, the error does not disappear TILL I click outside the CVV field.

This is an issue for other Credit Card Payment Forms as well. Say, I input a 2 Char CVV for a VISA Credit Card, the error prompting the Customer to input 3 char is displayed, but, after adding 2 more numbers, no error displays, and allows the Customer to go ahead and processes the Payment as well.

@jobs4mvr
Copy link
Author

jobs4mvr commented Aug 7, 2024

@recurly : Anything on this issue from 3 weeks ago?

@chrissrogers
Copy link
Member

Hi @jobs4mvr, thanks for the question. CVV length can be an unpredictable validation in some instances, as there are not 100% spec guarantees of the max length being 3 or 4. In order to cover the widest possible scenarios and be compatible with all of the gateways we support, we have applied loose validation here. However, if you would like to be more strict with validation, listening to the change event and checking the detected card brand and field lengths will allow you to present validation errors in any manner you see fit.

We typically clear error state classes on blur to account for input pauses, but will update the field state being emitted on all key presses. That will allow you to react to validation changes without having to wait for a blur.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants