You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Paul Benedict (JIRA)" <ji...@apache.org> on 2007/09/01 06:01:37 UTC

[jira] Closed: (STR-1504) [validator] Improved CreditCard validation and minor refactoring

     [ https://issues.apache.org/struts/browse/STR-1504?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Paul Benedict closed STR-1504.
------------------------------

       Resolution: Fixed
    Fix Version/s: 1.2.2
         Assignee:     (was: Struts Developers)

> [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.