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

Refactor preview parsing #79

Open
gilbarbara opened this issue May 2, 2020 · 3 comments
Open

Refactor preview parsing #79

gilbarbara opened this issue May 2, 2020 · 3 comments
Milestone

Comments

@gilbarbara
Copy link
Contributor

gilbarbara commented May 2, 2020

It should work with Amex, Diners, 16, and 19 characters.

@gilbarbara gilbarbara added this to the 1.0 milestone May 2, 2020
@gilbarbara gilbarbara mentioned this issue May 2, 2020
@cassiocardoso
Copy link
Contributor

cassiocardoso commented May 11, 2020

I was checking this issue and I noticed this line:

https://github.com/amarofashion/react-credit-cards/blob/master/src/index.js#L74

Given the logic below where the try to update the maxLength depending on the number passed, I don't think it's necessary to set the maxLength to 19 if it is in preview mode.

I did some tests locally with 16, 19 digit cards as well the Diners type mentioned in issue #70 and it appears to solve our issues.

@gilbarbara what do you think? Any edge cases that you can think of?

@gilbarbara
Copy link
Contributor Author

Actually the task is to handle formatting with these cards and not exactly detect the maxLength.
MaxLenght is just a safeguard to avoid breaking the UI.

Is that it?

@cassiocardoso
Copy link
Contributor

This is what I noticed locally while testing with the number provided in issue #70 (preview mode - Diners card w/ 14 digits):
Screenshot 2020-05-12 at 15 25 53
(notice the extra bullet at the end of the number)

That's why I thought we would need to update maxLength for this case.

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

No branches or pull requests

2 participants