What can we help you with?


000002056


655

07/11/2024 02:20 AM

3.0

 

Instructions

 

 

There are two components to determining if a given credit card number is legitimate.

  • Formatting on account length and format
  • Proof of a valid/active/funded account behind the account/number in question

For the second of these items - the verification of the account/funds/payment capability - only running authorization or contacting the card issuing bank can fully confirm.

For the formatting piece, however, you may use the Luhn Mod-10 method/schema to verify whether a credit card number falls within the legitimate 'format' constraints for each card type.  Notes on these can be found below.


Check Digit Scheme

 

A check digit is a digit added to a number (either at the end or the beginning) that validates the authenticity of the number. A simple algorithm is applied to the other digits of the number which yields the check digit. Check Digit Scheme can be used when an end-user has entered in a credit card number and you want to validate it before sending it an authorization.

This self-checking scheme (referred to as the Luhn Mod-10 Method) is an international standard for validating card account numbers (ISO 2894/ANSI 4.13). Such account numbers, which cannot exceed 19 digits including the check digit, are assigned, embossed and encoded to include a single check digit in the rightmost position. The check digit is calculated as follows:

  1. Beginning on the right with the digit which immediately precedes the check digit and moving toward the left, double every other digit. After doubling each selected digit, if the result is ten or greater, add the two digits together to arrive at a single-digit result.
  2. Each individual resulting digit (plus those skipped above) are then added together.
  3. This sum is then subtracted from the lowest multiple of ten which is equal to or greater than the sum and the single-digit result is the check digit.

Example:
15-Digit Account Number 7951-0287-9015-54?

Note: Our processing systems will perform such a check on credit card numbers before processing the transaction. If the card number entered is not valid, you will receive a 'Credit card number specifies an invalid value’ decline response for the transaction. This method does not verify whether the credit card number itself is a real account number or has enough funds. That can only be accomplished by processing an authorization request over a card network.

Below are examples of card number's numeric range and number of digits.

American Express

Valid length: 15 digits. First digit must be a 3 and second digit must be a 4 or 7. 

Diners Club and Carte Blanche

Valid length: 14 digits. 

First digit must be 3 and second digit must be 0, 6, 8 or 9. The ranges are:

300000 through 305999
309500 through 309599
360000 through 369999
380000 through 399999

Discover

Valid length: 16 digits.

First 6 digits must be in one of the following ranges:

601100 through 601109
601120 through 601149
601174
601177 through 601179
601186 through 601199
644000 through 659999

enRoute

Valid length: 15 digits. First four digits must be 2014 or 2149.

JCB

Valid length: 16 to 19 digits.

First 4 digits must be in the range 3528 through 3589. 

MasterCard

Valid length: 16 digits.

First digit must be 5 and second digit must be in the range 1 through 5 inclusive. The range is 510000 through 559999.

First digit must be 2 and second digit must be in the range 2 through 7 inclusive. The range is 222100 through 272099.

Maestro

Valid length: Up to 19 digits.

First digit must be 5 or 6. The ranges are:

50nnnn
56nnnn through 64nnnn
66nnnn through 69nnnn

Note: The range 60nnnn to 64nnnn is also used by Discover (see above). 

Visa

Valid length: Up to 19 digits. First digit must be a 4. 

 



Was this article helpful?


Articles Recommended for You