DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=20557>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=20557

Improved CreditCard validation and minor refactoring

           Summary: Improved CreditCard validation and minor refactoring
           Product: Commons
           Version: unspecified
          Platform: Other
        OS/Version: All
            Status: NEW
          Severity: Enhancement
          Priority: Other
         Component: Validator
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


We've been doing Credit Card number validation for several years, so we had our
own utility methods, around which we wrapped a Struts validator.

I have since discovered that such a validator already exists in Struts/Commons.
 I looked at the source and that validator does everything ours does except
allow you to specify which Credit Card brands are valid for your particular
application.  This would be a nice feature to add to both the Struts and Commons
validator classes.  (Our validator uses a comma-delimited list of
single-character codes in validation.xml to indicate which card types are to be
allowed.  e.g. V,M for Visa,Mastercard)

Also, while looking at the
org.apache.commons.validator.GenericValidator.validateCreditCardPrefixCheck()
method, I noticed that the series of "if" statements could be converted to "else
if" statements for greater efficiency.  (Or the second set could be changed to
simply return early.)

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to