Commons Validator
  1. Commons Validator
  2. VALIDATOR-39

[validator] CreditValidator does not handle Visa correctly

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Won't Fix
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

      Description

      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)); }

      }

        Activity

        Leo Moot created issue -
        Henri Yandell made changes -
        Field Original Value New Value
        issue.field.bugzillaimportkey 35926 12342416
        Henri Yandell made changes -
        Affects Version/s unspecified [ 12311647 ]
        Key COM-2264 VALIDATOR-39
        Assignee Jakarta Commons Developers Mailing List [ commons-dev@jakarta.apache.org ]
        Component/s Validator [ 12311135 ]
        Project Commons [ 12310458 ] Commons Validator [ 12310494 ]
        Henri Yandell made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            Unassigned
            Reporter:
            Leo Moot
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development