Search code examples
javascriptiframesubdomainapplepay

Trying to start an Apple Pay session from a document with an different security origin than its top-level frame


Problem:

I have ApplePay on my website (https://www.example.com/order), it works and successefull pay.

Now I try to integrate IFrame (src="https://www.example.com/order") in subdomain (https://sub.example.com) with form, which contains apple pay and get an error

Trying to start an Apple Pay session from a document with an different security origin than its top-level frame

Both sites used Https.

Main domain (with and without www) and subdomain verified in apple developer account.


Solution

  • You can't use Frames with Apple Pay as it is considered bad practice