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

fix: call config.onError if present if isReadyToPay throws #73

Merged
merged 2 commits into from Feb 17, 2021

Conversation

axelniklasson
Copy link
Contributor

Currently if the isReadyToPay throws when setting up the Google Pay button, the onError callback is not called and the error is printed out in console through console.error instead. This PR adds support for triggering the onError callback if present and otherwise fallback to the existing behaviour.

@socsieng
Copy link
Collaborator

Thanks for the PR. Can you include repro steps you used to trigger the error?

@axelniklasson
Copy link
Contributor Author

Sure!

  1. Serve any page embedding the React button locally over an insecure context (such as your local IP)
  2. When rendering it crashes and the error message DEVELOPER_ERROR in isReadyToPay: Google Pay APIs should be called in secure context! is printed in the console
  3. The onError callback of the React component is not triggered

@socsieng socsieng merged commit 63fee4f into google-pay:main Feb 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants