commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 20557] New: - Improved CreditCard validation and minor refactoring
Date Fri, 06 Jun 2003 17:35:36 GMT
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: commons-dev@jakarta.apache.org
        ReportedBy: ummmmm22@yahoo.com


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: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message