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

Visa card question #46

Open
9mm opened this issue Sep 2, 2022 · 4 comments
Open

Visa card question #46

9mm opened this issue Sep 2, 2022 · 4 comments

Comments

@9mm
Copy link

9mm commented Sep 2, 2022

I haven't looked through this library much, but another project I dealt with handled millions of payments, and there were some very weird card numbers that came through. Most notably of these would be BRAND NEW changes to a cards number scheme (like "all cards starting with '4' are visa" etc).

For your library, is this ^ function taken into account in validating VALID/INVALID, or, is it only used to determine the card SVG logo?

I ask because calling someones valid credit card number invalid would be the worst thing to happen, however, IF the card can't be determined by your library (because the rule is new), its shown as valid, but the card logo is just blank or something, that would be the idea scenario.

In other words, if the ONLY factor in determining if a card number is valid is Luhn, and not the fact that the number doesnt fit any of your existing schemes for "what makes a card a Visa" then I think were OK

@9mm
Copy link
Author

9mm commented Sep 2, 2022

One other example, if the validation for CVC includes the card type in the validation ("amex MUST be 4 only") then it should also mean that if the card type cant be determined then the CVC could be 3 or 4. I could be wrong, but just thinking through it, edge cases like this I am wondering how they are handled.

@wuori
Copy link
Owner

wuori commented Sep 7, 2022

@9mm

The card type/validation is determined by the patterns listed here: https://github.com/wuori/vue-credit-card-validation/blob/master/src/cards.js. I believe if a number does NOT match any of these brands it will be considered invalid even though it could still be a legitimate card number. I will augment the documentation to point this out.

If I recall correctly, the CVC validation, in its current state, always allows 3-4 numbers and doesn't change depending on card type.

@9mm
Copy link
Author

9mm commented Sep 7, 2022

Is there any possibility of making unknown type validate as long as the length + luhn is still valid?

Otherwise your library will be at the mercy of the hundreds of card edge cases that will make people unable to use their card. Its been 2 years since I worked on that project but I remember once I started looking through millions of orders, there were so many weird ones, including card BINs and pattern changes that changed every few months

@wuori
Copy link
Owner

wuori commented Sep 7, 2022

@9mm Yeah I think an "unknown" option might be the best way to go.

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