# Accept recurring payments with Google Pay

> Learn how to accept recurring payments with Google Pay through Antom Payment Element.

 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 the [Google Pay](https://docs.antom.com/ac/antomop/googlepay.md) payment method. Through the [Google Pay](https://docs.antom.com/ac/antomop/googlepay.md) service, buyers can make payments using credit or debit cards stored in their Google accounts. With Antom Payment Element, you do not need to integrate the [Google Pay](https://docs.antom.com/ac/antomop/googlepay.md) SDK separately. Payment Element will automatically load [Google Pay](https://docs.antom.com/ac/antomop/googlepay.md) for you and can be configured to support [Google Pay](https://docs.antom.com/ac/antomop/googlepay.md) as an express payment method.

  

<!-- ToggleTab query="platform" -->

**Tab: Web/WAP**

# User experience {#BEWwv}

 The following figures demonstrate the user experience of paying with [Google Pay](https://docs.antom.com/ac/antomop/googlepay.md):

 ![Google Pay first-time subscription payment flow using Antom Payment Element on Web/WAP](https://idocs-assets.marmot-cloud.com/storage/idocs87c36dc8dac653c1/yuque/idocs/2026/png/2646dab5-7a27-4fb6-836a-81348b755611.png)

# Integration preparations {#f3oDm}

 1. Before using Payment Element, you must complete the onboarding and publishing process in the   [Google Pay Merchant Console](https://pay.google.com/business/console?utm_source=devsite&utm_medium=devsite&utm_campaign=devsite)  :

   1. Register an account and provide your business information as guided on the page. Your Google Pay ID is located in the upper-right corner of the console.  ![Step 1 used for merchant onboarding and configuration](https://idocs-assets.marmot-cloud.com/storage/idocs87c36dc8dac653c1/yuque/idocs/2025/png/35e5a7a4-c7b4-4c06-8e79-f9c9a32d3c01.png)

  2. Complete the [Google Pay](https://docs.antom.com/ac/antomop/googlepay.md) configuration as instructed:  ![Complete the Google Pay configuration as instructed](https://idocs-assets.marmot-cloud.com/storage/idocs87c36dc8dac653c1/yuque/idocs/2025/png/87a5f6d6-eec2-4f68-8718-d5e2987607c8.png)

  3. Configure domain allowlists: To ensure payment security, you must authorize your business domain(s). In the console, navigate to     **Business Profile**     >     **[Google Pay](https://docs.antom.com/ac/antomop/googlepay.md) API**    . Under the     **Integrate with your website**     section, click     **\+ Add website**     to include all official domains of your website.  ![Screenshot of Google Pay Merchant Console domain allowlist configuration](https://idocs-assets.marmot-cloud.com/storage/idocs87c36dc8dac653c1/yuque/idocs/2025/png/ebd9d943-3d21-4427-883d-5460b659e94c.png)

   > **[INFO]** **Note**    : Web Element is implemented using [Google Pay](https://docs.antom.com/ac/antomop/googlepay.md)’s JavaScript library and cannot be used directly within a WebView in mobile applications. The payment page must be opened in a mobile browser.

 2. Before you start integrating, read   [Integration guide](https://docs.antom.com/integration_guide_en.md)   and   [API overview](https://docs.antom.com/ac/ams/api_fund.md)   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](https://docs.antom.com/ac/sdks/server_sdks.md)  .
  - Integrate the client-side SDK package by following the steps detailed in   [Integrate the SDK package for Web/WAP](https://docs.antom.com/ac/sdks/web.md)  , and ensure to use the latest SDK version or no lower than 1.46.0.

# Integration steps {#fpHZX}

 Start your integration by taking the following steps:

 1. Create a payment session
2. Invoke Payment Element
3. Obtain the authorization result
4. Capture
5. Obtain subscription notifications

## Step 1: Create a payment session  **[Server-side]** {#chKYz}

 Call the      [**createPaymentSession (One-time Payments)**](https://docs.antom.com/ac/ams/session_cashier.md)      API with order information to create a payment session and obtain the     *paymentSessionData*     required to invoke Payment Element. You can choose to either render [Google Pay](https://docs.antom.com/ac/antomop/googlepay.md) by specifying it yourself or use the Payment Element-rendered payment method list.

<!-- TabGroup -->

**Tab: Merchant-rendered Google Pay**

If you render [Google Pay](https://docs.antom.com/ac/antomop/googlepay.md) independently, it is recommended to call the   [**createPaymentSession (One-time Payments)**](https://docs.antom.com/ac/ams/session_cashier.md)   API after the buyer selects the payment method and submits payment. Follow   [Step 1: Create a payment session](https://docs.antom.com/ac/subscriptionpay/element_subscription.md?platform=web-wap#KuWal)   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.googlePayConfiguration.configuration.merchantId* | Yes | Pass in your Google Pay ID that has been registered and activated on the Google side. |
| *availablePaymentMethod.paymentMethodTypeList.paymentMethodType* | No | Used to specify payment methods: - For [Google Pay](https://docs.antom.com/ac/antomop/googlepay.md), pass in   `GOOGLEPAY`  . - To specify multiple payment methods, refer to   [Enumeration values of payment methods](https://docs.antom.com/ac/pm/enumeration_values.md)   for valid values. |

**Tab: 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)**](https://docs.antom.com/ac/ams/session_cashier.md)   API when loading the checkout page. Follow   [Step 1: Create a payment session](https://docs.antom.com/ac/subscriptionpay/element_subscription.md?platform=web-wap#KuWal)   to create the session. You only need to pass in the basic parameters listed in the parameter table.

<!-- /TabGroup -->

## Step 2: Invoke Payment Element   **[Client-side]** {#k8HAI}

 Follow   [Step 2: Invoke Payment Element](https://docs.antom.com/ac/subscriptionpay/element_subscription.md?platform=web-wap#FWfpW)   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]** {#cUyeS}

 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](https://docs.antom.com/ac/subscriptionpay/element_subscription.md?platform=web-wap#MxqX3)  .

## Step 4: Capture   **[Server-side]** {#qu0V5}

 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. For specific operations, refer to   [Capture](https://docs.antom.com/ac/cashierpay/capture.md)  .

## Step 5: Obtain subscription notifications   **[Server-side]** {#aJOH3}

 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](https://docs.antom.com/ac/subscriptionpay/element_subscription.md?platform=web-wap#AQnvC)  to obtain the relevant notifications.

**Tab: Android**

# User experience {#B2EWwv}

 The following figures demonstrate the user experience of paying with [Google Pay](https://docs.antom.com/ac/antomop/googlepay.md):

 ![Google Pay first-time subscription payment flow using Antom Payment Element for android terminal](https://idocs-assets.marmot-cloud.com/storage/idocs87c36dc8dac653c1/yuque/idocs/2026/png/9d80831b-cf56-4cb9-b0ee-80b963939d93.png)

# Integration preparations {#q7nN1}

 1. Before using Payment Element, you must complete the onboarding and publishing process in the   [Google Pay Merchant Console](https://pay.google.com/business/console?utm_source=devsite&utm_medium=devsite&utm_campaign=devsite)  :

   1. Register an account and provide your business information as guided on the page. Your Google Pay ID is located in the upper-right corner of the console.  ![Step 1 used for merchant onboarding and configuration](https://idocs-assets.marmot-cloud.com/storage/idocs87c36dc8dac653c1/yuque/idocs/2025/png/35e5a7a4-c7b4-4c06-8e79-f9c9a32d3c01.png)
  2. Complete the [Google Pay](https://docs.antom.com/ac/antomop/googlepay.md) configuration as instructed:  ![Complete the Google Pay configuration as instructed](https://idocs-assets.marmot-cloud.com/storage/idocs87c36dc8dac653c1/yuque/idocs/2025/png/87a5f6d6-eec2-4f68-8718-d5e2987607c8.png)
  3. Publish the application to   [Google Play](https://developers.google.com/pay/api/android/guides/test-and-deploy/deploy-your-application?hl=zh-cn#launching-your-app-on-the-play-store)   according to   [Google Pay's requirements](https://developer.android.com/distribute/console)  .

 2. Before you start integrating, read   [Integration guide](https://docs.antom.com/integration_guide_en.md)   and   [API overview](https://docs.antom.com/ac/ams/api_fund.md)   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](https://docs.antom.com/ac/sdks/server_sdks.md)  .
  - Integrate the client-side SDK package by following the steps detailed in   [Integrate the SDK package for Android](https://docs.antom.com/ac/sdks/android.md)  . Ensure to use the latest SDK version or no lower than 1.46.0, and use target API level 24 or later.

   - Integrate the Antom [Google Pay](https://docs.antom.com/ac/antomop/googlepay.md) plugin:

     - Add the Maven dependency to your     *build.gradle*     file using the following code:

 ```gradle
dependencies {
    implementation 'com.alipay.antom.sdk:plugin-googlepay:1.0.0'
}
```

     - (Optional) If your project has not integrated the official [Google Pay](https://docs.antom.com/ac/antomop/googlepay.md) SDK, add the following additional dependency:

 ```gradle
dependencies {
    // 18.1.3 is an example version number. Select the appropriate version based on your actual requirements
    implementation 'com.google.android.gms:play-services-wallet:18.1.3'
}
```

# Integration steps {#n1t0Y}

 Start your integration by taking the following steps:

 1. (Optional) Preload the SDK
2. Create a payment session
3. Invoke Payment Element
4. Obtain the authorization result
5. Capture
6. Obtain subscription notifications

## (Optional) Step 1: Preload the SDK   **[Client-side]** {#f4eFC}

 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:

 ```java
 AMSPaymentElement.preload(getApplicationContext());
```

## Step 2: Create a payment session   **[Server-side]** {#22hKYz}

 Call the      [**createPaymentSession (One-time Payments)**](https://docs.antom.com/ac/ams/session_cashier.md)      API with order information to create a payment session and obtain the     *paymentSessionData*     required to invoke Payment Element. You can choose to either render [Google Pay](https://docs.antom.com/ac/antomop/googlepay.md) by specifying it yourself or use the Payment Element-rendered payment method list.

<!-- TabGroup -->

**Tab: Merchant-rendered Google Pay**

If you render [Google Pay](https://docs.antom.com/ac/antomop/googlepay.md) independently, it is recommended to call the   [**createPaymentSession (One-time Payments)**](https://docs.antom.com/ac/ams/session_cashier.md)   API after the buyer selects the payment method and submits payment. Follow   [Step 2: Create a payment session](https://docs.antom.com/ac/subscriptionpay/element_subscription.md?platform=android#K3uWal)   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.googlePayConfiguration.configuration.merchantId* | Yes | Pass in your Google Pay ID that has been registered and activated on the Google side. |
| *availablePaymentMethod.paymentMethodTypeList.paymentMethodType* | No | Used to specify payment methods: - For [Google Pay](https://docs.antom.com/ac/antomop/googlepay.md), pass in   `GOOGLEPAY`  . - To specify multiple payment methods, refer to   [Enumeration values of payment methods](https://docs.antom.com/ac/pm/enumeration_values.md)   for valid values. |
| *availablePaymentMethod.paymentMethodTypeList.expressCheckout* | No | Specifies whether to enable the express checkout option for [Google Pay](https://docs.antom.com/ac/antomop/googlepay.md). Valid values are: - `true`  : Enables express checkout for [Google Pay](https://docs.antom.com/ac/antomop/googlepay.md). - `false`  : Disables express checkout for [Google Pay](https://docs.antom.com/ac/antomop/googlepay.md).   > **[INFO]** **Note**    : This parameter is currently supported only on Android. |

**Tab: 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)**](https://docs.antom.com/ac/ams/session_cashier.md)   API when loading the checkout page. Follow   [Step 2: Create a payment session](https://docs.antom.com/ac/subscriptionpay/element_subscription.md?platform=android#K3uWal)   to create the session. You only need to pass in the basic parameters listed in the parameter table.

<!-- /TabGroup -->

## Step 3: Invoke Payment Element   **[Client-side]** {#FW22fpW}

 Follow   [Step 3: Invoke Payment Element](https://docs.antom.com/ac/subscriptionpay/element_subscription.md?platform=android#F3fpW)   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]** {#zBUox}

 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](https://docs.antom.com/ac/subscriptionpay/element_subscription.md?platform=android#3xqX3)  .

## Step 5: Capture   **[Server-side]** {#OwRWT}

 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. For specific operations, refer to   [Capture](https://docs.antom.com/ac/cashierpay/capture.md)  .

## Step 6: Obtain subscription notifications   **[Server-side]** {#a2JOH3}

 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](https://docs.antom.com/ac/subscriptionpay/element_subscription.md?platform=android#A3nvC)  to obtain the relevant notifications.

<!-- /ToggleTab -->

# After subscription {#BJbEu}

 After completing the payment, you can perform the following actions:

## Subscription trial    **[Server-side]** {#Rue5J}

 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](https://docs.antom.com/ac/subscriptionpay/subscription_trial.md)  .

## Subscription cancellation    **[Server-side]** {#jcX2m}

 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](https://docs.antom.com/ac/subscriptionpay/subscription_cancellation.md)  .

## Cancellation    **[Server-side]** {#Otb6j}

 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](https://docs.antom.com/ac/cashierpay/cancel.md)  .

## Refund    **[Server-side]** {#kg4oU}

 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](https://dashboard.alipay.com/)  .
- Call the   [**refund**](https://docs.antom.com/ac/ams/refund_online.md)   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.

 Refer to   [Refund](https://docs.antom.com/ac/cashierpay/refund.md)   to learn about Antom refund rules and operation process.

## Dispute    **[Server-side]** {#AoEw6}

 Antom provides dispute resolution services for contested transactions. For more information, refer to   [Dispute Guidance](https://docs.antom.com/ac/dispute/overview.md)  .

## Reconciliation      **[Server-side]** {#Ftc87}

 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](https://docs.antom.com/ac/cashierpay/reconcile.md)  .

# Additional content {#GBkuL}

 Antom also offers the following customization options:

 - [**Specify payment methods**](https://docs.antom.com/ac/subscriptionpay/element_subscription.md#L9xOX)  : 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**](https://docs.antom.com/ac/subscriptionpay/element_subscription.md#RvQap)  : Learn about the characteristics of APM and card payments.

 - [**Appearance customization**](https://docs.antom.com/ac/cashierpay/appearance.md)  : Antom provides extensive styling options, including theme, layout, and CSS customization.

# Best practice {#jeYPR}

 Card payment features also apply to [Google Pay](https://docs.antom.com/ac/antomop/googlepay.md). The following table outlines the support status of these features for [Google Pay](https://docs.antom.com/ac/antomop/googlepay.md):

 | **Type** | **Supported** | **Conditions** |
| --- | --- | --- |
| [**Antom Tokenization**](https://docs.antom.com/ac/pm/tokenization.md) | Conditional | - ​   Not supported in CIT (Cardholder-Initiated Transaction) scenarios. It is recommended to store cards via Google accounts. - Supported in MIT (Merchant-Initiated Transaction) scenarios. |
| [**COF**](https://docs.antom.com/ac/pm/cof.md) | Yes | None |
| [**3D Secure 2**](https://docs.antom.com/ac/pm/3ds.md) | Yes | - If you set the     *paymentMethodMetaData.googlePayConfiguration.allowedAuthMethods*     parameter to   `CRYPTOGRAM_3DS`   (or use the default value), and 3DS authentication has already been completed on the [Google Pay](https://docs.antom.com/ac/antomop/googlepay.md) side, Antom will follow the standard third-party 3DS processing flow. As a result, no additional 3DS experience will be triggered by the payment method within the Payment Element. For details, refer to   [Google Pay - Enabling liability shift for eligible Visa device token transactions globally](https://developers.googleblog.com/en/google-pay-enabling-liability-shift-for-eligible-visa-device-token-transactions-globally/)  . - If you set the     *paymentMethodMetaData.googlePayConfiguration.allowedAuthMethods*     parameter to both   `CRYPTOGRAM_3DS`   and   `PAN_ONLY`   (or use the default value), and 3DS authentication has not been completed on the [Google Pay](https://docs.antom.com/ac/antomop/googlepay.md) side, Payment Element will determine whether 3DS authentication is required based on the values you provide for the     *is3DSAuthentication*     and     *enableAuthenticationUpgrade*     parameters. |
| [**Antom 3DS-Retry**](https://docs.antom.com/ac/pm/3ds_retry.md) | Yes | None |
| [**MIT**](https://docs.antom.com/ac/pm/mit.md) | Yes | None |
| [**Installment payments**](https://docs.antom.com/ac/pm/installment.md) | No | None |