braintree / credit-card-type

A library for determining credit card type
MIT License
980 stars 154 forks source link

Fix mastercard prefix pattern for numbers starting with 27 #48

Closed crookedneighbor closed 7 years ago

crookedneighbor commented 7 years ago

Reported here: https://github.com/braintree/card-validator/issues/49

In my scenario I was entering in a MC in the bin range 222100–272099 and once I entered in 27, isPotentiallyValid returns false. If I continue to type in 7 it is still false but once I type 0 is is now potentially valid again.

The problem was that we didn't have 27 and 27[0-2] listed as potentially valid in the prefix pattern.