[ https://issues.apache.org/struts/browse/STR-1504?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_42090 ]
Paul Benedict commented on STR-1504: ------------------------------------ Fixed in Commons Validator 1.1.2 > [validator] Improved CreditCard validation and minor refactoring > ---------------------------------------------------------------- > > Key: STR-1504 > URL: https://issues.apache.org/struts/browse/STR-1504 > Project: Struts 1 > Issue Type: Improvement > Components: Core > Affects Versions: 1.1 RC1 > Environment: Operating System: All > Platform: Other > Reporter: Doug > Priority: Minor > Fix For: 1.2.2 > > > 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.) -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.