File tree Expand file tree Collapse file tree 2 files changed +3
-1
lines changed Expand file tree Collapse file tree 2 files changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -119,7 +119,7 @@ class CreditCard
119
119
*/
120
120
protected $ supported_cards = array (
121
121
self ::BRAND_VISA => '/^4\d{12}(\d{3})?$/ ' ,
122
- self ::BRAND_MASTERCARD => '/^(5[1-5]\d{4}|677189)\d{10}$/ ' ,
122
+ self ::BRAND_MASTERCARD => '/^(5[1-5]\d{4}|677189)\d{10}$|^(222[1-9]|2[3-6]\d{2}|27[0-1]\d|2720)\d{12}$ / ' ,
123
123
self ::BRAND_DISCOVER => '/^(6011|65\d{2}|64[4-9]\d)\d{12}|(62\d{14})$/ ' ,
124
124
self ::BRAND_AMEX => '/^3[47]\d{13}$/ ' ,
125
125
self ::BRAND_DINERS_CLUB => '/^3(0[0-5]|[68]\d)\d{11}$/ ' ,
Original file line number Diff line number Diff line change @@ -233,6 +233,8 @@ public function testGetBrandMasterCard()
233
233
{
234
234
$ card = new CreditCard (array ('number ' => '5555555555554444 ' ));
235
235
$ this ->assertSame (CreditCard::BRAND_MASTERCARD , $ card ->getBrand ());
236
+ $ card = new CreditCard (array ('number ' => '2221000010000015 ' ));
237
+ $ this ->assertSame (CreditCard::BRAND_MASTERCARD , $ card ->getBrand ());
236
238
}
237
239
238
240
public function testGetBrandAmex ()
You can’t perform that action at this time.
0 commit comments