inacho / php-credit-card-validator

Validates popular debit and credit cards numbers against regular expressions and Luhn algorithm. Also validates the CVC and the expiration date.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Include MIR credit card

arturhayne opened this issue · comments

MIR credit card has been recognized as "mastercard", but it should has a different validation, something like below:

protected static $mirCardPattern = [
            'mir' => [
                'type'      => 'mir',
                'pattern'   => '/^220[0-4]/',
                'length'    => [16, 17, 18, 19],
                'cvcLength' => [3],
                'luhn'      => true,
            ],
        ];    

Mastercard should be updated to something like: '/^(5[0-5]|2[3-7]|22[1-9]|220[5-9])/' extracting MIR from its pattern.

MIR Range: 2200–2204
MIR Length: 16–19

https://en.wikipedia.org/wiki/Payment_card_number

Thank you.