Programmatically Register Multiple Domains for Apple Pay
Deprecated
This component is deprecated. See below for guidance about what to use instead.
Note
The Square payment form is deprecated and replaced by the Web Payments SDK.
You should use the Web Payments SDK to take payments on a web client. The Web Payments SDK uses modern web styling as shown in the following image:
Enable Apple Pay in multiple domains by registering domains programmatically with Square.
Before you start
You have integrated the payment form into your web application.
Programmatically register multiple domains
You can use the RegisterDomain endpoint to activate multiple domains and subdomains.
Bulk registering domains can save you time if you are using SqPaymentForm
as part of a platform where payments are processed on multiple subdomains. For
example, you might be building a shop platform (platform.com), where sellers can create their own shops and take payments (shoes.platform.com and
plants.platform.com). All these individual subdomains need to be registered
to enable Web Apple Pay with Square.
To programmatically register a client domain:
Download Square's copy of Apple's merchant domain verification file.
Host the verification file at:
https://{CLIENT DOMAIN}/.well-known/apple-developer-merchantid-domain-association
.Use the RegisterDomain endpoint of the Square Apple Pay API to register and validate the domain.
The following example registers example.com
:
The response JSON:
If you need more assistance, contact Developer Support or ask for help in the Developer Forums.