1

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 ?

Sunstrike527
  • 515
  • 1
  • 4
  • 17

2 Answers2

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.

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