|
|
|
The {{ calculateLuhnMod10Check(final List<Integer> digits) }} method returns values 1 through 10 instead of 0 through 9. Since the check digit on the credit card can never be 10 and will sometimes be zero, all credit cards ending in zero, which are valid credit card numbers, are failing the validation. Example: 5105 1051 0510 5100.
This is the portion of the validator we are using, but I believe this might also apply to the other two validations for mod 10 and mod 11 in the same {{ ModUtil }} class, where an additional mod of the appropriate value will be needed to obtain the correct mod if the result is either 10 or 11.
I am suggesting a change from the current " {{ return 10 - (sum % 10); " }} to " {{ return (10 - sum % 10) %10; " }} , in order to convert any result of 10 to zero, but still maintaining the integrity of all other possible results.
|
|
|
|