@@ -29,65 +29,65 @@ class CardSchemeValidator extends ConstraintValidator
2929 protected $ schemes = [
3030 // American Express card numbers start with 34 or 37 and have 15 digits.
3131 CardScheme::AMEX => [
32- '/^3[47][0-9]{13}$/ ' ,
32+ '/^3[47][0-9]{13}$/D ' ,
3333 ],
3434 // China UnionPay cards start with 62 and have between 16 and 19 digits.
3535 // Please note that these cards do not follow Luhn Algorithm as a checksum.
3636 CardScheme::CHINA_UNIONPAY => [
37- '/^62[0-9]{14,17}$/ ' ,
37+ '/^62[0-9]{14,17}$/D ' ,
3838 ],
3939 // Diners Club card numbers begin with 300 through 305, 36 or 38. All have 14 digits.
4040 // There are Diners Club cards that begin with 5 and have 16 digits.
4141 // These are a joint venture between Diners Club and MasterCard, and should be processed like a MasterCard.
4242 CardScheme::DINERS => [
43- '/^3(?:0[0-5]|[68][0-9])[0-9]{11}$/ ' ,
43+ '/^3(?:0[0-5]|[68][0-9])[0-9]{11}$/D ' ,
4444 ],
4545 // Discover card numbers begin with 6011, 622126 through 622925, 644 through 649 or 65.
4646 // All have 16 digits.
4747 CardScheme::DISCOVER => [
48- '/^6011[0-9]{12}$/ ' ,
49- '/^64[4-9][0-9]{13}$/ ' ,
50- '/^65[0-9]{14}$/ ' ,
51- '/^622(12[6-9]|1[3-9][0-9]|[2-8][0-9][0-9]|91[0-9]|92[0-5])[0-9]{10}$/ ' ,
48+ '/^6011[0-9]{12}$/D ' ,
49+ '/^64[4-9][0-9]{13}$/D ' ,
50+ '/^65[0-9]{14}$/D ' ,
51+ '/^622(12[6-9]|1[3-9][0-9]|[2-8][0-9][0-9]|91[0-9]|92[0-5])[0-9]{10}$/D ' ,
5252 ],
5353 // InstaPayment cards begin with 637 through 639 and have 16 digits.
5454 CardScheme::INSTAPAYMENT => [
55- '/^63[7-9][0-9]{13}$/ ' ,
55+ '/^63[7-9][0-9]{13}$/D ' ,
5656 ],
5757 // JCB cards beginning with 2131 or 1800 have 15 digits.
5858 // JCB cards beginning with 35 have 16 digits.
5959 CardScheme::JCB => [
60- '/^(?:2131|1800|35[0-9]{3})[0-9]{11}$/ ' ,
60+ '/^(?:2131|1800|35[0-9]{3})[0-9]{11}$/D ' ,
6161 ],
6262 // Laser cards begin with either 6304, 6706, 6709 or 6771 and have between 16 and 19 digits.
6363 CardScheme::LASER => [
64- '/^(6304|670[69]|6771)[0-9]{12,15}$/ ' ,
64+ '/^(6304|670[69]|6771)[0-9]{12,15}$/D ' ,
6565 ],
6666 // Maestro international cards begin with 675900..675999 and have between 12 and 19 digits.
6767 // Maestro UK cards begin with either 500000..509999 or 560000..699999 and have between 12 and 19 digits.
6868 CardScheme::MAESTRO => [
69- '/^(6759[0-9]{2})[0-9]{6,13}$/ ' ,
70- '/^(50[0-9]{4})[0-9]{6,13}$/ ' ,
71- '/^5[6-9][0-9]{10,17}$/ ' ,
72- '/^6[0-9]{11,18}$/ ' ,
69+ '/^(6759[0-9]{2})[0-9]{6,13}$/D ' ,
70+ '/^(50[0-9]{4})[0-9]{6,13}$/D ' ,
71+ '/^5[6-9][0-9]{10,17}$/D ' ,
72+ '/^6[0-9]{11,18}$/D ' ,
7373 ],
7474 // All MasterCard numbers start with the numbers 51 through 55. All have 16 digits.
7575 // October 2016 MasterCard numbers can also start with 222100 through 272099.
7676 CardScheme::MASTERCARD => [
77- '/^5[1-5][0-9]{14}$/ ' ,
78- '/^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})$/ ' ,
77+ '/^5[1-5][0-9]{14}$/D ' ,
78+ '/^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})$/D ' ,
7979 ],
8080 // Payment system MIR numbers start with 220, then 1 digit from 0 to 4, then between 12 and 15 digits
8181 CardScheme::MIR => [
82- '/^220[0-4][0-9]{12,15}$/ ' ,
82+ '/^220[0-4][0-9]{12,15}$/D ' ,
8383 ],
8484 // All UATP card numbers start with a 1 and have a length of 15 digits.
8585 CardScheme::UATP => [
86- '/^1[0-9]{14}$/ ' ,
86+ '/^1[0-9]{14}$/D ' ,
8787 ],
8888 // All Visa card numbers start with a 4 and have a length of 13, 16, or 19 digits.
8989 CardScheme::VISA => [
90- '/^4([0-9]{12}|[0-9]{15}|[0-9]{18})$/ ' ,
90+ '/^4([0-9]{12}|[0-9]{15}|[0-9]{18})$/D ' ,
9191 ],
9292 ];
9393
0 commit comments