Skip to content

[Validator] Added additional MasterCard range to the CardSchemeValidator #19316

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

Merged
merged 1 commit into from
Jul 8, 2016

Conversation

dvaeversted
Copy link
Contributor

From October 2016 MasterCard will introduce a new card range, 222100 through 272099.
See: https://www.mctestcards.com/ (click the help in top right)
This implements the additional regex for validation to succeed, and some additional unit tests for this new range.

Q A
Branch? 2.7
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets
License MIT
Doc PR

From October 2016 MasterCard will introduce a new card range,
222100 through 272099.
See: https://www.mctestcards.com/ (click the help in top right)
Implements unit tests and validation for this new card range.
@@ -102,6 +102,12 @@ public function getValidNumbers()
array('MAESTRO', '6594371785970435599'),
array('MASTERCARD', '5555555555554444'),
array('MASTERCARD', '5105105105105100'),
array('MASTERCARD', '2221005555554444'),
array('MASTERCARD', '2230000000000000'),
array('MASTERCARD', '2300000000000000'),
Copy link
Member

Choose a reason for hiding this comment

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

If we are testing 23xxx, 26xxx and 27xxx maybe we should also test the missing 24xxx and 25xxx to avoid future regressions (these regexps are a bit tricky).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The reason for testing 23xxx and 26xxx is beceause they are both in the range where only the 2 first digits need checking.
Therefor i feel that testing 24xxx and 25xxx is redundant, but i can add them if needed ?

@javiereguiluz
Copy link
Member

👍

The linked resource clearly shows that we should merge this as soon as possible. Thanks @dvaeversted.

@fabpot
Copy link
Member

fabpot commented Jul 8, 2016

Thank you @dvaeversted.

@fabpot fabpot merged commit 4d68f56 into symfony:2.7 Jul 8, 2016
fabpot added a commit that referenced this pull request Jul 8, 2016
…chemeValidator (Dennis Væversted)

This PR was merged into the 2.7 branch.

Discussion
----------

[Validator] Added additional MasterCard range to the CardSchemeValidator

From October 2016 MasterCard will introduce a new card range, 222100 through 272099.
See: https://www.mctestcards.com/ (click the help in top right)
This implements the additional regex for validation to succeed, and some additional unit tests for this new range.

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        |

Commits
-------

4d68f56 [Validator] Added additional MasterCard range to the CardSchemeValidator
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants