Uploaded image for project: 'Commons Validator'
  1. Commons Validator
  2. VALIDATOR-39

[validator] CreditValidator does not handle Visa correctly

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Won't Fix
    • None
    • None
    • None
    • None
    • Operating System: All
      Platform: All

    • 35926

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

      }

      Attachments

        Activity

          People

            Unassigned Unassigned
            leo.moot@accenture.com Leo Moot
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: