PANs are checked for validity using the Luhn check-digit algorithm (also known as “Mod-10 checking”). If the iVeri Gateway receives a transaction that fails Mod-10 checking, then “Invalid Card Number” (ResultCode 14) if returned.
A merchant may perform Mod-10 checking up front before sending the transaction to the iVeriGateway.
The steps of the algorithm are described below (however there are many Mod-10 algorithms available for download on the Internet):
- Exclude the right-most digit from the calculation as this is the actual check-digit to be examined for validity.
- Starting with the 2^{nd} to the last digit and moving right to left, alternatively multiply each successive digit by 2 and 1 respectively.
- Sum the integers comprising the product obtained from each of the calculations.
- Subtract the resulting sum from the next higher multiple of ten (10). The resulting value is the desired account number check-digit.
The following example uses the PAN of: 4287 9478
Step |
Description |
Example |
1 |
Example account number |
4 2 8 7 9 4 7 (8) |
2 |
Multiplier Products |
x2 x1 x2 x1 x2 x1 x2 |
3 |
Sum the integers |
8 + 2 + (1+6) + 7 + (1+8) + 4 + (1+4) = 42 |
4 |
Derive the Check Digit |
50 – 42 = 8 |