This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static String validateCardNumWithLuhnAlgorithm(String input) { | |
if (input.isEmpty) { | |
return Strings.fieldReq; | |
} | |
input = getCleanedNumber(input); | |
if (input.length < 8) { // No need to even proceed with the validation if it's less than 8 characters | |
return Strings.numberIsInvalid; | |
} |