bendrucker / angular-credit-cards

Angular directives for parsing and validating credit card inputs
MIT License
328 stars 98 forks source link

Discover Card # not validating #118

Closed snowdave86 closed 8 years ago

snowdave86 commented 8 years ago

6011111111111117 Discover Card # does not validate nor does it work in eager Pattern.

Current:

pattern: /^6(011(0[0-9]|[2-4]\d|74|7[7-9]|8[6-9]|9[0-9])|4[4-9]\d{3}|5\d{4})\d{10}$/, eagerPattern: /^6(011(0[0-9]|[2-4]|74|7[7-9]|8[6-9]|9[0-9])|4[4-9]|5)/

bendrucker commented 8 years ago

So I know that's one of Stripe's test card patterns. It's actually not in any documented BIN ranges I've ever seen, including Discover's official range docs. creditcards-types backs this library and I try to keep that library as in line with card issuer specs as possible. I'd recommend sticking to the second Stripe test card number which is fully valid.