How tell the difference between a Debit Card and a Credit Card

not sure what you need that for, but all POS systems i'm aware of ASK THE USER to specify the type of the card.

you can run Debit as Credit - no need for pin number
you can run Credit as Debit - enter in your pin, and transaction will count as cash advance


The best code I've seen for checking a card type is a Javascript page at http://www.eflo.net/mod10.htm - can differentiate between a VISA Debit and Credit card as you requested, a long with many other variations of cards. I've ported this code to C# very easily.

Your other alternative is to acquire a copy of the BIN (Bank Identification Number) database, which is a list of all card prefixes, the card issue, and the card validation requirements (e.g. Expiry Date, Issue No, Start Date). Some BIN sources;

  • Wikipedia has a free incomplete list at http://en.wikipedia.org/wiki/List_of_Bank_Identification_Numbers
  • BINBase is a commercial list - http://www.binbase.com/

Wiki has lists of credit vs. debit prefixes

However, IIRC some cards may be used as both credit and debit depending on context.