You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Tim Deboer (JIRA)" <ji...@apache.org> on 2016/04/10 15:22:25 UTC

[jira] [Commented] (VALIDATOR-392) Mastercard Series 2 bin ranges - active as of October 2016

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

Tim Deboer commented on VALIDATOR-392:
--------------------------------------

Sample solution could be something to the effect of: 

private static class Mastercard implements CreditCardType {
        //private static final String PREFIX = "51,52,53,54,55,";
		@Override
        public boolean matches(String card) {
			if(card.length() == 16) {
				if(card.charAt(0) == '5' && (card.charAt(1) > '0' && card.charAt(1) < '6')) {
					return true;
				} else if(card.charAt(0) == 2) {
					int bin = Integer.parseInt(card.substring(0, 6));
					return bin >= 222100 && bin <= 272099;
				}
			}
            return false;
        }
    }

ignoring the fact that the Integer.parseInt can throw number format exception....

> Mastercard Series 2 bin ranges - active as of October 2016
> ----------------------------------------------------------
>
>                 Key: VALIDATOR-392
>                 URL: https://issues.apache.org/jira/browse/VALIDATOR-392
>             Project: Commons Validator
>          Issue Type: Improvement
>          Components: Routines
>    Affects Versions: 1.5.0
>            Reporter: Tim Deboer
>            Priority: Minor
>
> Mastercard is releasing new series 2 bin ranges. Quote from their information sheet is:
> "To help ensure that MasterCard and its customers are best positioned to
> enable the next generations of payments, MasterCard is expanding the
> Bank Identification Number (BIN) range by introducing a new range of 2
> series BINs (222100–272099) that will be processed in the same manner as the MasterCard 51–55 series BINs are processed today."



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)