fix validation for Maestro UK card numbers

This commit is contained in:
Christian Flothmann 2015-06-27 23:20:18 +02:00
parent d270bdc952
commit f24532a04e
2 changed files with 4 additions and 1 deletions

View File

@ -67,7 +67,8 @@ class CardSchemeValidator extends ConstraintValidator
'MAESTRO' => array( 'MAESTRO' => array(
'/^(6759[0-9]{2})[0-9]{6,13}$/', '/^(6759[0-9]{2})[0-9]{6,13}$/',
'/^(50[0-9]{4})[0-9]{6,13}$/', '/^(50[0-9]{4})[0-9]{6,13}$/',
'/^([56-69][0-9]{4})[0-9]{6,13}$/', '/^5[6-9][0-9]{10,17}$/',
'/^6[0-9]{11,18}$/',
), ),
// All MasterCard numbers start with the numbers 51 through 55. All have 16 digits. // All MasterCard numbers start with the numbers 51 through 55. All have 16 digits.
'MASTERCARD' => array( 'MASTERCARD' => array(

View File

@ -90,8 +90,10 @@ class CardSchemeValidatorTest extends AbstractConstraintValidatorTest
array('LASER', '6771656738314582216'), array('LASER', '6771656738314582216'),
array('MAESTRO', '6759744069209'), array('MAESTRO', '6759744069209'),
array('MAESTRO', '5020507657408074712'), array('MAESTRO', '5020507657408074712'),
array('MAESTRO', '5612559223580173965'),
array('MAESTRO', '6759744069209'), array('MAESTRO', '6759744069209'),
array('MAESTRO', '6759744069209'), array('MAESTRO', '6759744069209'),
array('MAESTRO', '6594371785970435599'),
array('MASTERCARD', '5555555555554444'), array('MASTERCARD', '5555555555554444'),
array('MASTERCARD', '5105105105105100'), array('MASTERCARD', '5105105105105100'),
array('VISA', '4111111111111111'), array('VISA', '4111111111111111'),