tnguyen14 / web-payments-example

Demo for Payment Request API and Apple Pay for the Web API
https://lab.tridnguyen.com/web-payments-example
34 stars 10 forks source link

Apple Pay buttons should not be rendered unless supported #4

Closed martincostello closed 6 years ago

martincostello commented 7 years ago

Viewing the deployed application in Chrome on Windows 10 shows lots of empty black buttons.

The Apple Pay buttons should only be rendered if the browser supports ApplePaySession.

tnguyen14 commented 7 years ago

I kinda did this on purpose to verify the behavior on unsupported browsers. In a production environment, I would expect the button to not show.

However, for now, a browser would only support either the Payment Request API or Apple Pay JS, but not both (i.e. until Safari supports Payment Request API as well). So if you feel strongly about this change, let me know and I can update it.