google-pay / google-pay-button

Google Pay button - React, Angular, and custom element
Apache License 2.0
250 stars 60 forks source link

safari browser couldn't load the script 'https://pay.google.com/gp/p/js/pay.js' #211

Closed MudFahmi closed 1 year ago

MudFahmi commented 1 year ago

Describe the bug safari browser couldn't load the script 'https://pay.google.com/gp/p/js/pay.js'

To Reproduce Steps to reproduce the behavior:

  1. See error

Expected behavior Browser should load the script and show the google pay button

Screenshots image

Component information:

Environment:

dmengelt commented 1 year ago

Hi @MudFahmi I'm unable to reproduce this error on https://google-pay-react.stackblitz.io

Screenshot 2023-03-13 at 09 33 24
MudFahmi commented 1 year ago

it take much time to load sometimes and failed at least image and sometimes failed directly without loading image

and this happens with me when using safari only, it's working fine when use chrome

dmengelt commented 1 year ago

@MudFahmi Thank you. Unfortunately I'm not able to reproduce this. As a mitigation, you might consider implementing the onError callback: https://github.com/google-pay/google-pay-button/blob/812855408177dfa7a022849566bdd298ed477231/examples/react/src/examples/OnErrorExample.tsx#L61-L67

Like this you can hide the button in those cases.