Is there a way to detect the type of card i.e Debit or Credit

Viewed 1269

I need to detect the card type: Debit or Credit when the customer is on website's checkout page.

I am using the library i.e https://github.com/braintree/credit-card-type already to determine the card brand i.e Visa,Amex,Mastercard etc. But these don't provide the card type info. Is this possible at all.

1 Answers

Yes, it is possible. You need to get a list of BIN (Bank Identification Numbers) which correlate to card type (debit or credit). You then can compare the BIN number, which is the first 4-9 numbers of the card, to that list which will tell you the card type.

Processors like Worldpay and Card Connect make lists like this available. I am unsure if there is a cost or not. I found this free one but you'll need to massage it a bit to consume it programmatically. This API also claims to be free.

Related