Skip to content

Commit 44ef886

Browse files
committed
Merge pull request #88 from pixelchutes/new-mastercard-2-series-issue-87
Add new MasterCard "2" series BIN range support
2 parents 5501385 + c1cc90a commit 44ef886

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/Omnipay/Common/CreditCard.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ class CreditCard
119119
*/
120120
protected $supported_cards = array(
121121
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}$/',
123123
self::BRAND_DISCOVER => '/^(6011|65\d{2}|64[4-9]\d)\d{12}|(62\d{14})$/',
124124
self::BRAND_AMEX => '/^3[47]\d{13}$/',
125125
self::BRAND_DINERS_CLUB => '/^3(0[0-5]|[68]\d)\d{11}$/',

tests/Omnipay/Common/CreditCardTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,8 @@ public function testGetBrandMasterCard()
233233
{
234234
$card = new CreditCard(array('number' => '5555555555554444'));
235235
$this->assertSame(CreditCard::BRAND_MASTERCARD, $card->getBrand());
236+
$card = new CreditCard(array('number' => '2221000010000015'));
237+
$this->assertSame(CreditCard::BRAND_MASTERCARD, $card->getBrand());
236238
}
237239

238240
public function testGetBrandAmex()

0 commit comments

Comments
 (0)