Skip to content

Commit

Permalink
feat: perform basic length validation on unrecognized credit card net…
Browse files Browse the repository at this point in the history
…works
  • Loading branch information
hendrickson-tyler committed Aug 20, 2024
1 parent 306ed9b commit 8ac6b74
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/lambda/c3-validate-entry/card/validation.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ export function validateCardNumber(cardNumber) {
const discover = new Discover(cardNumber);
return discover.validate();
default:
if (cardNumber.length < 13 || cardNumber.length > 19) {
return 'The card number must be between 13 and 19 digits long.';
}
return null; // Unknown card network; assume it's valid.
}
}
Expand Down

0 comments on commit 8ac6b74

Please sign in to comment.