Apple Pay is the faster, more secure way to pay online using cards saved on your customer’s Apple device.
We support Apple Pay out of the box in Embed with minimal configuration.
Embed requires minimal configuration to get set up to process Apple Pay. Unlike some other integrations it does not require you to sign up for an Apple Pay Developer account.
To enable Apple Pay, head over to your dashboard and then go to Connections -> Catalog -> Apple Pay.
Next, complete and submit the form to create a new Apple Pay service.
To process Apple Pay via the web you will need to register all the domains where the buyer can checkout. In order to do this, navigate to your Apple Pay service via the dashboard, Connections -> Apple Pay -> Domains -> Add domain name.
Domain Association File
Before submitting a domain name, please download the Domain Association File from the dashboard and upload it to every domain you wish to support.
The file needs to be added to every domain in a predefined location.
This file is checked by Apple in the production environment to verify that you have granted us permission to perform Apple Pay transactions on your dashboard.
Apple has an extensive guide on sandbox testing.
Apple Pay requires a sandbox Sandbox Tester account to be able to test transactions in our sandbox. Sandbox Testers can add fake test cards to their account that can then be used in Apple Pay. When a Sandbox Tester account is used in production, Apple Pay may fail for various reasons. Similarly, when a regular Apple account is configured on a Mac or iPhone, Apple Pay may fail to load the payment sheet. This may result in the Apple Pay UI quickly appearing and then disappearing.
A sandbox tester account can be set up in the User and Access section of a Apple Developer account. If you do not have an Apple Developer account please contact support and they can set you up with a Sandbox Tester account under our Apple Developer account.
To set up an account we need the following details.
Once set up, a sandbox tester account can be added to a Mac or iPhone.
Sign in to iCloud with the sandbox tester on macOS (or iOS). You will need to sign out of your existing iCloud account and sign in specifically with the sandbox account. This will allow you to register the sandbox cards in the Apple Wallet.
On a Mac, it helps to create a second user account so that you don't need to log out of your own iCloud account every time you need to test Apple Pay. One caveat is that only 1 Apple account per Mac can be used to store cards in the vault, so you'd not be able to use Apple Pay in your own account.
Next, add a test card from the Apple Pay docs. On a Mac this can be done by going to System Preferences -> Wallet & Apple Pay -> Add card.
To make an Apple Pay sandbox transaction the following are required.
For a currency that has a card processor that supports Apple Pay, you should see the payment option in your app. Select Apple Pay and continue with the payment. You should see the Apple Pay sheet appear.
To make an Apple Pay transaction in production replace the Sandbox Tester account with a regular Apple account with real cards.
Users can shop with Apple Pay on devices other than Macs and in third-party browsers. Embed supports this feature by automatically injecting the Apple Pay JS SDK when needed and offering the Apple Pay option in such scenarios if the feature is supported. On submit, a popup will display asking users to scan a code with their iOS 18+ device and complete the payment there.
Embed will attempt cross-browser Apple Pay under certain conditions only.
window.ApplePaySession
is not already defined. This property is typically already defined in Safari browsers on a Mac, or when the Apple Pay JS SDK is already loaded directly outside of Embed.Embed will log some information about the Apple Pay JS SDK status when loaded in debug
mode. For example, when the SDK is loaded correctly:
You can optimize loading times by adding the script yourself to the head section of your site:
Content Security Policy
Make sure to allow the Apple Pay JS SDK domain in your CSP if you're using one, otherwise the script won't load and Embed won't show the Apple Pay option in third-party browsers:
Please see the Pay with Apple Pay in third-party browsers documentation for more information.
Apple Pay option is not shown
There could be many reasons why this doesn't show.
Apple Pay payment failed
There could be a few reasons why this doesn't show but most likely this means the card was sent to a connector that either doesn't understand Apple Pay cards, or did not recognize the test card.
Error when adding test card to wallet
This seems to happen at times with the test cards provided by Apple. Try a different card, or try again later.
Apple Pay sheet opens and immediately closes
When using a real card in a sandbox environment, Apple Pay will fail to initialize. This will result in the Apple Pay UI quickly appearing and then disappearing.
The reason for this happening is that the validation URL generated by Apple Pay will be rejected by
our POST /digital-wallets/apple/session
endpoint. Please only use test cards in the sandbox
environment.