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

Support Maestro, Solo and Switch cards

    XMLWordPrintableJSON

    Details

      Description

      Maestro, Solo and Switch card types are popular services owned by Mastercard.

      Would be nice to add validators for those cards into the apache validator framework.

      Example of cards:

      Maestro/Solo - 6759560045005727054
      Mastercard/Maestro/Switch - 5641821000010028

      Suggested regex:

      private static final RegexValidator MAESTRO_REGEX =
                  new RegexValidator(new String[] {
                          // Maestro
                          "^(5018|5020|5038|6304|6759|6761|6763)[0-9]{8,15}$",
                          // Solo
                          "^(6334|6767)[0-9]{12}$", "^((6334|6767)[0-9]{14})$", "^((6334|6767)[0-9]{15})$",
                          // Switch Card
                          "^(4903|4905|4911|4936|6333|6759)[0-9]{12}$", "^(4903|4905|4911|4936|6333|6759)[0-9]{14}$",
                          "^(4903|4905|4911|4936|6333|6759)[0-9]{15}$", "^(564182[0-9]{10})$", "^(564182[0-9]{12})$",
                          "^(564182[0-9]{13})$", "^(633110[0-9]{10})$", "^(633110[0-9]{12})$", "^(633110[0-9]{13})$"
                  });
      

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              tanyaz Tanya
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: