question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

hosted fields card number formatting - android

See original GitHub issue

I have noticed an issue with the card number formatting in hosted fields on android devices.

If using the standard Google keyboard, auto formatting works fine, but other 3rd party keyboards can result in validation errors. I am using sdk v3.6.0.

For example, using the latest version of Chrome (54.0.2840.85) and the TouchPal keyboard, using the minimal example here: http://codepen.io/braintree/full/EKJVXp/

  • Enter the card number 3530111333300000
  • Note that spaces are not added automatically and the user can’t progress to the next step as validation is failing
  • Press delete (backspace), and the auto formatting suddenly activates, but it deletes every 5th character and the last two, resulting in: 3530 1133 3000
  • The card number will not pass validation unless the user adds the spaces manually

I have observed this behaviour with the following android keyboards (not an exhaustive list):

  • TouchPal
  • Samsung
  • Sony Xperia (pressing delete does not activate auto formatting)

It looks like it is possibly related to this bug: https://bugs.chromium.org/p/chromium/issues/detail?id=118639

I think its fine if auto formatting doesn’t work with certain keyboards, but the following two issues result in a very frustrating customer experience:

  • Auto formatting deletes characters from the card number if it activates late
  • Card number validation requires spaces if auto formatting is active

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:4
  • Comments:32 (10 by maintainers)

github_iconTop GitHub Comments

2reactions
crookedneighborcommented, Dec 13, 2016

@stefanaerts We’ve just finished the work to fix this and are planning on releasing it today. We’ll update here when it’s out.

1reaction
pdg137commented, Dec 14, 2016

Yes, it’s a Motorola Nexus 6. “About Chrome” shows Android 7.0.0; Nexus 6 Build/NBD91J. Chrome 55.0.2883.91. The keyboard is “Swype + Dragon” 2.2.3.2020310.45082, “Midnight” theme; switching back to the default (?) “Material Dark” theme does not change it.

Here’s a recording:

ezgif com-optimize

Read more comments on GitHub >

github_iconTop Results From Across the Web

braintree-web/hosted-fields - Documentation - Braintree Open Source
An object that has field objects for each field. Used in create. Properties: Name, Type, Attributes, Description. number, field ...
Read more >
Braintree hosted fields integration - edit existing card data
I want users to be able to edit the expiration date and CVV to keep the card active. Is this possible, or does...
Read more >
Hosted Fields: Card Form - CodePen
Add animations on Braintree Hosted Fields events -->. 2. ​. 3. <!-- Some test Card numbers. 4. 4111 1111 1111 1111: Visa. 5....
Read more >
Optimize your app for autofill - Android Developers
Set up the autofill environment · Configure an autofill service · Provide hints for autofill · Include predefined hint constants · Mark fields...
Read more >
Hosted iFrame Tokenizer - Developer Center
Controls the text inside the label for the card number field. This label is only present when either useexpiry or usecvv are true....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found