The Wayback Machine - https://web.archive.org/web/20200523164439/https://github.com/jessepollak/card/issues/246
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

Card number formatting for card numbers with length >16 is broken #246

Open
blazeworx opened this issue May 6, 2016 · 6 comments
Open

Card number formatting for card numbers with length >16 is broken #246

blazeworx opened this issue May 6, 2016 · 6 comments
Labels
bug

Comments

@blazeworx
Copy link

@blazeworx blazeworx commented May 6, 2016

Not sure if this is intentional or not. However when I enter a visa card number i can enter 3 digits more (total of 19) than should be allowed ? (16). Is there a reason for this?

This doesn't happen on mastercard numbers or amex etc.

Screenshot from your demo site:
image

@Yottster
Copy link
Contributor

@Yottster Yottster commented May 10, 2016

Allowed lengths for visa: 13, 16, 19
Relevant wiki-article:
Bank_card_number#Issuer_identification_number_.28IIN.29

@blazeworx
Copy link
Author

@blazeworx blazeworx commented May 11, 2016

@Yottster OK. I was unaware that there are 19 digit visa card numbers. Personally I have never come across one but either way if card.js supports the input of 19 digits it should handle 19 digits in the preview without wrapping them.

@jessepollak
Copy link
Owner

@jessepollak jessepollak commented Sep 19, 2016

Ugh yeah, this needs to be fixed. Renaming to be more clear.

Would love to accept a PR for this change. If anyone is interested in contributing this in, I think the best solution would likely resize the text size of the card number field once its goes past 16 numbers. A library like textFit could be used.

@jessepollak jessepollak added the bug label Sep 19, 2016
@jessepollak jessepollak changed the title Card number formatting when using a visa number broken? Card number formatting for card numbers with length >16 is broken Sep 19, 2016
@tonywong625
Copy link

@tonywong625 tonywong625 commented Oct 6, 2016

Is there a way to limit Visa to be 16 characters ?

System like Cyber source doesnt allow Visa card to be 19 digits
https://www.cybersource.com/developers/getting_started/test_and_manage/best_practices/card_type_id/

@SnakeDoc
Copy link

@SnakeDoc SnakeDoc commented Nov 6, 2017

@tonywong625 It's been a while, but if you need to, it's pretty easy.

card.js: https://github.com/jessepollak/card/blob/master/dist/card.js#L1087

jquery.card.js: https://github.com/jessepollak/card/blob/master/dist/jquery.card.js#L1133

Just remove the ", 19" part. All of the card validation is done in those areas, so you can make any other changes you want, although I've only found the 19 digit visa to be an issue.

@tonywong625
Copy link

@tonywong625 tonywong625 commented Nov 21, 2017

I dont want to edit the core js, would be better if there is an option to overwrite it imo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
5 participants
You can’t perform that action at this time.