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: [EMAIL PROTECTED] 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]