Friday, 18 August 2017

payment-api.js:101 Uncaught DOMException: Failed to construct 'PaymentRequest': Must be in a secure context

payment-api.js:101 Uncaught DOMException: Failed to construct 'PaymentRequest': Must be in a secure context

If you see above error, you must doing Android Pay on web.

https://www.w3.org/TR/2016/WD-payment-request-20160421/

Above link explained the expection. it is a "secure context" error.

What is "secure context" error?

https://www.w3.org/TR/secure-contexts/

localhost is secure context. https is secure context.

which means you can only test your Android Pay web app with localhost, or on a https domain.




No comments:

Post a comment