commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sebb (JIRA)" <>
Subject [jira] [Resolved] (VALIDATOR-414) Simplify CreditCard validation
Date Sun, 12 Feb 2017 22:51:41 GMT


Sebb resolved VALIDATOR-414.
    Resolution: Done

Added the functionality as part of VALIDATOR-415.
Probably no point in reworking existing validators now, but new ones can use the new routines.

> Simplify CreditCard validation
> ------------------------------
>                 Key: VALIDATOR-414
>                 URL:
>             Project: Commons Validator
>          Issue Type: Improvement
>          Components: CreditCard
>            Reporter: Sebb
> It's tricky validating Credit card numbers using only regular expressions.
> It would be a lot simpler to check the syntax (digits only) and length, and then validate
the IIN (initial 6 digits) separately using numeric ranges.
> No need even to convert the strings to numbers, because string comparison would work
just as well.
> Unfortunately CreditCardValidator uses the final class CodeValidator in its public API,
but the latter can accept a RegexValidator which can be subclassed to provide the necessary
functionality. This should be possible without further exposing the internal workings.

This message was sent by Atlassian JIRA

View raw message