From aecb33a620f58c9cb32e83fd0927c1c236d23dd6 Mon Sep 17 00:00:00 2001 From: Anton Chernikov Date: Mon, 25 Feb 2019 19:29:40 +0300 Subject: [PATCH] [Validator] add MIR card scheme --- .../Component/Validator/Constraints/CardSchemeValidator.php | 4 ++++ .../Validator/Tests/Constraints/CardSchemeValidatorTest.php | 2 ++ 2 files changed, 6 insertions(+) diff --git a/src/Symfony/Component/Validator/Constraints/CardSchemeValidator.php b/src/Symfony/Component/Validator/Constraints/CardSchemeValidator.php index dcc5ad0cb80b2..50b015baad04e 100644 --- a/src/Symfony/Component/Validator/Constraints/CardSchemeValidator.php +++ b/src/Symfony/Component/Validator/Constraints/CardSchemeValidator.php @@ -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}$/', diff --git a/src/Symfony/Component/Validator/Tests/Constraints/CardSchemeValidatorTest.php b/src/Symfony/Component/Validator/Tests/Constraints/CardSchemeValidatorTest.php index 24c23109f4615..ddc9edb6c094d 100644 --- a/src/Symfony/Component/Validator/Tests/Constraints/CardSchemeValidatorTest.php +++ b/src/Symfony/Component/Validator/Tests/Constraints/CardSchemeValidatorTest.php @@ -103,6 +103,7 @@ public function getValidNumbers() ['MASTERCARD', '2699999999999999'], ['MASTERCARD', '2709999999999999'], ['MASTERCARD', '2720995105105100'], + ['MIR', '2200381427330082'], ['UATP', '110165309696173'], ['VISA', '4111111111111111'], ['VISA', '4012888888881881'], @@ -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 ]; } } pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy