Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id D05E3200C28 for ; Mon, 13 Feb 2017 00:05:46 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id CECCD160B6E; Sun, 12 Feb 2017 23:05:46 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 25610160B6B for ; Mon, 13 Feb 2017 00:05:45 +0100 (CET) Received: (qmail 86587 invoked by uid 500); 12 Feb 2017 23:05:45 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 86576 invoked by uid 99); 12 Feb 2017 23:05:45 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 12 Feb 2017 23:05:45 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id BDE43C0A56 for ; Sun, 12 Feb 2017 23:05:44 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -1.999 X-Spam-Level: X-Spam-Status: No, score=-1.999 tagged_above=-999 required=6.31 tests=[KAM_LAZY_DOMAIN_SECURITY=1, RP_MATCHES_RCVD=-2.999] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id NT0IizNiEtM9 for ; Sun, 12 Feb 2017 23:05:44 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 93A1D5F403 for ; Sun, 12 Feb 2017 23:05:43 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id E8EEEE0272 for ; Sun, 12 Feb 2017 23:05:41 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id A0BAA21D65 for ; Sun, 12 Feb 2017 23:05:41 +0000 (UTC) Date: Sun, 12 Feb 2017 23:05:41 +0000 (UTC) From: "Sebb (JIRA)" To: issues@commons.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Comment Edited] (VALIDATOR-404) Support Maestro, Solo and Switch cards MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Sun, 12 Feb 2017 23:05:47 -0000 [ https://issues.apache.org/jira/browse/VALIDATOR-404?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15853331#comment-15853331 ] Sebb edited comment on VALIDATOR-404 at 2/12/17 11:05 PM: ---------------------------------------------------------- If you just want to validate the checkdigit, you can use a validator such as the following: {code} new CodeValidator("(\\d+)", 12, 19, LuhnCheckDigit.LUHN_CHECK_DIGIT); {code} This does not validate the IIN part of the number, but it would act as a basic check against transpositions etc. was (Author: sebb@apache.org): If you just want to validate the checkdigit, you can use a validator such as the following: new CodeValidator("(\\d+)", 12, 19, LuhnCheckDigit.LUHN_CHECK_DIGIT); This does not validate the IIN part of the number, but it would act as a basic check against transpositions etc. > Support Maestro, Solo and Switch cards > -------------------------------------- > > Key: VALIDATOR-404 > URL: https://issues.apache.org/jira/browse/VALIDATOR-404 > Project: Commons Validator > Issue Type: Improvement > Components: CreditCard > Reporter: Tanya > Priority: Minor > Labels: payment, validation, validator > > 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: > {quote} > Maestro/Solo - 6759560045005727054 > Mastercard/Maestro/Switch - 5641821000010028 > {quote} > Suggested regex: > {code} > 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})$" > }); > {code} -- This message was sent by Atlassian JIRA (v6.3.15#6346)