Skip to content

Commit

Permalink
feature #30377 [Validator] add MIR card scheme (antonch1989)
Browse files Browse the repository at this point in the history
This PR was squashed before being merged into the 4.3-dev branch (closes #30377).

Discussion
----------

[Validator] add MIR card scheme

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #30376
| License       | MIT

Commits
-------

aecb33a [Validator] add MIR card scheme
  • Loading branch information
nicolas-grekas committed Mar 7, 2019
2 parents 5b38e17 + aecb33a commit 81faf42
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Expand Up @@ -78,6 +78,10 @@ class CardSchemeValidator extends ConstraintValidator
'/^5[1-5][0-9]{14}$/',
'/^2(22[1-9][0-9]{12}|2[3-9][0-9]{13}|[3-6][0-9]{14}|7[0-1][0-9]{13}|720[0-9]{12})$/',
],
// Payment system MIR numbers start with 220, then 1 digit from 0 to 4, then 12 digits
'MIR' => [
'/^220[0-4][0-9]{12}$/',
],
// All UATP card numbers start with a 1 and have a length of 15 digits.
'UATP' => [
'/^1[0-9]{14}$/',
Expand Down
Expand Up @@ -103,6 +103,7 @@ public function getValidNumbers()
['MASTERCARD', '2699999999999999'],
['MASTERCARD', '2709999999999999'],
['MASTERCARD', '2720995105105100'],
['MIR', '2200381427330082'],
['UATP', '110165309696173'],
['VISA', '4111111111111111'],
['VISA', '4012888888881881'],
Expand Down Expand Up @@ -135,6 +136,7 @@ public function getInvalidNumbers()
['MASTERCARD', '2721001234567890', CardScheme::INVALID_FORMAT_ERROR], // Not assigned yet
['MASTERCARD', '2220991234567890', CardScheme::INVALID_FORMAT_ERROR], // Not assigned yet
['UATP', '11016530969617', CardScheme::INVALID_FORMAT_ERROR], // invalid length
['MIR', '22003814273300821', CardScheme::INVALID_FORMAT_ERROR], // invalid length
];
}
}

0 comments on commit 81faf42

Please sign in to comment.