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

Add support to abort hosted fields initialization #614

Open
serhiistotskyi opened this issue Feb 7, 2022 · 1 comment
Open

Add support to abort hosted fields initialization #614

serhiistotskyi opened this issue Feb 7, 2022 · 1 comment

Comments

@serhiistotskyi
Copy link

General information

  • SDK version: 3.85.0
  • Environment: any
  • Browser and OS: any

Issue description

I'm showing bank card form in modal window and lazily load braintree hosted fields script when user opens a modal (showing loading wheel). Sometimes, user may decide to not wait and close modal after braintree.hostedFields.create() call but before it was resolved, as a result I get HOSTED_FIELDS_TIMEOUT error.

Desired solution

Provide a way to abort hostedFields.create() initialization.

Workaround

I can catch an error in component and in case it's destroyed, I can ignore HOSTED_FIELDS_TIMEOUT error.

@jplukarski
Copy link
Contributor

Hello, @serhiistotskyi, thanks for the suggestion. We'll mark this report as an enhancement to consider adding this feature to Hosted Fields, though we can't guarantee that this will be implemented at this moment.

As an additional workaround, you can consider not allowing your customer to close the modal before Hosted Fields reports that it is ready. In this case, you could use a deferred client to render Hosted Fields faster.

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

2 participants