Skip to content

Commit 6ffb464

Browse files
author
Volodymyr Kublytskyi
committed
magento/payment-improvements#1: Add Brazilian Credit Cards Support
- added patterns for Brazilian cards to validator
1 parent 8832267 commit 6ffb464

File tree

1 file changed

+16
-0
lines changed
  • app/code/Magento/Payment/Model/Method

1 file changed

+16
-0
lines changed

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

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,22 @@ public function validate()
148148
'JCB' => '/^35(2[8-9][0-9]{12,15}|[3-8][0-9]{13,16})/',
149149
'MI' => '/^(5(0|[6-9])|63|67(?!59|6770|6774))\d*$/',
150150
'MD' => '/^(6759(?!24|38|40|6[3-9]|70|76)|676770|676774)\d*$/',
151+
152+
//Hipercard
153+
'HC' => '/^((606282)|(637095)|(637568)|(637599)|(637609)|(637612))\d*$/',
154+
//Elo
155+
'ELO' => '/^((509091)|(636368)|(636297)|(504175)|(438935)|(40117[8-9])|(45763[1-2])|' .
156+
'(457393)|(431274)|(50990[0-2])|(5099[7-9][0-9])|(50996[4-9])|(509[1-8][0-9][0-9])|' .
157+
'(5090(0[0-2]|0[4-9]|1[2-9]|[24589][0-9]|3[1-9]|6[0-46-9]|7[0-24-9]))|' .
158+
'(5067(0[0-24-8]|1[0-24-9]|2[014-9]|3[0-379]|4[0-9]|5[0-3]|6[0-5]|7[0-8]))|' .
159+
'(6504(0[5-9]|1[0-9]|2[0-9]|3[0-9]))|' .
160+
'(6504(8[5-9]|9[0-9])|6505(0[0-9]|1[0-9]|2[0-9]|3[0-8]))|' .
161+
'(6505(4[1-9]|5[0-9]|6[0-9]|7[0-9]|8[0-9]|9[0-8]))|' .
162+
'(6507(0[0-9]|1[0-8]))|(65072[0-7])|(6509(0[1-9]|1[0-9]|20))|' .
163+
'(6516(5[2-9]|6[0-9]|7[0-9]))|(6550(0[0-9]|1[0-9]))|' .
164+
'(6550(2[1-9]|3[0-9]|4[0-9]|5[0-8])))\d*$/',
165+
//Aura
166+
'AU' => '/^5078\d*$/'
151167
];
152168

153169
$ccNumAndTypeMatches = isset(

0 commit comments

Comments
 (0)