Hi I'm trying to test applepay on localhost but get the following error
InvalidAccessError: Trying to start an Apple Pay session from an insecure document
How should I solve this issue ?
Asked
Active
Viewed 1,757 times
1

Sunstrike527
- 515
- 1
- 4
- 17
2 Answers
2
No, it doesn't appear that Apple Pay can be tested from localhost because the domain name needs to be registered and Apple servers need to be able to communicate to it.

Mohammad Dohadwala
- 666
- 5
- 17
0
The domain (web site) must be registered with Apple, but once this is done you can run the application locally exposing an HTTPS URL, for example using ngrok
$ ngrok HTTP 8080
Forwarding https://43e9-24-132-87-22.ngrok.io -> http://localhost:8080
Use https://43e9-24-132-87-22.ngrok.io
to access the local application and initiate the ApplePay session.

Beppe C
- 11,256
- 2
- 19
- 41