[ 
https://issues.apache.org/jira/browse/VALIDATOR-404?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15448233#comment-15448233
 ] 

Tanya commented on VALIDATOR-404:
---------------------------------

Hi [~britter], Unfortunately all i have is this wiki page - 
https://en.wikipedia.org/wiki/Payment_card_number
My company uses some third party gateway to perform all online bookings, just 
recently we decided to perform some luhn checks on our front ends as well, just 
to make the users feedback faster in case they mistyped or something. Were 
happy with apache-validator so far. But found some of the testing credit cards 
passed to us by the third party don't pass the luhn check when using later 
1.5.1 version.

> Support Maestro, Solo and Switch cards
> --------------------------------------
>
>                 Key: VALIDATOR-404
>                 URL: https://issues.apache.org/jira/browse/VALIDATOR-404
>             Project: Commons Validator
>          Issue Type: Improvement
>            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.4#6332)

Reply via email to