payform
payform copied to clipboard
Problem with Visa cards?
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.
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?
I tried several numbers. But you should be able to see this using 4111111111111111. I've taken three screen shots:
- This is the 4111... number entered. You can see all the digits and the validation doesn't work.
- This is the 4111... number after I tab out of the field. Notice that it lost the last 1.
- 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!
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!
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.
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!
Is there any resolution of this as just come up against it? I realiase I can turn off formatting but would prefer not to.
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?
@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?
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?
@polpenaloza apparently now visa supports 19 characters, https://www.nccgroup.trust/uk/about-us/newsroom-and-events/blogs/2016/november/prepare-for-19-digit-credit-cards/