diff --git a/src/Symfony/Component/Validator/CHANGELOG.md b/src/Symfony/Component/Validator/CHANGELOG.md index e2dfc921e40b7..45e00e00a90cf 100644 --- a/src/Symfony/Component/Validator/CHANGELOG.md +++ b/src/Symfony/Component/Validator/CHANGELOG.md @@ -5,6 +5,7 @@ CHANGELOG ----- * added options `iban` and `ibanPropertyPath` to Bic constraint + * added UATP cards support to `CardSchemeValidator` 4.2.0 ----- diff --git a/src/Symfony/Component/Validator/Constraints/CardSchemeValidator.php b/src/Symfony/Component/Validator/Constraints/CardSchemeValidator.php index dae3412cd7178..0a3c06c1454bc 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})$/', ), + // All UATP card numbers start with a 1 and have a length of 15 digits. + 'UATP' => array( + '/^1[0-9]{14}$/', + ), // All Visa card numbers start with a 4 and have a length of 13, 16, or 19 digits. 'VISA' => array( '/^4([0-9]{12}|[0-9]{15}|[0-9]{18})$/', diff --git a/src/Symfony/Component/Validator/Tests/Constraints/CardSchemeValidatorTest.php b/src/Symfony/Component/Validator/Tests/Constraints/CardSchemeValidatorTest.php index b0280713d5285..fccee9e0abc1a 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() array('MASTERCARD', '2699999999999999'), array('MASTERCARD', '2709999999999999'), array('MASTERCARD', '2720995105105100'), + array('UATP', '110165309696173'), array('VISA', '4111111111111111'), array('VISA', '4012888888881881'), array('VISA', '4222222222222'), @@ -133,6 +134,7 @@ public function getInvalidNumbers() array('DISCOVER', '1117', CardScheme::INVALID_FORMAT_ERROR), // only last 4 digits array('MASTERCARD', '2721001234567890', CardScheme::INVALID_FORMAT_ERROR), // Not assigned yet array('MASTERCARD', '2220991234567890', CardScheme::INVALID_FORMAT_ERROR), // Not assigned yet + array('UATP', '11016530969617', CardScheme::INVALID_FORMAT_ERROR), // invalid length ); } }
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: