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

card-number validation issue with vgs-collect version update #78

Open
deannashih opened this issue May 2, 2024 · 0 comments
Open

card-number validation issue with vgs-collect version update #78

deannashih opened this issue May 2, 2024 · 0 comments

Comments

@deannashih
Copy link

deannashih commented May 2, 2024

Expected Behavior

Previously, we've been testing with 4242 4242 4242 4242 using the vgs collect version 2.15.0 and the validations in place in line with your documentation:

                   validations={['required', 'validCardNumber']}

This stopped the number at 16 chars max length.
Without changing code, and only by upgrading to vgs collect 2.22.0, we are now able to type in 3 extra chars.

Screenshot 2024-05-02 at 3 10 57 PM

If it's a 16-digit card, it should stop at 16 digits.

Current Behavior

I noticed in your test data documentation that the length of 19 is apparently accepted: https://www.verygoodsecurity.com/docs/vgs-collect/test-data

Sanity checked myself by trying out a Mastercard number that only allows 16 chars per your documentation table.
Screenshot 2024-05-02 at 3 12 19 PM

While it seems like per your documentation the length of 19 is expected for certain Visa cards, to us it's a bug because previously it stopped the 4242... card at 16 without allowing room for more characters to be typed in.

I don't know what happened between 2.15.0 and 2.22.0 to cause this. In the same way that you're able to deduce that the 2222 is a Mastercard number and stops at 16 digits, can the same not be done for certain Visa cards?

Possible Solution

If there isn't a way to determine by the first few numbers that it's a Visa success card, or whether it should be a 16- or 19-digit card, what is the best way to stop 16-digit cards from reaching extra 3 digits?

Steps to Reproduce (for bugs)

  1. Be on VGS Collect version 2.22.0
  2. Use validations validations: ['required', 'validCardNumber'], type: 'card-number
  3. Try standard Visa success test card 4242 4242 4242 4242 then see if you can type extra 424

Context

Your Environment

  • Version used: VGS 2.22.0 (bugged), 2.15.0 (was working)
  • Browser Name and version: Chrome Version 124.0.6367.91
  • Operating System and version (desktop or mobile): MacOS Ventura 13.4
  • Link to your project: sorry it's private.
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

1 participant