commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Niall Pemberton (JIRA)" <>
Subject [jira] Updated: (VALIDATOR-247) Move CreditCardValidator to routines package and refactor
Date Sat, 03 Nov 2007 02:27:50 GMT


Niall Pemberton updated VALIDATOR-247:


As you mention I was thinking that the new routines version could use the new "generic" code
validator for individual cards and perhaps ditch the CreditCardType interface altogether.
 New cards types can simply be implemented by creating a new CodeValidator instance with an
appropriate regular expression rather than having to define a new CreditCardType implementation.

The main (IMO) advantage though is that if someone wanted to allow separators (spaces or dashes)
they can define a regular expression with the separators as a "non-capturing group" which
means they get "stripped" out before the check digit validation is done - and the valdiator
can return a uniform card number without validators.

Attaching an option for consideration.

> Move CreditCardValidator to routines package and refactor
> ---------------------------------------------------------
>                 Key: VALIDATOR-247
>                 URL:
>             Project: Commons Validator
>          Issue Type: Task
>          Components: Routines
>            Reporter: Ben Speakmon
>            Assignee: Ben Speakmon
>             Fix For: 1.4
>         Attachments:
> Having copied CreditCardValidator to routines, it now needs to be refactored to use CodeValidator/LuhnCheckDigit/etc.
It might also make sense to break CreditCardType out into a separate 1.4-style typesafe enum
so it can be easily converted to a real enum for Validator 2.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message