Apple Pay for Web
Last updated
Was this helpful?
Last updated
Was this helpful?
Apple Pay for Web lets you accept payments from customers using the Safari browser on their iOS devices.
The following sections explain how to integrate Apple pay on your website.
Make sure the following requirements are met before integrating Apple Pay and accepting payments on your website:
A MacBook running macOS 10.12.1 or later
An iPhone running iOS 10.1 or later
Safari browser
A server that supports Apple Pay
An application served over HTTPS in both development and production environments
A valid SSL-certified domain
A server that supports Transport Layer Security (TLS) version 1.2 or later
Always implement manual card entry in the JavaScript SDK as a fallback option.
You can collect the payment and address information of your customers who use Apply Pay.
Supported Cards
Visa
MasterCard
American Express
Discover
Merchant Capabilities
Credit cards (Visa or Mastercard)
Debit cards (Visa or Mastercard)
In-App Payments
Recurring Payments
Split Shipment
Voids/Refunds through Apple Pay
To register and verify your domain with Apple:
Provide your domain(s) that will be used for Apple Pay.
Host the verification file provided by Clearent to you on the following URL, replacing [DOMAIN_NAME] with your domain name.
URL: https://[DOMAIN_NAME]/.well-known/apple-developer-merchantid-domain-association
This URL must be publicly accessible to allow Apple to verify the file.
Send the hosted file with the appropriate URL to register and verify your domain with Apple.
Clearent will confirm once your domain is successfully verified.
Create a container on your website to add the Apple Pay button with the default style.
To request button type for your website:
Add the function to check whether your customer uses Apple Pay. This function helps you decide whether to display the Apple Pay button in the customer’s browser.
To configure the onClick event for your payment process:
Add the onClick
object into your payment sheet to start the Apple Pay session.
The JavaScript SDK handles the Apple Pay token and converts it into a JSON Web Token (JWT).
Send the JSON Web Token (JWT) to your server using a secure connection.
Provide the secret API key to Clearent from your server.
Don’t expose the secret API key in your website code.
Clearent returns a successful token response.
Send the token response to the JavaScript SDK for handling.
Apple requires an offline test implementation of Apple Pay for apps, websites, and point-of-sale systems.
You can calculate final transaction cost using customer’s payment method, billing address, shipping address, and shipping method:
Refer the following example to implement the optional handlers in your payment sheet:
Example:
Clearent handles the process for you by creating an Apple Merchant ID and Certificate Signing Request. For more information, see .
Apple provides several types of buttons so that you can choose the button type that fits best with the terminology and flow of your purchase or payment experience. For more information on Apple Styling Guidelines, see .
Before moving to the next step, ensure you have integrated with JavaScript SDK to avoid an error. For more information, see .
You can test your Apple Pay transaction using the reference.
If you want to calculate the final transaction cost using payment method, add the optional handler in your payment sheet.
If you want to calculate the final transaction cost using shipping method, add the optional handler in your payment sheet.
If you want to calculate the final transaction cost using billing address and shipping address, add the optional handler in your payment sheet.
You can add the optional handler, which triggers when the customer clicks the Cancel button, to cancel the Apple Pay session.