Accept recurring payments with Apple Pay
Subscription payment is a recurring automatic payment solution that enables merchants to collect payments periodically. With a one-time authorization, buyers can link their payment accounts to enjoy continuous subscription services, while supporting dynamic adjustments to subscription configurations (such as modifying cycle/amount, canceling renewal, or terminating services, etc.). The entire process is both efficient and secure.
This document provides integration instructions for Apple Pay. Through the Apple Pay service, buyers can make payments using credit or debit cards stored in their Apple accounts. With Antom Payment Element, you do not need to integrate the Apple Pay SDK separately. Payment Element will automatically load Apple Pay for you and can be configured to support Apple Pay as an express payment method.
Web/WAP
User experience
The following figures demonstrate the user experience of paying with Apple Pay:
Integration preparations
- Antom provides pre-configured Apple Pay merchant certification for quick integration. Refer to Apple Pay domain name configuration for detailed steps.
- Before you start integrating, read Integration guide and API overview to understand the integration steps of the server-side API and the precautions for calling the API. Furthermore, ensure the following prerequisites are met:
- Obtained your client ID
- Complete the key configuration
- Complete the configuration of paymentNotifyUrl to receive the asynchronous notification
- Integrate the server-side SDK package, install the server-side library, and initialize a request instance. For more details, refer to Server-side SDKs.
- Integrate the client-side SDK package by following the steps detailed in Integrate the SDK package for Web/WAP, and to use the latest SDK version or no lower than 1.46.0.
Integration steps
Start your integration by taking the following steps:
- Create a payment session
- Invoke Payment Element
- Obtain the authorization result
- Capture
- Obtain subscription notifications
Step 1: Create a payment session Server-side
Call the createPaymentSession (One-time Payments) API with order information to create a payment session and obtain the paymentSessionData required to invoke Payment Element. You can choose to either render Apple Pay by specifying it yourself or use the Payment Element-rendered payment method list.
Merchant-rendered Apple Pay
If you render Apple Pay independently, it is recommended to call the createPaymentSession (One-time Payments) API after the buyer selects the payment method and submits payment. Follow Step 1: Create a payment session to create the session. You must pass in all parameters listed in the parameter table, along with the following additional parameters:
Parameter name | Required | Description |
availablePaymentMethod.paymentMethodMetaData.applePayConfiguration | No | Apple Pay payment preference configuration. In Payment Element scenario, it is recommended to leave it empty or use the default value. |
availablePaymentMethod.paymentMethodTypeList.paymentMethodType | No | Used to specify payment methods:
|
Payment Element-rendered payment method list
If you use Payment Element-rendered payment method list, it is recommended to call the createPaymentSession (One-time Payments) API when loading the checkout page. Follow Step 1: Create a payment session to create the session. You only need to pass in the basic parameters listed in the parameter table.
Step 2: Invoke Payment Element Client-side
Follow Step 2: Invoke Payment Element to use paymentSessionData to invoke Payment Element on your client. After the buyer clicks to submit payment, Payment Element will handle the entire flow based on the selected payment method, including displaying QR codes, redirecting to payment pages, performing 3DS authentication, and returning to the merchant’s result page.
Step 3: Obtain the authorization result Server-side
After the buyer completes the authorized payment or the payment times out, you can obtain the authorization result either by receiving asynchronous notifications from Antom or by proactively querying the result. For detailed steps, refer to Obtain the authorization or payment result.
Step 4: Capture Server-side
Antom provides both automatic and manual capture methods. You can choose based on your business needs. After initiating capture, you can obtain the result via asynchronous notification or active inquiry. You need to decide whether to ship goods based on the capture result. For specific operations, refer to Capture.
Step 5: Obtain subscription notifications Server-side
After the subscription relationship takes effect, Antom will send you the initial subscription notification and subscription renewal notifications. Refer to Step 5: Obtain subscription notifications to obtain the relevant notifications.
iOS
User experience
The following figures demonstrate the user experience of paying with Apple Pay:
Integration preparations
Before you start integrating, read Integration guide and API overview to understand the integration steps of the server-side API and the precautions for calling the API. Furthermore, ensure the following prerequisites are met:
- Obtained your client ID
- Complete the key configuration
- Complete the configuration of paymentNotifyUrl to receive the asynchronous notification
- Integrate the server-side SDK package, install the server-side library, and initialize a request instance. For more details, refer to Server-side SDKs.
- Integrate the client-side SDK package by following the steps detailed in Integrate the SDK package for iOS, and ensure to use the latest SDK version or no lower than 1.46.0.
Integration steps
Start your integration by taking the following steps:
- (Optional) Preload the SDK
- Create a payment session
- Invoke Payment Element
- Obtain the authorization result
- Capture
- Obtain subscription notifications
(Optional) Step 1: Preload the SDK Client-side
Before creating a payment session, it is highly recommended that you preload the SDK to improve the rendering speed of the checkout page, reducing the waiting time for buyers during the payment. Follow the code example below to perform the preloading:
[AMSPaymentElement.shared preload];Step 2: Create a payment session Server-side
Call the createPaymentSession (One-time Payments) API with order information to create a payment session and obtain the paymentSessionData required to invoke Payment Element. You can choose to either render Apple Pay by specifying it yourself or use the Payment Element-rendered payment method list.
Merchant-rendered Apple Pay
If you render Apple Pay independently, it is recommended to call the createPaymentSession (One-time Payments) API after the buyer selects the payment method and submits payment. Follow Step 2: Create a payment session to create the session. You must pass in all parameters listed in the parameter table, along with the following additional parameters:
Parameter name | Required | Description |
availablePaymentMethod.paymentMethodMetaData.applePayConfiguration | No | Apple Pay payment preference configuration. In Payment Element scenario, it is recommended to leave it empty or use the default value. |
availablePaymentMethod.paymentMethodTypeList.paymentMethodType | No | Used to specify payment methods:
|
availablePaymentMethod.paymentMethodTypeList.expressCheckout | No | Specifies whether to enable the express checkout option for Apple Pay. Valid values are: Note:This parameter is currently supported only on iOS. |
Payment Element-rendered payment method list
If you use Payment Element-rendered payment method list, it is recommended to call the createPaymentSession (One-time Payments) API when loading the checkout page. Follow Step 2: Create a payment session to create the session. You only need to pass in the basic parameters listed in the parameter table.
Step 3: Invoke Payment Element Client-side
Follow Step 3: Invoke Payment Element to use paymentSessionData to invoke Payment Element on your client. After the buyer clicks to submit payment, Payment Element will handle the entire flow based on the selected payment method, including displaying QR codes, redirecting to payment pages, performing 3DS authentication, and returning to the merchant’s result page.
Step 4: Obtain the authorization result Server-side
After the buyer completes the authorized payment or the payment times out, you can obtain the authorization result either by receiving asynchronous notifications from Antom or by proactively querying the result. For detailed steps, refer to Obtain the authorization or payment result.
Step 5: Capture Server-side
Antom provides both automatic and manual capture methods. You can choose based on your business needs. After initiating capture, you can obtain the result via asynchronous notification or active inquiry. You need to decide whether to ship goods based on the capture result. For specific operations, refer to Capture.
Step 6: Obtain subscription notifications Server-side
After the subscription relationship takes effect, Antom will send you the initial subscription notification and subscription renewal notifications. Refer to Step 6: Obtain subscription notifications to obtain the relevant notifications.
After subscription
After completing the subscription, you can perform the following actions:
Inquire subscription information Server-side
After your subscription is confirmed, you can query the following subscription information:
- Query subscription list: You can query a list of subscriptions that match specific filter conditions through the inquireSubscriptionList API.
- Query subscription details: You can call the inquireSubscription API with subscriptionId to get the details information of each subscription.
- Query subscription transactions: You can call the inquireSubscriptionPayment API with subscriptionId to retrieve a list of payments for a subscription.
Subscription trial Server-side
Antom provides a subscription trial feature that allows buyers to experience a product or service for a limited time at no cost or at a discounted rate before officially purchasing a subscription plan. For more details, refer to Subscription trial.
Subscription cancellation Server-side
The subscription cancellation feature allows buyers to cancel their current subscription at any time when they no longer need to use the associated service. For more details, refer to Subscription cancellation.
Cancellation Server-side
For successful payments, if the buyer requests cancellation or a refund on the same day, you can use Antom’s cancellation capability to cancel the order or release funds. Orders not yet completed can also be cancelled directly. For details, refer to Cancel.
Refund Server-side
For successfully paid orders, if you need to issue a refund to the buyer, Antom provides two methods:
- Your operations staff can manually process refunds directly through Antom Dashboard.
- Call the refund API to initiate a refund.
Antom’s refund capabilities are as follows:
- Supports full refunds.
- Supports multiple partial refunds, with the total refunded amount not exceeding the captured amount.
Dispute Server-side
Antom provides dispute resolution services for contested transactions. For more information, refer to Dispute Guidance.
Reconciliation Server-side
After the transaction is completed, use the financial reports provided by Antom for reconciliation. For more information on how to reconcile and the settlement rules of Antom, please refer to Reconciliation.
Additional content
Antom also offers the following customization options:
- Specify payment methods: You can use API parameters to define which payment methods are displayed in Payment Element, control the order of the payment method list, and configure the display of express payment options.
- Payment method features: Learn about the characteristics of APM and card payments.
- Appearance customization: Antom provides extensive styling options, including theme, layout, and CSS customization.
Best practice
Card payment features also apply to Apple Pay. The following table outlines the support status of these features for Apple Pay:
Type | Supported | Conditions |
| Antom Tokenization | Conditional |
|
| COF | Conditional | Only supported in MIT (Merchant-Initiated Transaction) scenarios. |
| 3D Secure 2 | Yes | After completing 3D Secure 2 authentication, Apple Pay passes the encrypted transaction cryptogram and ECI (E-Commerce Indicator) to Antom. Antom processes this authentication data following standard third-party card network procedures. For details, refer to Apple Developer: Payment token format reference. As a result, no additional 3DS authentication flow will be triggered by the payment method within Payment Element, ensuring a seamless user experience. It is recommended to use the default values for the is3DSAuthentication and enableAuthenticationUpgrade parameters when initiating payment requests. |
| Antom 3DS-Retry | Yes | None |
| MIT | Yes | None |
| Installment payments | No | None |