prolificinteractive / Caishen

A Payment Card UI & Validator for iOS
MIT License
766 stars 119 forks source link

Valid Discover card displayed as invalid #135

Closed hkellaway closed 6 years ago

hkellaway commented 6 years ago

Using valid Discover card test number: 6229 2567 3724 8989

Caishen UI displays as invalid. Simply asking Caishen to do a Luhn check on it, passes though 🤔

hkellaway commented 6 years ago

Turns out this is a UnionPay number

hkellaway commented 6 years ago

@DannyVancura - @quentin41500 is using the Android Braintree SDK which verifies this as a Discover card. as of typing in the first two numbers 62, Braintree says its China UnionPay; however, as of typing the first 3 numbers 622, it picks it up as Discover

hkellaway commented 6 years ago

looking up Discover BIN ranges, indeed the provided number would be a Discover card - i.e. 622925

Discover Card 6011 622126-622925 644-649 65

https://blog.groundlabs.com/cardholder-data-discovery-anatomy-of-a-credit-card-bin-ranges-luhn-checks