Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Determine credit card type by number?

Can credit card type be determined solely from the credit card number?

Is this recommended or should we always ask client for the type of credit card they're using?

I Googled about it and found this algorithm: http://cuinl.tripod.com/Tips/o-1.htm , is this reliable?

like image 333
Henry Avatar asked Aug 20 '09 19:08

Henry


People also ask

Can you tell the type of credit card by the number?

Credit cards, such as MasterCard, Visa, and Discover, all have unique, identifying numbers as their first digits, with the exception of American Express, Diner's Club and Carte Blanche, which share the same first digit: the number 3. MasterCard's unique first digit is 5, while Visa's is always 4.

What are the 4 types of credit cards?

Four major types of credit cards are Visa, Mastercard, American Express and Discover. These are the major credit card networks, which most credit cards belong to, and they dictate where cards can be used as well as what secondary benefits cards offer.

What is the first 4 digits of a Visa card?

This number is called the MII, or major industry identifier, and it specifies the card network and industry. If your card starts with 3, your card uses the American Express network. Visa starts with 4, a Mastercard is 5 and Discover is 6. Other numbers are used to identify the industry.


2 Answers

Yes, the site you mentioned is correct. Many sites, incl. Google Checkout I believe, rely on automatic detection of the card type. It's convenient, makes the UI less cluttered (one less input box) and saves time. Go ahead!

like image 170
Alex Avatar answered Sep 20 '22 18:09

Alex


I have heard one good reason to make them pick (even though you can figure it out). So that they know the list of credit cards you accept.

like image 35
Lou Franco Avatar answered Sep 20 '22 18:09

Lou Franco