Apple Pay on Your Website
When you embed the Checkout component on your own website, Apple Pay only appears there once Apple has verified your domain. Apple does this by fetching a small file from your site, so there are two things to set up: serve that file, and register your domain with ClientLoop.
Nothing is needed for payments taken on ClientLoop's hosted checkout page; it is already set up. Apple Pay must also be enabled for your organization — contact ClientLoop if it is not.
Apple Pay is not offered when Checkout runs inside an iframe on another domain, such as a GoHighLevel invoice. Safari validates Apple Pay against the domain of the page the shopper is on, and that domain belongs to the site embedding the iframe, so it cannot be registered. Shoppers there can still pay with the checkout's other methods.
1. Serve the domain association file
Apple fetches this exact path on your domain:
https://YOUR-DOMAIN/.well-known/apple-developer-merchantid-domain-associationServe ClientLoop's copy of the file there, unchanged. Download it from:
https://checkout.clientloop.com/.well-known/apple-developer-merchantid-domain-association
Apple only accepts the file if it is served:
- at exactly that path, with no file extension on the name;
- with the header
Content-Type: text/plain; - over HTTPS, to anyone, with no login, password or IP restriction;
- directly, with no redirect.
Serve it on every domain where Checkout appears, including each subdomain:
shop.example.com and www.shop.example.com are separate domains to Apple.
The file has no extension, so many web servers and storage buckets send it with
the wrong content type. Set the header explicitly — for example, as a route in
your application that returns the file's contents with text/plain. Check it
with:
curl -i https://YOUR-DOMAIN/.well-known/apple-developer-merchantid-domain-associationThe response should be 200, with content-type: text/plain, and a body
identical to ClientLoop's copy.
2. Register your domain in the portal
In the ClientLoop portal, open Developers → Manage origins for your
organization and add your site's origin: https:// followed by the domain, with
no path — for example https://shop.example.com. Select Use for Apple Pay
before saving.
This is the same registration that lets Checkout run on your site. With Use for Apple Pay selected, ClientLoop fetches the domain association file from your origin when you save, and refuses the origin if the file is missing or differs from ClientLoop's copy — so serve the file first. Once the origin is saved, ClientLoop registers it for Apple Pay on your account. An origin saved without the option is not registered for Apple Pay.
The option only appears once Apple Pay is enabled for your organization. To use an origin you already added for Apple Pay, remove it and add it again with the option selected.
Register a public domain name. Apple Pay cannot run on localhost, so it cannot
be tried from a local development server.
Removing a domain
Removing an origin from Manage origins stops Checkout from running on that site, but does not remove the domain from Apple Pay. If you need it removed there too, contact ClientLoop.
Testing
Apple Pay appears for shoppers using Safari on an Apple device with a card in Apple Wallet. In other browsers it shows a code to scan with an iPhone, which completes the payment on the phone.
In a test environment, Apple Pay needs an Apple Sandbox tester account and Apple's test cards; a real card in a real Apple Wallet is refused. See Testing for ClientLoop's test environment.