Hi Jackie,
Thanks for posting this.
Two points which will help explain the scope of how this affects Zen Cart:
1. In practice the majority of Zen Cart payment modules/plugins ignore the actual card-type, because it's not needed in order to actually process a transaction. This leaves it up to the actual payment gateway provider to accept/reject the card, based on their own rules and relationship with the merchant's account configuration.
2. The only thing Zen Cart does with regard to "detecting the card type" is allow the storeowner to "turn off" (or "on") the ability to "accept" a certain card-type in their store. This is more an artifact than a necessity, but has its benefits insomuch as allowing to completely avoid sending a payment attempt for an Amex card if the storeowner already knows they don't accept Amex. This helps avoid the partial-auth "fee" that the gateway charges for attempting authorizations, even if the payment is not approved.
So, unless the store is specifically trying to DISALLOW (new) MasterCard cards, this will be a non-issue for them.
But for those stores who absolutely want to deny Mastercard cards, they must first do so in Admin->Configuration->Credit Cards,
and then make the following code change to have that MasterCard denial include the new cards in the new "2" BIN range:
/includes/classes/cc_validation.php
change
Code:
$this->cc_type = 'Visa';
} elseif (preg_match('/^5[1-5][0-9]{14}$/', $this->cc_number) && CC_ENABLED_MC=='1') {
$this->cc_type = 'MasterCard';
to:
Code:
$this->cc_type = 'Visa';
} elseif (preg_match('/^(5[1-5][0-9]{14}|2[2-7][0-9]{14})$/', $this->cc_number) && CC_ENABLED_MC=='1') {
$this->cc_type = 'MasterCard';
This updated regex rule is a bit simplified, but will account for the majority of cases that will be encountered.
Again, NONE OF THIS IS NEEDED if the storeowner DOES accept MasterCard cards.
Bookmarks