Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

19 digit credit card numbers? #155

Open
tim-m89 opened this issue May 25, 2015 · 5 comments
Open

19 digit credit card numbers? #155

tim-m89 opened this issue May 25, 2015 · 5 comments

Comments

@tim-m89
Copy link

tim-m89 commented May 25, 2015

I've tried the demo and I can't seem to get a 19 digit number like I found on this site to work. It appears that cardNumberGrouping defines the max length. Using Firefox 38.

@tangoNine
Copy link

Yeah I am seeing the need to expand to handle 19 digit card number. In my testing I have been able to make adjustments to the skeuocard.js and the skeuocard.css in this manner.

Using Visa as a test,

1    realcard.prototype.CardProduct.create({
2    pattern: /^4/,
3    companyName: "Visa",
4    companyShortname: "visa",
5    cardNumberGrouping: [4, 4, 4, 4],
6    cardNumberLength: [13, 14, 15, 16],
7    expirationFormat: "MM/YY",
8    validateLuhn: true,
9    cvcLength: 3,
10    layout: {
11     number: 'front',
12      exp: 'front',
13      name: 'front',
14      cvc: 'back'
15   }
16  });

If you know the 19 character patter I changed lines 5 & 6 to the following just to try it out.

5    cardNumberGrouping: [4, 4, 4, 7],
6    cardNumberLength: [13, 14, 15, 16, 19],

On the CSS I changed the font size from 1.5em to 1.25em

.skeuocard.js .cc-number input {
    color:#333;
    font-family:"ocraregular", "OCR A Std", "OCR A", Courier, "Courier New", monospace;
    font-size:1.5em;
}

While it was not the best looking it did let me enter 16 and 19 length cards.

I am not sure if that I am doing is correct or not, as I am a hobbiest kind of coder and I still have not figured out how to make the expiration date output be MM YY i.e 01 18 and not 1 2018 so I would check with someone that knows more than me to get it 100%.

@tim-m89
Copy link
Author

tim-m89 commented Jun 30, 2015

I was trying to see if there was some simple way to dynamically handle lengths and groupings for all 12-19 credit card number. Unless someone knows any better, I think the only fool proof way would be to have a comprehensive database all known IINs so probably not. While doing some google image searches for 'maestro', I found a few examples of uncommon groupings, and even multiple groupings for the rarest lengths. By the way, this page has a 19 digit maestro example where the grouping is [5,11,3].

@tangoNine
Copy link

Building a database could be a nightmare. I have put out some requests regarding the 19 digits. I do internal PCI auditing for a card processor. I should be able to get layouts, patterns, and types from some of the engineers that I deal with. WIll post back here when I have something.

@custa1200
Copy link

hi @tangoNine did you ever get more information around layouts and patterns of 19 digit numbers? I saw somewhere else that it was thought to be 4 4 4 7

@tangoNine
Copy link

tangoNine commented Sep 7, 2016

@custa1200 Yeah, the pattern that you have is what is going to be expected by what we have from Visa, Mastercard. Discover will use the same pattern when and if they choose to go that route and American Express, at this time, has no plans to change their pattern scheme. Also, just as an aid on what card to display, here is a very basic IIN Range table that I can offer. It's just for card type i.e. Visa, Mastercard etc and not for specific branded cards.

American Express 34, 37 15
Diners Club - Carte Blanche 300, 301, 302, 303, 304, 305 14
Diners Club - International 36 14
Diners Club - USA & Canada 54 16
Discover 6011, 622126 to 622925, 644, 645, 646, 647, 648, 649, 65 16
InstaPayment 637, 638, 639 16
JCB 3528 to 3589 16
Laser 6304, 6706, 6771, 6709 16-19
Maestro 5018, 5020, 5038, 5893, 6304, 6759, 6761, 6762, 6763 16-19
MasterCard 51, 52, 53, 54, 55, 22 16-19
Visa 4 13-16
Visa Electron 4026, 417500, 4508, 4844, 4913, 4917 16

For any that want to get really deep in displaying cards I have attached the most current BIN list by card brand/issuer/variant i.e. BIN Numbers for Chase Saphire, Subway, BestBuy, Canada Trust etc that I have might help but good to have none the less.
Card-Brand-Bin-List-082016.txt

_EDIT_
Something that I forgot to mention. There is nothing in the BIN numbers or elsewhere in the card number to indicate if it is a 19 digit number. Visa and Mastercard expect developers to simple expand the maxlength attribute in a form field for Card Number from maxlength="16" to maxlength="19". So I would think that for the last quad set of the card number that the filed somehow be widened to accept 7 numbers instead of 4 OR a single field that after they enter the digits and it loses focus some magic happens and it counts the number of digits and displays XXXX XXXX XXXX XXXX for a 16 number card or XXXX XXXX XXXX XXXXXXX for a 19.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants