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

Possible need to update card brand regex #662

Open
Leviosar opened this issue Sep 5, 2024 · 0 comments
Open

Possible need to update card brand regex #662

Leviosar opened this issue Sep 5, 2024 · 0 comments

Comments

@Leviosar
Copy link

Leviosar commented Sep 5, 2024

I was trying the lib with a card and despite being issued by Mastercard it didn't get recognized. The card is a mastercard platinum issued by a Brazilian bank and starts with "2235 25" and can be found using any online BIN validator.

According to the mastercard bin table available at https://www.mastercard.us/en-us/business/issuers/get-support/simplified-bin-account-range-table.html those cards are ranged from 2235250000 to 2235259999. Also it looks like there's a lot of banks using 223 prefix for mastercard.

I've checked the code that does this parsing and i believe the regex currently used for mastercard is /^(5[1-5]|677189)|^(222[1-9]|2[3-6]\d{2}|27[0-1]\d|2720)/g and changing it to /^(5[1-5]|677189)|^(222[1-9]|2[2-6]\d{2}|27[0-1]\d|2720)/g would fix it.

Is the lib still being updated with card formats? I could make a PR if needed.

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