Can apple pay be tested on localhost?

I'm integrating apple pay on a site, everything seems to be ok, I get the merchantSession, but then after passing the merchant session to session.completeMerchantValidation the payment sheet shows "Payment not completed" - I read somewhere that this might be due to running it locally and not on the verified domain. Even if I'm using a sandbox account, do I have to run this on an verified domain? and is it possible to somehow make localhost as a verified domain?


cheers

HI!


Did you get anywhere with this? I'm currently in the same situation.


Without being able to run locally the development cycle would be terribly ineffective.


Kind regards

Henrik

Are there any news?
I want to test Apple Pay from my local system too but the domain verification makes it impossible.

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.


I am experiencing same issue discussed in this thread and the accepted answer confirms it doesn't work from localhost but does work when running from a verified domain: https://forums.developer.apple.com/thread/52809

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.

At least for SANDBOX testing this appears to be incorrect, at least according to their docs, here , which state:

Apple Pay servers don’t require domain verification in the sandbox environment. You receive domain-verfication files for merchant IDs that have access to production servers only.

That said, I still cant get it to work on localhost, and I can't get it to work when running locally and using a hosts entry to point mytestdomain.com at 127.0.0.1

Hello, after some tests I was able to test it locally using a Self Signed Certificate and serving my local App as https.

Can apple pay be tested on localhost?
 
 
Q