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

Automatic spacing in credit card number field (Hosted Fields) #77

Closed
sethcall opened this issue Sep 25, 2015 · 13 comments
Closed

Automatic spacing in credit card number field (Hosted Fields) #77

sethcall opened this issue Sep 25, 2015 · 13 comments

Comments

@sethcall
Copy link

Many websites now automatically space between every 4 numbers of the credit card field. This is a huge usability improvement, but the number field in the Hosted Fields iframe does not work this way, and AFAIK, does not support it.

It'd be great if this were supported!

@sethcall sethcall changed the title Automatic spacing i credit card number field (Hosted Fields) Automatic spacing in credit card number field (Hosted Fields) Sep 25, 2015
@mrak
Copy link
Contributor

mrak commented Sep 25, 2015

We agree that this is a great feature!

For most cases, card numbers are either 16 digits split into 4 groups of 4 or it is an Amex card with a 4-6-5 structure.

There are other processors and international cards issuers who do not follow this pattern. To prevent an inconsistent and potentially confusing UX for our international merchants and users we decided to leave card formatting out of hosted-fields.

We may revisit this decision in the future, but at the current time there are no plans.

@marascio
Copy link

+1 for card formatting. Hosted fields promise SAQ-A without sacrificing user experience. This seems like a pretty big sacrifice.

@RikdeBoer
Copy link

I would also love to see this feature. The v.zero drop-in has it. Why can Hosted Fields not have it?

@mrak, re: "To prevent an inconsistent and potentially confusing UX for our international merchants and users we decided to leave card formatting out of hosted-fields."

Does that not apply to the v.zero drop-in also?

@mrak
Copy link
Contributor

mrak commented Sep 26, 2015

@RikdeBoer you are correct, it would have perhaps applied to drop-in had it been developed now.

Drop-in was initially released before we had a large international audience and before we supported many of the cards and issuers that were giving us formatting trouble with hosted-fields.

You will also notice that drop-in does not currently support internationalizations with the interface :(

As a result, for many of our merchants and users drop-in gives a good UX with formatting; but we have open tickets and support issues around drop-in with improperly handling and formatting certain card types.

We honestly do want to give you back your UX options with solutions like hosted-fields and make drop-in more international friendly, but we are a small front-end team working hard on many things.

@mrak mrak added the Custom label Sep 28, 2015
@RikdeBoer
Copy link

No worries. I understand @mrak. Thank you for your explanation.

@raliste
Copy link

raliste commented Jan 18, 2016

Any updates?

@EvanHahn
Copy link

In short, this is on our roadmap.

This is actually a ​_super_​ tricky problem, but one that we are investing time to work on. Browsers handle user input events inconsistently and there are numerous edge cases to consider. There are a few libraries out there that provide input formatting (Formatter.js and jquery.inputmask, to name two) but they don't fit our use case for various reasons.

We really want to do this right and don't want to give you a half-baked version; we want to engineer this the right way. Not to make any promises, but this is something that we're working on. We will let you know as soon as we make headway.

@sethcall
Copy link
Author

Why not leverage Stripe's code where possible?

https://github.com/stripe/jquery.payment/blob/master/lib/jquery.payment.js

The license is very open: https://github.com/stripe/jquery.payment/blob/master/LICENSE

And they handle all sorts of cards and credit card lengths (it's not hardcoded to '16 digits').

@adstrakt
Copy link

We have this issue as well on a ecoommerce site and it causing sales to be lost clients have complained they can put the date on credit card. Is there a workaround or when is a fix going to be released?

@lilaconlee
Copy link

@adstakt Input formatting is something we're actively working on adding to Hosted Fields. We'll update you here when it's released.

@adstrakt
Copy link

Hope it can be released soon. Thank you.

@zhuk-aa
Copy link

zhuk-aa commented Mar 23, 2016

+1

@mrak
Copy link
Contributor

mrak commented May 25, 2016

We've released a beta of our next major version. This includes field formatting for things like expiration dates and credit card numbers.

Here are some links to our official documentation:

Setup for v3
Migrating from v2 to v3
Hosted Fields v3 demo with field formatting

Please send us any feedback on this new feature to js-sdk-beta@braintreepayments.com

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

9 participants