@@ -29,65 +29,65 @@ class CardSchemeValidator extends ConstraintValidator
29
29
protected $ schemes = [
30
30
// American Express card numbers start with 34 or 37 and have 15 digits.
31
31
CardScheme::AMEX => [
32
- '/^3[47][0-9]{13}$/ ' ,
32
+ '/^3[47][0-9]{13}$/D ' ,
33
33
],
34
34
// China UnionPay cards start with 62 and have between 16 and 19 digits.
35
35
// Please note that these cards do not follow Luhn Algorithm as a checksum.
36
36
CardScheme::CHINA_UNIONPAY => [
37
- '/^62[0-9]{14,17}$/ ' ,
37
+ '/^62[0-9]{14,17}$/D ' ,
38
38
],
39
39
// Diners Club card numbers begin with 300 through 305, 36 or 38. All have 14 digits.
40
40
// There are Diners Club cards that begin with 5 and have 16 digits.
41
41
// These are a joint venture between Diners Club and MasterCard, and should be processed like a MasterCard.
42
42
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 ' ,
44
44
],
45
45
// Discover card numbers begin with 6011, 622126 through 622925, 644 through 649 or 65.
46
46
// All have 16 digits.
47
47
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 ' ,
52
52
],
53
53
// InstaPayment cards begin with 637 through 639 and have 16 digits.
54
54
CardScheme::INSTAPAYMENT => [
55
- '/^63[7-9][0-9]{13}$/ ' ,
55
+ '/^63[7-9][0-9]{13}$/D ' ,
56
56
],
57
57
// JCB cards beginning with 2131 or 1800 have 15 digits.
58
58
// JCB cards beginning with 35 have 16 digits.
59
59
CardScheme::JCB => [
60
- '/^(?:2131|1800|35[0-9]{3})[0-9]{11}$/ ' ,
60
+ '/^(?:2131|1800|35[0-9]{3})[0-9]{11}$/D ' ,
61
61
],
62
62
// Laser cards begin with either 6304, 6706, 6709 or 6771 and have between 16 and 19 digits.
63
63
CardScheme::LASER => [
64
- '/^(6304|670[69]|6771)[0-9]{12,15}$/ ' ,
64
+ '/^(6304|670[69]|6771)[0-9]{12,15}$/D ' ,
65
65
],
66
66
// Maestro international cards begin with 675900..675999 and have between 12 and 19 digits.
67
67
// Maestro UK cards begin with either 500000..509999 or 560000..699999 and have between 12 and 19 digits.
68
68
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 ' ,
73
73
],
74
74
// All MasterCard numbers start with the numbers 51 through 55. All have 16 digits.
75
75
// October 2016 MasterCard numbers can also start with 222100 through 272099.
76
76
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 ' ,
79
79
],
80
80
// Payment system MIR numbers start with 220, then 1 digit from 0 to 4, then between 12 and 15 digits
81
81
CardScheme::MIR => [
82
- '/^220[0-4][0-9]{12,15}$/ ' ,
82
+ '/^220[0-4][0-9]{12,15}$/D ' ,
83
83
],
84
84
// All UATP card numbers start with a 1 and have a length of 15 digits.
85
85
CardScheme::UATP => [
86
- '/^1[0-9]{14}$/ ' ,
86
+ '/^1[0-9]{14}$/D ' ,
87
87
],
88
88
// All Visa card numbers start with a 4 and have a length of 13, 16, or 19 digits.
89
89
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 ' ,
91
91
],
92
92
];
93
93
0 commit comments