stripe-archive / jquery.payment

[DEPRECATED] A general purpose library for building credit card forms, validating inputs and formatting numbers.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bug in card number formatting

tipsy opened this issue · comments

commented

In the card number field, enter
4444, then left, then 1234.
Expected: 44441234
Actual: 44442341

I haven't looked at your implementation, so I'm not sure if this is useful information, but when I was emulating the behavior of your plugin I fixed this bug by increasing the caret position by 1 if it was currently at an index which should be a whitespace.

Thanks for reporting. Confirmed that this is an issue.

Apparently this bug was fixed, but the jquery.payment version didn't changed?

@optimizamx Still looks like an issue to me.

@jenanwise you are correct!

We were using the jquery.payment version that comes with the latest Woocommerce version (2.5.2) and it had the exact same problem, and then we replaced it with this version and now what it does is this:

4444, then left, then 1234
Expected: 44441234
Actual: 44413424

Hi,

We are experiencing similar issues... during testing of card payments we have encountered the following:

  1. Enter card number: 5569 5100 0000 3698, with other card details
  2. Submit, expecting LUHN check failure
  3. Edit card number to valid number 5569 5112 3456 3698

Issue arises when editing the card number and deleting the invalid digits 000000. Whilst typing 123456, formatter seems to shift the cursor back after entering no. 3 in the above combination.

This results in having the following credit card number

5569 5112 4563 3698, which fails LUHN check

Any idea when/if this is going to be fixed?

Should be fixed in master. I'll try and cut a release later this week.