Skip to content

Commit 70688a5

Browse files
committed
Merge remote-tracking branch 'mpipub/MAGETWO-57228' into MPI-PR
2 parents a112a1f + d4d99d3 commit 70688a5

File tree

1 file changed

+8
-11
lines changed
  • app/code/Magento/Payment/Model/Method

1 file changed

+8
-11
lines changed

app/code/Magento/Payment/Model/Method/Cc.php

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -134,21 +134,16 @@ public function validate()
134134
// Visa
135135
'VI' => '/^4[0-9]{12}([0-9]{3})?$/',
136136
// Master Card
137-
'MC' => '/^5[1-5][0-9]{14}$/',
137+
'MC' => '/^(?:5[1-5][0-9]{2}|222[1-9]|22[3-9][0-9]|2[3-6][0-9]{2}|27[01][0-9]|2720)[0-9]{12}$/',
138138
// American Express
139139
'AE' => '/^3[47][0-9]{13}$/',
140140
// Discover
141-
'DI' => '/^(30[0-5][0-9]{13}|3095[0-9]{12}|35(2[8-9][0-9]{12}|[3-8][0-9]{13})' .
142-
'|36[0-9]{12}|3[8-9][0-9]{14}|6011(0[0-9]{11}|[2-4][0-9]{11}|74[0-9]{10}|7[7-9][0-9]{10}' .
143-
'|8[6-9][0-9]{10}|9[0-9]{11})|62(2(12[6-9][0-9]{10}|1[3-9][0-9]{11}|[2-8][0-9]{12}' .
144-
'|9[0-1][0-9]{11}|92[0-5][0-9]{10})|[4-6][0-9]{13}|8[2-8][0-9]{12})|6(4[4-9][0-9]{13}' .
145-
'|5[0-9]{14}))$/',
141+
'DI' => '/^(6011((0|9|[2-4])[0-9]{11,14}|(74|7[7-9]|8[6-9])[0-9]{10,13})|6(4[4-9][0-9]{13,16}|5[0-9]{14,17}))/',
142+
'DN' => '/^3(0[0-5][0-9]{13,16}|095[0-9]{12,15}|(6|[8-9])[0-9]{14,17})/',
143+
// UnionPay
144+
'UN' => '/^622(1(2[6-9][0-9]{10,13}|[3-9][0-9]{11,14})|[3-8][0-9]{12,15}|9([[0-1][0-9]{11,14}|2[0-5][0-9]{10,13}))|62[4-6][0-9]{13,16}|628[2-8][0-9]{12,15}/',
146145
// JCB
147-
'JCB' => '/^(30[0-5][0-9]{13}|3095[0-9]{12}|35(2[8-9][0-9]{12}|[3-8][0-9]{13})|36[0-9]{12}' .
148-
'|3[8-9][0-9]{14}|6011(0[0-9]{11}|[2-4][0-9]{11}|74[0-9]{10}|7[7-9][0-9]{10}' .
149-
'|8[6-9][0-9]{10}|9[0-9]{11})|62(2(12[6-9][0-9]{10}|1[3-9][0-9]{11}|[2-8][0-9]{12}' .
150-
'|9[0-1][0-9]{11}|92[0-5][0-9]{10})|[4-6][0-9]{13}|8[2-8][0-9]{12})|6(4[4-9][0-9]{13}' .
151-
'|5[0-9]{14}))$/',
146+
'JCB' => '/^35(2[8-9][0-9]{12,15}|[3-8][0-9]{13,16})/',
152147
'MI' => '/^(5(0|[6-9])|63|67(?!59|6770|6774))\d*$/',
153148
'MD' => '/^(6759(?!24|38|40|6[3-9]|70|76)|676770|676774)\d*$/',
154149
];
@@ -215,6 +210,8 @@ public function getVerificationRegEx()
215210
'MC' => '/^[0-9]{3}$/',
216211
'AE' => '/^[0-9]{4}$/',
217212
'DI' => '/^[0-9]{3}$/',
213+
'DN' => '/^[0-9]{3}$/',
214+
'UN' => '/^[0-9]{3}$/',
218215
'SS' => '/^[0-9]{3,4}$/',
219216
'SM' => '/^[0-9]{3,4}$/',
220217
'SO' => '/^[0-9]{3,4}$/',

0 commit comments

Comments
 (0)