w3c / payment-request

Payment Request API
https://www.w3.org/TR/payment-request/
Other
489 stars 135 forks source link

PaymentRequest constructor throws in Safari but not Chrome on localhost #867

Closed adrianhopebailie closed 5 years ago

adrianhopebailie commented 5 years ago

When creating a new PaymentRequest in Safari the constructor throws with an ApplePay specific error.

This is in contrast to Chrome which allows the use of PR API on localhost.

ianbjacobs commented 5 years ago

cc @aestes

rsolomakhin commented 5 years ago

What's the error message? If it's localhost-related, perhaps Safari has a flag that allows development on that platform?

marcoscaceres commented 5 years ago

Maybe has something to do with WebKit’s definition of “secure context”. But I’m not sure? Was there some error message?

adrianhopebailie commented 5 years ago

code: 18 message: Trying to start an Apple Pay session from an insecure document.

rsolomakhin commented 5 years ago

By the way, you can use https://ngrok.com/ for testing on localhost but with HTTPS.

adrianhopebailie commented 5 years ago

By the way, you can use ngrok.com for testing on localhost but with HTTPS

Yeh, have also used localtunnel but meh... localhost is just so EASY

marcoscaceres commented 5 years ago

SoOOooo... I'm going to close this as this is not really a spec bug.