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

added new bins to 'MasterCard' #44

Merged
merged 3 commits into from Aug 22, 2016
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions src/creditCardList.js
Expand Up @@ -20,6 +20,7 @@ const CREDIT_CARD_LIST = [
}, {
name: 'Mastercard',
regexpFull: '^5[1-5][0-9]{14}$'
//regexpFull: '^((5[1-5][0-9]{14})|(2221[0-9]{12})|(222[2-9][0-9]{12})|(22[3-9][0-9]{13})|(2[3-6][0-9]{14})|(27[01][0-9]{13})|(2720[0-9]{12}))$' //After October
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the PR description is mentioned 2222, but in the regex it turned into (222[2-9][0-9]{12}), which is not the same.

In the PR description is mentioned 223, but in the regex it turned into (22[3-9][0-9]{13}), which is not the same.

Also, the inner parenthesis are not necessary:

From: ^((5[1-5][0-9]{14})|(2221[0-9]{12})|(222[2-9][0-9]{12})|(22[3-9][0-9]{13})|(2[3-6][0-9]{14})|(27[01][0-9]{13})|(2720[0-9]{12}))$
To  : ^(5[1-5][0-9]{14}|2221[0-9]{12}|222[2-9][0-9]{12}|22[3-9][0-9]{13}|2[3-6][0-9]{14}|27[01][0-9]{13}|2720[0-9]{12})$

}, {
name: 'Visa',
regexpFull: '^4[0-9]{12}(?:[0-9]{3})?$'
Expand Down