I've calculated the Luhn's algorithm for all the credit cards and it works fine. The only issue I have is that the American Express cards which are tested don't fulfill the Luhn's algorithm!
This is the Luhn's algorithm as described in the PSET:
Multiply every other digit by 2, starting with the number’s second-to-last digit
Then add those products’ digits together.
Add the sum to the sum of the digits that weren’t multiplied by 2.
4.If the total’s last digit is 0 (or, put more formally, if the total modulo 10 is congruent to 0), the number is valid!
Check it for yourself:
American Express 378282246310005
- 6 + 16 + 16 + 4 + 12 + 2 + 0 + 10
- 6 + 1 + 6 + 1 + 6 + 4 + 1 + 2 + 2 + 0 + 1 + 0 = 30
- 7 + 2 + 2 + 4 + 3 + 0 + 0 = 18
- results in checksum: 30 + 18 = 48 !!
American Express 371449635398431 ->
6 + 2 + 8 + 12 + 10 + 18 + 8 + 2
6 + 2 + 8 + 1 + 2 + 1 + 0 + 1 + 8 + 8 + 2 = 39
7 + 4 + 9 + 3 + 3 + 8 + 3 = 37
results in checksum: 39 + 37 = 76 !!
Both don't fulfill the Luhn's Algorithm. Yet they are valid AMEX for testing (https://developer.paypal.com/docs/payflow/payflow-pro/payflow-pro-testing/#testing-guidelines)
Has anyone else encountered this issue?