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 35926] New: - CreditValidator does not handle Visa correctly
Date Fri, 29 Jul 2005 07:21:05 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=35926>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=35926

           Summary: CreditValidator does not handle Visa correctly
           Product: Commons
           Version: unspecified
          Platform: Other
        OS/Version: other
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Validator
        AssignedTo: commons-dev@jakarta.apache.org
        ReportedBy: leo.moot@accenture.com


When using 5817550003933609 as card number the check will fail. This number is 
a valid Visa number, as used for Visa Carte Blue in France.

Solution:
change the Visa inner class to:

    private class Visa implements CreditCardType {
        private static final String PREFIX = "4,5,";
        public boolean matches(String card) {
            
	  String prefix2 = card.substring(0, 1) + ",";
            return ((PREFIX.indexOf(prefix2) != -1)
                    && (card.length() == 13 || card.length() == 16));
        }
    }

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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