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

feat(isCreditCard): add maestro #2286

Closed
wants to merge 1 commit into from

Conversation

matthewmayer
Copy link

@matthewmayer matthewmayer commented Sep 16, 2023

Adds support for Maestro cards.

https://en.wikipedia.org/wiki/Payment_card_number
https://en.wikipedia.org/wiki/Maestro_(debit_card)

This is an updated version of #2223 with an improved regex, tests and updated README

Checklist

  • PR contains only changes related; no stray files, etc.
  • README updated (where applicable)
  • Tests written (where applicable)
  • References provided in PR (where applicable)

@codecov
Copy link

codecov bot commented Sep 16, 2023

Codecov Report

Patch and project coverage have no change.

Comparison is base (b958bd7) 99.95% compared to head (a3da141) 99.95%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2286   +/-   ##
=======================================
  Coverage   99.95%   99.95%           
=======================================
  Files         107      107           
  Lines        2454     2454           
  Branches      619      619           
=======================================
  Hits         2453     2453           
  Partials        1        1           
Files Changed Coverage Δ
src/lib/isCreditCard.js 100.00% <ø> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@WikiRik
Copy link
Member

WikiRik commented Sep 16, 2023

Do you perhaps have a non-wikipedia source?

@matthewmayer
Copy link
Author

Interestingly Mastercard themselves claim current Maestro account BIN ranges are 639000–639099 / 670000–679999

https://developer.mastercard.com/bin-lookup/documentation/support/

Perhaps the other patterns were older ones.

@matthewmayer
Copy link
Author

Given it appears Maestro is being discontinued, and existing validators and Mastercard disagree on what the correct patterns are, I dont think this should probably be added to Validator

https://www.mastercard.com/news/europe/en/perspectives/en/2021/blog-from-valerie-nowak-why-this-maestro-is-retiring-after-30-years/

@WikiRik
Copy link
Member

WikiRik commented Sep 16, 2023

I'm not so sure about that. Cards are usually valid for 5 years or something, and if this plan continued as planned the final cards will expire in 2028. Might still be nice to validate this

@matthewmayer
Copy link
Author

also i'd argue its not a credit card, its a debit card ;)

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

Successfully merging this pull request may close these issues.

2 participants