Tutorial
Setting Up Apple Pay with Braintree
With the Braintree Drop-In gateway, members using Safari on an iPhone, iPad or Mac can pay with Apple Pay. You switch Apple Pay on in Braintree and add one file to MemberGate. MemberGate then serves that file and registers your website addresses with Braintree for you.
Before you start
- Your site must be connected to Braintree Drop-In on Payments > Payment Gateway, with your Merchant ID, Public Key, Private Key and Tokenization Key entered.
- Apple Pay must be available on your Braintree account. It is in most countries. If you can't find the Apple Pay setting in Step 1, contact Braintree support.
Switch on Apple Pay in Braintree
- Log in to your Braintree Control Panel.
- Click the gear icon at the top right and choose Account Settings. On some accounts this is Processing.
- Scroll to Payment Methods and switch on Apple Pay.
Add the domain association file (live accounts only)
Apple confirms that your website belongs to your Braintree account by reading a small file from your site. A Braintree sandbox (test) account doesn't need it, so skip to Step 3 if you are testing.
- In the Braintree Control Panel, open Apple Pay (click Options beside Apple Pay under Payment Methods).
- Click Add Domain Name. Braintree offers the domain association file for download. Download it, but you don't need to type your domain here, because MemberGate adds it for you.
- In MemberGate go to Payments > Wallet Setup.
- Under Apple Pay Domain Association File, either:
- choose the downloaded file in Upload the File, or
- open the file in a text editor such as Notepad, copy everything, and paste it into Or Paste its Contents.
- Click Save File and Register Domains.
MemberGate puts the file at https://www.yoursite.com/.well-known/apple-developer-merchantid-domain-association, where Apple expects it. The page then shows Served beside each of your addresses once the file can be read from it.
Register your domains
MemberGate registers both versions of your address with Braintree, for example www.yoursite.com and yoursite.com. This happens automatically when you:
- save the file in Step 2,
- click Update Payment Gateway Settings on the Payment Gateway page, or
- click Register Domains and Re-Check on the Wallet Setup page.
The Apple Pay column of the Wallet Status table then shows Ready. The domains also appear in the Apple Pay section of your Braintree Control Panel.
Set your store name and switch Apple Pay on in MemberGate
- Go to Payments > Payment Gateway.
- Under Wallet Gateway Settings, tick ApplePay.
- Enter a Store Name. Members see this on the Apple Pay payment sheet, so use your site or business name.
- Click Update Payment Gateway Settings.
Test it
- Apple Pay only appears in Safari on an iPhone, iPad or Mac with a card in Apple Wallet.
- To test on a Braintree sandbox account, Apple requires a sandbox tester account, created in an Apple Developer account, signed in on the test device.
- On a live account, a real Apple Pay payment is a real charge. Test with a low-priced item and refund it afterwards.
Troubleshooting
- Apple Pay shows "Off at Gateway"
- Apple Pay isn't switched on in the Braintree Control Panel. Do Step 1, then click Refresh Status on the Wallet Setup page.
- "The domain association file has not been added"
- Do Step 2. Live Braintree accounts need the file before a domain can be registered.
- The file shows "Not Served" with a message about a redirect
- Apple doesn't follow redirects. If your web host sends the address without www straight to the www version, Apple can't verify it. Checkout always runs on your main address, so Apple Pay still works there. You only need to act if your main address shows Not Served.
- The file shows "The file served does not match the one added here"
- Something else on your server is answering for /.well-known. Ask your web host to check. The file saved in MemberGate is the correct one.
- "/.well-known already has a web.config that MemberGate did not write"
- Another tool, often an SSL certificate tool, uses that folder. MemberGate leaves its settings alone. Ask your web host to make that folder serve files without an extension as application/octet-stream.
- Braintree refuses to register a domain
- The reason from Braintree is shown under the domain on the Wallet Setup page. Most often the file wasn't reachable when Braintree checked. Once it shows Served, click Register Domains and Re-Check.