Interface LUHNCalculator
- All Known Implementing Classes:
DefaultLUHNCalculator
public interface LUHNCalculator
Strategy interface for LUHN check-digit calculation and verification.
-
Method Summary
-
Method Details
-
verify
Verifies the LUHN check digit of a full PAN.- Parameters:
pan- the full card PAN including check digit- Returns:
trueif the check digit is valid- Throws:
InvalidCardException- if the PAN is null or too short
-
calculate
Computes the LUHN check digit for a PAN body (without check digit).- Parameters:
pan- the PAN without the check digit- Returns:
- the computed check digit character
- Throws:
InvalidCardException- if the PAN contains non-digit characters
-