Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Identify if a "Credit card" or "Debit card" by the card number [duplicate]

I can initially do a check to identify if I have a valid Payment Card Number by performing Luhn check algorithm.

But then I need to identify if it is a Credit card or a Debit card to perform the next task accordingly. I understand this depends on the first four characters, but I'm not sure about the exact ranges.

If someone can explain or provide with a link which explains this would be great. Thanks.

Edits...

In both these stackoverflow Links I don't see my question is answered. Therefore this can not be a duplicate for any of these.

In my case it doen't read the card using a card reader and instead using the card number, CVV and exp date to get the payment done(User insert these things).

Also "yes" I can do a check to identify if it is a Visa card, Master Card or an American Express card. But no way to find if its a Credit or a Debit card.(For example if the card is a Visa card then how will I get to know that Visa card is a "credit card" or a "debit card". That's the exact question).

like image 570
JibW Avatar asked May 29 '13 09:05

JibW


People also ask

Can you tell if a card is a credit or debit card by the number?

Is the debit or credit card account number the same as the card number? No. The entire 16-digit numeric sequence on the front of the card is the card number.

How do you know if a card is a debit or credit card?

Credit cards and debit cards look very similar and have much of the same information on the front and back, so it's easy to confuse them. However, a debit card will say "debit" somewhere on the card, typically on the front, above the credit card number.

Can credit cards be duplicated?

Most credit card cloning fraud is done through the use of skimmers. Skimmers read credit card information such as numbers, PINs, CVV data through the magnetic stripe, and can be attached to hardware such as point of sale (POS) terminals, or ATMs, allowing them to steal whoever uses that hardware's information.

How do you tell if a card number is a credit card?

Key Points About: Credit Card Numbers A credit card number is the long set of digits displayed across the front or back of your plastic or metal credit card. It is typically 16 digits in length, often appearing in sets of four, and it is used to identify both the credit card issuer and the account holder.


1 Answers

You cannot - unambiguously - tell the difference from just the PAN number. There is no official public database detailing this information and if the banks ever get together to make that happen they will be accused of collusion.

There are some resources online that could be used depending on what country you are in. Barclays offer a PDF document called "CARD IDENTIFICATION AND VALIDATION - Barclaycard" that is applicable to the UK but they will not offer any guarantees as to its accuracy. It is updated approximately quarterly to follow industry changes. You will have to google it as I cannot post a link to a pdf file.

By the way - just doing a LUHN check is not enough because the LUHN check is also used for many other numbers, EAN13 barcodes for example.

like image 183
OldCurmudgeon Avatar answered Oct 25 '22 14:10

OldCurmudgeon