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

Problem with Visa cards? #55

Open
PhilMDev opened this issue Nov 17, 2018 · 10 comments
Open

Problem with Visa cards? #55

PhilMDev opened this issue Nov 17, 2018 · 10 comments

Comments

@PhilMDev
Copy link

It appears that Visa cards (starting with 4) are not validating properly if I include cardNumberInput. It formats the card number properly but when I tab out after entering 16 digits it removes the last digit. If I add a space at the end it validates the card number. If I remove the cardNumberInput setting it validates after 16 digits without error. And, without formatting, obviously.

If I test with MasterCard it works as expected including formatting.

Thanks for looking at this.

@ddayguerrero
Copy link
Collaborator

Hi @PhilMDev, looking into your issue and I'm not able to reproduce the error. Would you be able to provide me with a test Visa card number so that I can try this out?

@PhilMDev
Copy link
Author

I tried several numbers. But you should be able to see this using 4111111111111111. I've taken three screen shots:

  1. This is the 4111... number entered. You can see all the digits and the validation doesn't work.
  2. This is the 4111... number after I tab out of the field. Notice that it lost the last 1.
  3. This is a default MC number. Validated properly.

I looked through your code and it appears that Visa allows something other than 16 digits. I played with your code a little to see if I could fix the issue and I couldn't.

Thank you!
full number not validated
deleted digit after tab
mc validated properly

@PhilMDev
Copy link
Author

One other thing I just noted. When entering a Visa card number the routine adds a space after I enter the last digit. When I enter the MC number it doesn't. It stops after the 16th digit.

And on the Visa number, if I backspace to delete the extra space it deletes the last digit!

Thanks!

@ddayguerrero
Copy link
Collaborator

Thanks for the examples! It seems like we do have something weird going on with the pre-formatting of Visa cards. This might be tied to the fact that we allow 19 digit Visa card numbers.

If this is urgent, perhaps you can trim the user's input for now. WDYT? I can look into an elegant solution.

@PhilMDev
Copy link
Author

PhilMDev commented Dec 3, 2018

Thank you for your response. It certainly is not urgent. For right now I just turned off the formatting. That works just fine. Not as pretty, but it works! If you should be able to come up with a fix please let me know.

Thanks for all your hard work!

@warksit
Copy link

warksit commented Feb 18, 2019

Is there any resolution of this as just come up against it? I realiase I can turn off formatting but would prefer not to.

@eduarguz
Copy link

I am having the same issue here...
How happens that the live demo works with "4111 1111 1111 1111", but when I try the same (and other visa cards) the input allows us to keep entering more numbers? that is weird :/

Demo
https://codesandbox.io/embed/wz609mw258

Try with "4111 1111 1111 1111" and keep adding 1's

Is there a way to prevent further chars in our end?

@f1729
Copy link

f1729 commented Jul 2, 2019

@eduarguz I have exactly the same problem, I have not been able to solve it, the strange thing is that in the web demo of the library the error is not, maybe the demo has another version?

@polpenaloza
Copy link

polpenaloza commented Jul 4, 2019

I think the issue is here:
https://github.com/jondavidjohn/payform/blob/master/src/payform.coffee#L124
I reverted back to version v1.2.5. before it was length: [13, 16], not sure why they added 19 to the combo. Is there a way to instruct the library to use just the first 2?

@f1729
Copy link

f1729 commented Jul 10, 2019

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

6 participants