Skip to content
This repository has been archived by the owner on Jan 10, 2018. It is now read-only.

Integrate changes from Stripe Checkout #102

Merged
merged 8 commits into from
Jul 17, 2014
Merged

Conversation

jamesreggio
Copy link
Contributor

This PR fixes some bugs we've found while using jquery.payment in Stripe Checkout.

Specifically, it addresses problems with:

  • extra spaces appearing when typing an AMEX credit card
  • incorrect values returned from $.payment.formatCardNumber
  • incorrect formatting and caret placement on Android devices
  • incorrect handling of backspace on expiry fields
  • incorrect formatting after autofill

The changes in 273d79a are a bit risky, so it would be great to get some validation that they work as expected on Android and all other platforms. These changes supersede the work done in #99, which was great, but didn't fix the caret positioning problem on Android Firefox.

This PR is likely to address or supersede the following issues: #46 #56 #60 #75 #77 #94 #96 #97

Some mobile devices only emit an `input` event, and others will emit both
`input` and `key*` events. This change addresses both cases:

* For those that only support `input`, the `reFormat*` functions will
  update the element with the proper value on the next tick.
* For those that support both, the `key*` defaults will be prevented and
  the element will be updated with the proper value on the next tick.
  Attempting to do both in the same tick results in incorrect cursor
  positioning.
@jamesreggio
Copy link
Contributor Author

Review? @metcalf @michaelvillar

@jamesreggio
Copy link
Contributor Author

Also addresses #11 #24.

@jamesreggio
Copy link
Contributor Author

Supersedes #43, though not perfectly.

@jamesreggio
Copy link
Contributor Author

Also #56. Phew.

@jamesreggio
Copy link
Contributor Author

Or maybe you could review, @SlexAxton, since you're technically to blame for nearly everything in this repo :P

@metcalf
Copy link

metcalf commented Jul 17, 2014

This looks good to me.

Sorry for the belated review!

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

Successfully merging this pull request may close these issues.

None yet

3 participants