Apple Pay for Web

Configure Apple Pay into your website to accept payments in Safari and supported third-party browsers on Apple devices.

The following sections explain how to configure Apple Pay on your website.

Prerequisites

Make sure you have the following before you configure Apple Pay and start accepting payments on your website:

circle-exclamation

Supported Payment Methods

circle-exclamation

Supported Cards

Merchant Capabilities

Unsupported Payment Methods

  • In-App payments

  • Recurring payments

  • Split shipment

  • Voids/Refunds through Apple Pay

Getting Started

Xplor Pay manages the Merchant Validationarrow-up-right process for you by creating an Apple Merchant ID and CSR. For more information, see Apple Developer Documentationarrow-up-right.

Registering a Domain using Merchant Portal

To register a domain:

  1. Select Virtual Terminal > VT Settings > Apple Pay for Web.

  2. Download the registration file.

  3. Host the downloaded file on your website to complete the registration.

Registering a Domain using Apple Pay for Web endpoint

To register a domain:

  1. Use the POST method with Apple Pay for Web APIarrow-up-right endpoint to register the domain or domains you’ll use with Apple Pay.

  2. Host the verification file provided by Xplor Pay to you on the following URL, replacing [DOMAIN_NAME] with your domain name.

URL: https://[DOMAIN_NAME]/.well-known/apple-developer-merchantid-domain-association

circle-exclamation

Verifying your domain with Apple

To verify your domain with Apple:

  1. Send a notification to Xplor Pay to request domain verification with Apple after hosting the file at the appropriate URL.

  2. You will receive confirmation after successful domain verification with Apple from Xplor Pay.

Configuring Apple Pay for Web

To configure Apple Pay into your website:

  1. Add the JavaScriptSDK.init method to allow Apple Pay.

The following table describes the fields in the JavaScriptSDK.init method:

Name
Data type
Required?
Description

pk

String

Required

Your public API key issued by Xplor Pay to authenticate the SDK.

enableApplePay

Boolean

Required

Enables Apple Pay functionality when you set it to true.

  1. Add the applePayRequest object to the JavaScriptSDK.init method.

The following table describes the fields in the applePayRequest object:

Name
Data type
Required?
Description

applePayRequest.total

String

Required

Defines the total transaction amount and merchant label that appear in the Apple Pay sheet.

total.label

String

Required

The merchant’s name displayed to customers in the Apple Pay sheet. For example, Bob’s Canoes.

total.amount

String

Required

The total transaction amount to be charged. For example, 50.25

total.type

String

Required

Indicates the type of transaction amount. Use final for a fixed total.

circle-info

See the Apple Pay on the Web Demoarrow-up-right for additional objects you can use in your Apple Pay payment sheet.

Processing payments with Apple Pay

The JavaScript SDK handles Apple Pay token and convert it into the mobile JSON Web Token (JWT).

To process the payment with Apple Pay:

  1. Add the ClearentTokenSuccess and ClearentTokenError functions to your integration to receive feedback containing the mobile JSON Web Token (JWT) for processing payments.

circle-exclamation
  1. Use HTTPSarrow-up-right methods to send the mobile payment APIarrow-up-right requests using the mobile JSON Web Token (JWT) from your server.

circle-exclamation
triangle-exclamation

Testing Apple Pay for Web

Test Apple Pay transactions offline on your website using Apple’s sandbox testingarrow-up-right guide.

Last updated

Was this helpful?