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.
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-associationApple 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.
This is the same registration that lets Checkout run on your site. Once your domain is registered, ClientLoop also registers it for Apple Pay on your account automatically.
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.