# Accept recurring payments with Google Pay

> Learn how to accept recurring payments with Google Pay through API-only subscription integration.

 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 the credit or debit cards stored in their [Google Pay](https://docs.antom.com/ac/antomop/googlepay.md) accounts. When using the Native API method, the merchant frontend needs to directly integrate the [Google Pay](https://docs.antom.com/ac/antomop/googlepay.md) SDK. After obtaining the card asset information, call Antom’s   [**pay (One-time Payments)**](https://docs.antom.com/ac/ams/payment_cashier.md)        API to initiate payment. For details on integrating the [Google Pay](https://docs.antom.com/ac/antomop/googlepay.md) SDK, refer to   [Google Pay for Payments (Web)](https://developers.google.com/pay/api/web/guides/tutorial)   or   [Google Pay for Payments (Android)](https://developers.google.com/pay/api/android/overview)  .

## **User experience** {#esj7b}

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

<!-- TabGroup -->

**Tab: Web**

![Google Pay subscription payment flow via API-only integration on Web](https://idocs-assets.marmot-cloud.com/storage/idocs87c36dc8dac653c1/yuque/idocs/2025/png/c9b01442-e37c-4b37-8206-923ed35659bc.png)

**Tab: Mobile**

![Google Pay subscription payment flow via API-only integration on mobile](https://idocs-assets.marmot-cloud.com/storage/idocs87c36dc8dac653c1/yuque/idocs/2026/png/9a110fdc-b454-4cb0-955b-7e9de84e3511.png)

<!-- /TabGroup -->

## Payment flow {#utRz1}

 You can choose one of the following two decryption methods to decrypt the obtained _paymentToken_, and the corresponding payment processes differ.

 - Hosted    decryption: Antom manages certificates and performs decryption on your behalf, so you do not need to be PCI-qualified.
- Merchant    decryption: You manage your own certificates and perform decryption operations yourself, and this mode requires that you are PCI-qualified.

 > **[INFO]** **Note**    :    For more information about PCI DSS compliance requirements, see   [PCI DSS standard](https://www.pcisecuritystandards.org/)  .

 The following illustrates the payment flow of accepting recurring payments with [Google Pay](https://docs.antom.com/ac/antomop/googlepay.md):

<!-- TabGroup -->

**Tab: Hosted decryption**

<!-- TabGroup -->

**Tab: First-time subscription**

The following illustrates the payment flow for the initial subscription payment process using Antom-decrypted _paymentToken_   ：

 ![Sequence diagram of Google Pay first-time subscription with Antom-hosted decryption](https://idocs-assets.marmot-cloud.com/storage/idocs87c36dc8dac653c1/yuque/idocs/2026/png/7208c04c-3528-4193-996c-1a04fd2d16be.png)

**Tab: Subsequent deductions**

The following illustrates the payment flow for the subsequent periodic deductions process using Antom-decrypted _paymentToken_   ：

 ![Sequence diagram of Google Pay subsequent recurring deductions with Antom-hosted decryption](https://idocs-assets.marmot-cloud.com/storage/idocs87c36dc8dac653c1/yuque/idocs/2026/png/bb32b6a3-086c-43ce-b66a-adcd8f5de666.png)

<!-- /TabGroup -->

## Integration preparations {#uyRz1}

 Before you start integrating, read the   [Integration guide](https://docs.antom.com/integration_guide_en.md)   and   [API Overview](https://docs.antom.com/ac/ams/api_fund.md)   documents to understand the integration steps of the server-side API and the precautions for calling the API. Furthermore, ensure that the following prerequisites are met:

 - Obtain a 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)  .

## Integration Steps {#ILjTF}

 Follow these steps to start the integration:

 1. Obtain     *paymentToken*
2. Create a subscription payment request
3. (Optional) Redirect to the 3DS authentication page
4. Obtain the authorization result
5. Capture and recieve the capture notification
6. Recieve subscription notifications

### Step 1: Obtain _paymentToken_ {#UaYc2}

 After you obtain     *paymentToken*    , you can choose the Antom-hosted decryption method to decrypt the token and call the   [**pay (One-time Payments)**](https://docs.antom.com/ac/ams/payment_cashier.md)         API to initiate an authorized payment request.

### Step 2: Create a subscription payment request   **[Server-side]** {#UaYcL}

 After you integrate the [Google Pay](https://docs.antom.com/ac/antomop/googlepay.md) SDK, use Antom's configuration in [Google Pay](https://docs.antom.com/ac/antomop/googlepay.md) to interact.
   Below is the acquirer information of Antom for [Google Pay](https://docs.antom.com/ac/antomop/googlepay.md):

 | **Parameter** | **Description** |
| --- | --- |
| *gateway* | The value is   `alipayintl`  . |
| *gatewayMerchantId* | The     *merchantId*     for merchant onboarding in Antom. |

 The following is a sample code of the interaction:

 ```java
const tokenizationSpecification = {
    type: 'PAYMENT_GATEWAY',
    parameters: {
    'gateway': "alipayintl",
    'gatewayMerchantId': "2188XXXXXXXX"//The merchant id for merchant onboarding in the Antom (PROD/SANDBOX) environment.
    }
};
```

 ```java
private static JSONObject getGatewayTokenizationSpecification() throws JSONException {
return new JSONObject() {{
    put("type", "PAYMENT_GATEWAY");
    put("parameters", new JSONObject() {{
        put("gateway", "alipayintl");
        put("gatewayMerchantId", "2188XXXXXXXX"); //商户在 Antom 入驻相应环境（PROD/SANBOX）的 merchant id
    }});
}};
}
```

 After you obtain     *paymentToken*     and have Antom decrypt it, initiate the payment using Antom’s card authorization payment capability. You can pass the decrypted     *paymentToken*     through the     *paymentMethod.paymentMethodMetaData.googlePayConfiguration*     parameter in the   [**pay (One-time Payments)**](https://docs.antom.com/ac/ams/payment_cashier.md)        API   .

 Follow   [Step 2: Create a subscription payment request](https://docs.antom.com/ac/subscriptionpay/cardinfocallmerchant_subscription.md#d1yRJ)   to call the   [**pay (One-time Payments)**](https://docs.antom.com/ac/ams/payment_cashier.md)   API and submit the payment request. You need to pass in the basic parameters, order parameters, and device parameters in the payment request. While you do not need to pass in card payment parameters, you need to pass in the following parameters:

 | **Parameter name** | **Required** | **Description** |
| --- | --- | --- |
| *paymentMethod.paymentMethodType* | Yes | Payment method enumeration values. For [Google Pay](https://docs.antom.com/ac/antomop/googlepay.md), pass in `GOOGLEPAY` when Antom hosts the decryption on your behalf. |
| *paymentMethod.paymentMethodMetaData.googlePayConfiguration.googlePayToken* | Yes | Pass in     *paymentToken*     you obtained. |
| *paymentMethod.paymentMethodMetaData.is3DSAuthentication* | Yes | In the [Google Pay](https://docs.antom.com/ac/antomop/googlepay.md) payment scenario, when Antom hosts the decryption of the     *paymentToken*     on your behalf, you must set this parameter's value to  `true`  to initiate a 3DS transaction for buyer authentication. > **[INFO]** **Note:**     If the information decrypted by Antom from the     *paymentToken*     is a DPAN, the process will automatically proceed to authorization, bypassing secondary buyer authentication. |

 For more information about the parameters used to initiate an authorized payment, refer to   [Step 2: Create a subscription payment request](https://docs.antom.com/ac/subscriptionpay/cardinfocallmerchant_subscription.md#d1yRJ)  .

 The following sample code shows how to call the        [**pay (One-time Payments)**](https://docs.antom.com/ac/ams/payment_cashier.md)   API:

 ```java
public static void payByGooglePayServer2Server() {
    AlipayPayRequest alipayPayRequest = new AlipayPayRequest();
    alipayPayRequest.setProductCode(ProductCodeType.CASHIER_PAYMENT);

    // Replace with your paymentRequestId
    String paymentRequestId = UUID.randomUUID().toString();
    alipayPayRequest.setPaymentRequestId(paymentRequestId);

    // Set subscription information
    SubscriptionInfo subscriptionInfo = new SubscriptionInfo();
    subscriptionInfo.setSubscriptionDescription("Subscription test");
    LocalDateTime localNow = LocalDateTime.now();
    OffsetDateTime offsetDateTime = localNow.atOffset(ZoneOffset.of("+08:00"));
    String startTime = offsetDateTime.format(DateTimeFormatter.ISO_OFFSET_DATE_TIME);
    subscriptionInfo.setSubscriptionStartTime(startTime);

    subscriptionInfo.setSubscriptionNotifyUrl("https://www.yourDomain.com/subscription/notify");
    PeriodRule periodRule = new PeriodRule();
    periodRule.setPeriodType("MONTH");
    periodRule.setPeriodCount(1);
    subscriptionInfo.setPeriodRule(periodRule);
    alipayPayRequest.setSubscriptionInfo(subscriptionInfo);

    // Set payment amount
    Amount amount = Amount.builder().currency("SGD").value("4200").build();
    alipayPayRequest.setPaymentAmount(amount);

    // Set settlement strategy
    SettlementStrategy settlementStrategy = SettlementStrategy.builder().settlementCurrency("SGD").build();
    alipayPayRequest.setSettlementStrategy(settlementStrategy);

    // Set payment method
    PaymentMethod paymentMethod = PaymentMethod.builder().paymentMethodType("GOOGLEPAY").build();
    alipayPayRequest.setPaymentMethod(paymentMethod);

    // Set Google Pay related parameters -- delegated decryption
    Map<String, String> googlePayToken = new HashMap<>();
    googlePayToken.put("googlePayToken", "googlePay token");
    Map<String, Object> paymentMethodMetaData = new HashMap<>();
    paymentMethodMetaData.put("googlePayConfiguration", googlePayToken);
    paymentMethodMetaData.put("is3DSAuthentication", false);
    paymentMethod.setPaymentMethodMetaData(paymentMethodMetaData);

    // Replace with your orderId
    String orderId = UUID.randomUUID().toString();

    // Set buyer information
    Buyer buyer = Buyer.builder().referenceBuyerId("yourBuyerId").build();

    // Set order information
    Order order = Order.builder().referenceOrderId(orderId)
    .orderDescription("antom testing order").orderAmount(amount).buyer(buyer).build();
    alipayPayRequest.setOrder(order);

    // Set environment information
    Env env = Env.builder().terminalType(TerminalType.WEB).clientIp("1.2.3.4").build();
    alipayPayRequest.setEnv(env);

    // Set authorization capture mode
    PaymentFactor paymentFactor = PaymentFactor.builder().isAuthorization(true).build();
    alipayPayRequest.setPaymentFactor(paymentFactor);

    // Replace with your notification URL
    alipayPayRequest.setPaymentNotifyUrl("https://www.yourNotifyUrl.com");

    // Replace with your redirect URL
    alipayPayRequest.setPaymentRedirectUrl("https://www.yourMerchantWeb.com");

    // Pay
    AlipayPayResponse alipayPayResponse = null;
    try {
        alipayPayResponse = CLIENT.execute(alipayPayRequest);
    } catch (AlipayApiException e) {
        String errorMsg = e.getMessage();
        // Handle error case
    }
}
```

 The following shows the sample code of a request:

 ```json
{
    "env": {
        "clientIp": "1.2.3.4",
        "terminalType": "WEB"
    },
    "order": {
        "buyer": {
            "referenceBuyerId": "yourBuyerId"
        },
        "orderAmount": {
            "currency": "SGD",
            "value": "4200"
        },
        "orderDescription": "antom testing order",
        "referenceOrderId": "2a7772b2-4eae-43cf-8f1a-07c8dec3739f"
    },
    "paymentAmount": {
        "currency": "SGD",
        "value": "4200"
    },
    "paymentFactor": {
        "isAuthorization": true
    },
    "paymentMethod": {
        "paymentMethodMetaData": {
            "is3DSAuthentication": true,
            "googlePayConfiguration": {
                "googlePayToken": "{\"signature\":"MEQCIB1/pqJy8Z7565NKYN8Mx+Rl57M0xVPOKAnuLdSpm/RaAiAH8t+q+aJA9KAOXXnyFVU13qJ2J4Uuhu2iggNd6hgJnw\u003d\u003d","intermediateSigningKey":{"signedKey":"{\"keyValue\":\"MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEKWkTmXgqxeLpsCa4POKjunH+b4aIdKOr37TJAn1a0x8gduKJy8UJSCoDUqqKASHYmQoWA8TDr+Gq0Ie8pA9LoA\\u003d\\u003d\",\"keyExpiration\":\"1774047508238\"}","signatures":["MEUCIQDa+BMhD7nmJq2xaf6uJnV+2fx8B4s1XGaJXF/zG4w9pQIgIdDlhrBarzgbuWSmYpiemS92jy9zxK3UJguJsfaPWrQ\u003d"]},"protocolVersion":"ECv2","signedMessage":"{\"encryptedMessage\":\"DMJ8HqrPreS67BYJseOLUlox42ZFpgmbv/wU5a1JMS0KdawwC7JmDrvm57Ysot3VxmG0jZwVd54Ru78Z22j5lGd8W145sgI30gIWgRHT1ru9yt/lTdLuJExNeNUGGjrSUPBHinGy4sOILFWGRilNtuQaftt0NHnuPEEUUb1GdN/8+J5RNxNLXFI7AFlaC5tCrDshLsh3K1pzLSVK024B5Q+LbZxaWeiOygZ7OJqWzpFuUg6i2GOdXEOW8hrNv2dUHa7Jn07+G2xVa++5YT8dMpbOQ+bUn6MiH95+k3Ppl8ipFx2e2KKhMH8VoF5vRQIppCrCrJm6f/IRoZwh7x4785d73oLtoFMk6MPSFnw46s8PJ+jBDOQhhvFzzXwr+0tZbrqNtXui3PHSVt86ED+axRpuUog5ePzaSJQ+AVdSxQwCxT19avooAZPHjw9jT4U9Eo18BFIAQSaxtgNhaAJltaZdOKxZ+EYiWOnEZDs3BZCrWtgfiRKA5PD0gJAFl+fEet1JwH/HSmHFOSvBt4csIe1s8KpUeubnoZMrBSPAZDfjNvhrSzHaKHpFi3WLi6DSP4pyHiHNg/LZRI4L5CpWQnEk/Dxu19A\\u003d\",\"ephemeralPublicKey\":\"BJbQqCHVXHkg/3vioDJAQNoNQMClUmmsjTJ9loy5+IacdR7Qb28Z2t8L6IlO3jgZvx6RFvD9ikR2zQWAa4RzYYQ\\u003d\",\"tag\":\"gAbroVixfH3Ayet2BVsuJ608Sw45u1HigVMiIRlif9k\\u003d\"}"}"
            }
        },
        "paymentMethodType": "GOOGLEPAY"
    },
    "paymentNotifyUrl": "https://www.yourNotifyUrl.com",
    "paymentRedirectUrl": "https://www.yourMerchantWeb.com",
    "paymentRequestId": "713c6f16-fca5-4507-8291-beea32dc470b",
    "productCode": "CASHIER_PAYMENT",
    "settlementStrategy": {
        "settlementCurrency": "SGD"
    },
    "subscriptionInfo": {
        "periodRule": {
            "periodCount": 1,
            "periodType": "MONTH"
        },
        "subscriptionDescription": "Subscription test",
        "subscriptionNotifyUrl": "https://www.yourDomain.com/subscription/notify",
        "subscriptionStartTime": "2026-03-13T14:42:55.062+08:00"
    }
}
```

 The following shows the sample code of a response:

 ```json
{
  "normalUrl": "https://iexpfront-sea.alipay.com/authorise3d?merchantId=1887SjzZ56b1lvObJWQTaqG4PhACjUGncnl0Sihzg8en5I%3D&ddcId=m47qH0MLK7A7yJNVdjLYJMrfAGZ7ZPgbv5TmV3FoZ4U%3D&pass=lt%5E1&needDDC=Y&from=iexpcore",
  "paymentActionForm": {
    "method": "POST",
    "parameters": {
      "Bin": "4***11",
      "JWT": "eyJraWQiOiJDQVJESU5BTF9KV1RfYWxpcGF5IiwiY3R5IjoiQ****QUxfSldUX2FsaXBheSIsImFsZyI6IkhTMjU2In0.eyJPcmdVbml0SWQiOiI1ZDVmMTA2MjRiNzkyYTFhZTBkN2Y3MTEiLCJSZWZlcmVuY2VJZCI6Ijk2OTQ2ZWQ0LTRiZDEtNDBkOS05Y2I2LTQ4NjExMjlhZDVkYyIsIlJldHVyblVybCI6Imh0dHBzOi8vb3Blbi1uYS5hbGlwYXkuY29tL2FwaS9vcGVuL3VybF9jYWxsYmFja19nZXQvY2FyZGluYWwvY2FyZGluYWwwMDcuaHRtP3NpZ25EYXRhPWpKa1IlMkZQdnYweldCeEZvJTJCOUtXM1B5TFZDM2h4WHpkUEVVQWpHRmszQjR0anJ4eW5LTHRKJTJGR3pMekZFR1RYSEVhcWlJd05Jb2xqTW0xUEw2MlllYVFFZUU4S2pYeVNCUUt0M01iMVBNbEo0dXolMkY2WHllSW5UJTJCZW92QWJXSDclMkJDc0V1RmtqckdwOHpQYmJkMDA1M0IlMkYlMkZhcXc3VEN5RklXQXdWOGkxcyUyQjE5R1pzTXJKZGpoRkk4NVc5RjVvWTBJclZrQTlsRSUyRk5VZ1p6c3N0VGtSVFFVYjl0azJTbmM5WGJBZ096JTJCek5MNkc3UlhTeURNanNtZ0pqR0pWdjVDWUpFR3htaSUyRjVWMk5MRlBRZ3Nrd1RPSEdCVlVMY1VGM1RUaXhHM0JnbjlsdXlDU0hvbnN1RHY5M0Q3bnhXZ3gzS2JsSloxY1hVbGxaU2Q4V2Q2bVU5VGZiZyUzRCUzRCZpblNlcmlhbE5vPTIwMjYwMzEzODkwMzEzNDEwMDAxSjM3NDMyNTc3MjQmb3V0T3JkZXJObz0yMDI2MDMxMzg5MDMxMzQxMDAwMUozNzQzMjU3NzI0IiwiZXhwIjoxNzczMzg1MDc4LCJpYXQiOjE3NzMzODQxNzgsImlzcyI6IjVkNWZkZGU4Y2NlZjc2MWFkOGI4MmI2OCIsImp0aSI6IjIwMjYwMzEzODkwMzEzNDEwMDAxSjM3NDMyNTc3MjQifQ.hBMn31v0ntxmMhDjqnYByylVufj7EjUyZj55WPivQu4",
      "DDCFlag": "Y"
    },
    "paymentActionFormType": "RedirectActionForm",
    "redirectUrl": "https://iexpfront-sea.alipay.com/authorise3d?merchantId=1887SjzZ56b1lvObJWQTaqG4PhACjUGncnl0Sihzg8en5I%3D&ddcId=m47qH0MLK7A7yJNVdjLYJMrfAGZ7ZPgbv5TmV3FoZ4U%3D&pass=lt%5E1&needDDC=Y&from=iexpcore"
  },
  "paymentAmount": {
    "currency": "SGD",
    "value": "4200"
  },
  "paymentCreateTime": "2026-03-12T23:42:56-07:00",
  "paymentId": "2026031319401****1001881J0284139383",
  "paymentRequestId": "713c6f16-fca5-4507-8291-beea32dc****",
  "paymentResultInfo": {
    "cardBrand": "VISA",
    "cardNo": "************1111",
    "credentialTypeUsed": "PAN",
    "threeDSResult": {}
  },
  "redirectActionForm": {
    "method": "POST",
    "parameters": {
      "Bin": "411111",
      "JWT": "eyJraWQiOiJDQVJESU5BTF9KV1RfYWxpcGF5IiwiY3R5I*****SRElOQUxfSldUX2FsaXBheSIsImFsZyI6IkhTMjU2In0.eyJPcmdVbml0SWQiOiI1ZDVmMTA2MjRiNzkyYTFhZTBkN2Y3MTEiLCJSZWZlcmVuY2VJZCI6Ijk2OTQ2ZWQ0LTRiZDEtNDBkOS05Y2I2LTQ4NjExMjlhZDVkYyIsIlJldHVyblVybCI6Imh0dHBzOi8vb3Blbi1uYS5hbGlwYXkuY29tL2FwaS9vcGVuL3VybF9jYWxsYmFja19nZXQvY2FyZGluYWwvY2FyZGluYWwwMDcuaHRtP3NpZ25EYXRhPWpKa1IlMkZQdnYweldCeEZvJTJCOUtXM1B5TFZDM2h4WHpkUEVVQWpHRmszQjR0anJ4eW5LTHRKJTJGR3pMekZFR1RYSEVhcWlJd05Jb2xqTW0xUEw2MlllYVFFZUU4S2pYeVNCUUt0M01iMVBNbEo0dXolMkY2WHllSW5UJTJCZW92QWJXSDclMkJDc0V1RmtqckdwOHpQYmJkMDA1M0IlMkYlMkZhcXc3VEN5RklXQXdWOGkxcyUyQjE5R1pzTXJKZGpoRkk4NVc5RjVvWTBJclZrQTlsRSUyRk5VZ1p6c3N0VGtSVFFVYjl0azJTbmM5WGJBZ096JTJCek5MNkc3UlhTeURNanNtZ0pqR0pWdjVDWUpFR3htaSUyRjVWMk5MRlBRZ3Nrd1RPSEdCVlVMY1VGM1RUaXhHM0JnbjlsdXlDU0hvbnN1RHY5M0Q3bnhXZ3gzS2JsSloxY1hVbGxaU2Q4V2Q2bVU5VGZiZyUzRCUzRCZpblNlcmlhbE5vPTIwMjYwMzEzODkwMzEzNDEwMDAxSjM3NDMyNTc3MjQmb3V0T3JkZXJObz0yMDI2MDMxMzg5MDMxMzQxMDAwMUozNzQzMjU3NzI0IiwiZXhwIjoxNzczMzg1MDc4LCJpYXQiOjE3NzMzODQxNzgsImlzcyI6IjVkNWZkZGU4Y2NlZjc2MWFkOGI4MmI2OCIsImp0aSI6IjIwMjYwMzEzODkwMzEzNDEwMDAxSjM3NDMyNTc3MjQifQ.hBMn31v0ntxmMhDjqnYByylVufj7EjUyZj55WPivQu4",
      "DDCFlag": "Y"
    },
    "redirectUrl": "https://iexpfront-sea.alipay.com/authorise3d?merchantId=1887SjzZ56b1lvObJWQTaqG4PhACjUGncnl0Sihzg8en5I%3D&ddcId=m47qH0MLK7A7yJNVdjLYJMrfAGZ7ZPgb****V3FoZ4U%3D&pass=lt%5E1&needDDC=Y&from=iexpcore"
  },
  "result": {
    "resultCode": "PAYMENT_IN_PROCESS",
    "resultMessage": "payment in process",
    "resultStatus": "U"
  }
}
```

**Tab: Merchant decryption**

<!-- TabGroup -->

**Tab: First-time subscription**

The following illustrates the payment flow for the subsequent periodic deductions process using merchant-decrypted     *paymentToken*    ：

 ![Sequence diagram of Google Pay first-time subscription with merchant decryption (PAN_ONLY and CRYPTOGRAM_3DS scenarios)](https://idocs-assets.marmot-cloud.com/storage/idocs87c36dc8dac653c1/yuque/idocs/2026/png/bb488eca-d38d-44ac-b205-7815ba08fa83.png)

**Tab: Subsequent deductions**

The following illustrates the payment flow for the subsequent periodic deductions process using merchant-decrypted     *paymentToken*    ：

 ![Sequence diagram of Google Pay subsequent recurring deductions with merchant decryption](https://idocs-assets.marmot-cloud.com/storage/idocs87c36dc8dac653c1/yuque/idocs/2026/png/07b5fe2d-13c8-4cd8-af78-8399714a0221.png)

<!-- /TabGroup -->

## Integration preparations {#uyRz1}

 Before you start integrating, read the   [Integration guide](https://docs.antom.com/integration_guide_en.md)   and   [API Overview](https://docs.antom.com/ac/ams/api_fund.md)   documents to understand the integration steps of the server-side API and the precautions for calling the API. Furthermore, ensure that the following prerequisites are met:

 - Obtain a 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)  .

## Integration Steps {#IgjTF}

 Follow these steps to start the integration:

 1. Obtain     *paymentToken*
2. Create a subscription payment request
3. (Optional) Redirect to the 3DS authentication page
4. Obtain the authorization result
5. Capture and recieve the capture notification
6. Recieve subscription notifications

### Step 1: Obtain _paymentToken_ {#RO9WX}

 After you obtain     *paymentToken*    , you can choose the merchant decryption method to decrypt the token and call the   [**pay (One-time Payments)**](https://docs.antom.com/ac/ams/payment_cashier.md)         API to initiate an authorized payment request.

### Step 2: Create a subscription payment request   **[Server-side]** {#UbYcL}

 After integrating the [Google Pay](https://docs.antom.com/ac/antomop/googlepay.md) SDK, you can obtain the     *paymentToken*     through   [Direct tokenization](https://developers.google.com/pay/api/web/reference/request-objects#direct)  . For details, please refer to   [Payment data encryption for merchants](https://developers.google.com/pay/api/web/guides/resources/payment-data-cryptography)  . After obtaining the    *paymentToken*    and completing the decryption, please pass the corresponding parameters according to the card transaction authentication scenario (  `PAN_ONLY`   or   `CRYPTOGRAM_3DS`  ) in the decryption result, and call the   [**pay (One-time Payments)**](https://docs.antom.com/ac/ams/payment_cashier.md)   API to initiate an authorization payment request.

 > **[INFO]** **Note**    : Using this mode requires that you are PCI-qualified and you have uploaded the PCI proof to the [Google Pay](https://docs.antom.com/ac/antomop/googlepay.md) backend.

 The following code demonstrates the retrieved [Google Pay](https://docs.antom.com/ac/antomop/googlepay.md) message   , covering two card transaction authentication scenarios:   `PAN_ONLY`   and   `CRYPTOGRAM_3DS`  :

 - `PAN_ONLY`   **:**     This authentication method is associated with payment cards stored in the buyer's Google account. In this scenario, the decrypted card information obtained is FPAN.
- `CRYPTOGRAM_3DS`   **:**     This authentication method is associated with cards stored as tokens on Android devices. In this scenario, the decrypted card information obtained is DPAN.

<!-- TabGroup -->

**Tab: PAN_ONLY**

An example of the obtained [Google Pay](https://docs.antom.com/ac/antomop/googlepay.md) message:

 ```json
"paymentMethod": "CARD",
"paymentMethodDetails": {
  "authMethod": "PAN_ONLY",
  "pan": "1111222233334444",
  "expirationMonth": 10,
  "expirationYear": 2020
},  "gatewayMerchantId": "some-merchant-id",  "messageId": "some-message-id",
"messageExpiration": "1577862000000"
}
```

  When the card transaction authentication scenario in the decryption result is   `PAN_ONLY`   (that is, when the card information type obtained after decryption is FPAN), the key [Google Pay](https://docs.antom.com/ac/antomop/googlepay.md) parameters in the request are listed below:

 | **Parameter name** | **Required** | **Description** |
| --- | --- | --- |
| *paymentMethod.paymentMethodType* | Yes | Payment method enum value. In [Google Pay](https://docs.antom.com/ac/antomop/googlepay.md) scenarios, when you    decrypt the     *paymentToken*    yourself and obtain FPAN information, set this parameter to`CARD`. |
| *paymentMethod.paymentMethodMetaData.is3DSAuthentication* | Yes | In [Google Pay](https://docs.antom.com/ac/antomop/googlepay.md) scenarios, when you decrypt the     *paymentToken*     yourself and obtain FPAN information, set this parameter to  `true`  to initiate a 3DS transaction for buyer authentication. |
| *paymentMethod.paymentMethodMetaData.cardNo* | Yes | Pass the obtained value of     *paymentMethodDetails.pan*    . |
| *paymentMethod.paymentMethodMetaData.expiryMonth* | Yes | Pass the obtained value of     *paymentMethodDetails.expirationMonth.* |
| *paymentMethod.paymentMethodMetaData.expiryYear* | Yes | Pass the obtained value of     *paymentMethodDetails.expirationYear.* |
| *mpiData.cavv* | Yes | Pass the obtained value of     *paymentMethodDetails.cryptogram*    . |
| *mpiData.eci* | No | Pass the obtained value of     *paymentMethodDetails.eciIndicator*    . |

 For more information about the parameters used to initiate an authorized payment, refer to   [Step 2: Create a subscription payment request](https://docs.antom.com/ac/subscriptionpay/cardinfocallmerchant.md?locale=en-us#d1yRJ)  .

 The following sample code shows how to call the   [**pay (One-time Payments)**](https://docs.antom.com/ac/ams/payment_cashier.md)   API:

 ```java
public static void payByGooglePayServer2Server() {
    AlipayPayRequest alipayPayRequest = new AlipayPayRequest();
    alipayPayRequest.setProductCode(ProductCodeType.CASHIER_PAYMENT);

    // Replace with your paymentRequestId
    String paymentRequestId = UUID.randomUUID().toString();
    alipayPayRequest.setPaymentRequestId(paymentRequestId);

    // Set subscription information
    SubscriptionInfo subscriptionInfo = new SubscriptionInfo();
    subscriptionInfo.setSubscriptionDescription("Subscription test");
    LocalDateTime localNow = LocalDateTime.now();
    OffsetDateTime offsetDateTime = localNow.atOffset(ZoneOffset.of("+08:00"));
    String startTime = offsetDateTime.format(DateTimeFormatter.ISO_OFFSET_DATE_TIME);
    subscriptionInfo.setSubscriptionStartTime(startTime);
    subscriptionInfo.setSubscriptionNotifyUrl("https://www.yourDomain.com/subscription/notify");
    PeriodRule periodRule = new PeriodRule();
    periodRule.setPeriodType("MONTH");
    periodRule.setPeriodCount(1);
    subscriptionInfo.setPeriodRule(periodRule);
    alipayPayRequest.setSubscriptionInfo(subscriptionInfo);

    // Set payment amount
    Amount amount = Amount.builder().currency("SGD").value("4200").build();
    alipayPayRequest.setPaymentAmount(amount);

    // Set settlement strategy
    SettlementStrategy settlementStrategy = SettlementStrategy.builder().settlementCurrency("SGD").build();
    alipayPayRequest.setSettlementStrategy(settlementStrategy);

    // Set payment method - PAN_ONLY scenario
    PaymentMethod paymentMethod = PaymentMethod.builder().paymentMethodType("CARD").build();
    alipayPayRequest.setPaymentMethod(paymentMethod);

    // Set Google Pay related parameters -- merchant decryption
    Map<String, Object> paymentMethodMetaData = new HashMap<>();
    paymentMethodMetaData.put("cardNo", "4054695723100768");
    paymentMethodMetaData.put("cvv", "123");
    paymentMethodMetaData.put("expiryMonth", "12");
    paymentMethodMetaData.put("expiryYear", "99");
    paymentMethodMetaData.put("tokenizeMode", false);
    paymentMethodMetaData.put("is3DSAuthentication", true);
    paymentMethod.setPaymentMethodMetaData(paymentMethodMetaData);

    // Replace with your orderId
    String orderId = UUID.randomUUID().toString();

    // Set buyer information
    Buyer buyer = Buyer.builder().referenceBuyerId("yourBuyerId").build();

    // Set order information
    Order order = Order.builder().referenceOrderId(orderId)
            .orderDescription("antom testing order").orderAmount(amount).buyer(buyer).build();
    alipayPayRequest.setOrder(order);

    // Set device environment information
    Env env = Env.builder().terminalType(TerminalType.WEB).clientIp("1.2.3.4").build();
    alipayPayRequest.setEnv(env);

    // Set authorization capture mode
    PaymentFactor paymentFactor = PaymentFactor.builder().isAuthorization(true).build();
    alipayPayRequest.setPaymentFactor(paymentFactor);

    // Replace with your notification URL
    alipayPayRequest.setPaymentNotifyUrl("https://www.yourNotifyUrl.com");

    // Replace with your redirect URL
    alipayPayRequest.setPaymentRedirectUrl("https://www.yourMerchantWeb.com");

    // Execute payment
    AlipayPayResponse alipayPayResponse = null;
    try {
        alipayPayResponse = CLIENT.execute(alipayPayRequest);
    } catch (AlipayApiException e) {
        String errorMsg = e.getMessage();
        // Handle error case
    }
}
```

 The following shows the sample code of a request:

 ```json
{
    "env": {
        "clientIp": "1.2.3.4",
        "terminalType": "WEB"
    },
    "order": {
        "buyer": {
            "referenceBuyerId": "yourBuyerId"
        },
        "orderAmount": {
            "currency": "SGD",
            "value": "4200"
        },
        "orderDescription": "antom testing order",
        "referenceOrderId": "daa64b56-0850-4d08-a322-370ac8fa6891"
    },
    "paymentAmount": {
        "currency": "SGD",
        "value": "4200"
    },
    "paymentFactor": {
        "isAuthorization": true
    },
    "paymentMethod": {
        "paymentMethodMetaData": {
            "cvv": "123",
            "is3DSAuthentication": true,
            "expiryMonth": "12",
            "expiryYear": "99",
            "cardNo": "4054695723100768",
            "tokenizeMode": false
        },
        "paymentMethodType": "CARD"
    },
    "paymentNotifyUrl": "https://www.yourNotifyUrl.com",
    "paymentRedirectUrl": "https://www.yourMerchantWeb.com",
    "paymentRequestId": "a1513804-d4ab-4dc8-9ec5-775e3aeb6587",
    "productCode": "CASHIER_PAYMENT",
    "settlementStrategy": {
        "settlementCurrency": "SGD"
    },
    "subscriptionInfo": {
        "periodRule": {
            "periodCount": 1,
            "periodType": "MONTH"
        },
        "subscriptionDescription": "Subscription test",
        "subscriptionNotifyUrl": "https://www.yourDomain.com/subscription/notify",
        "subscriptionStartTime": "2026-03-13T15:29:13.475+08:00"
    }
}
```

 The following shows the sample code of a response:

 ```json
{
    "normalUrl": "https://iexpfront-sea.alipay.com/authorise3d?merchantId=1887SjzZ56b1lvObJWQTaqG4PhACjUGncnl0Sihzg8en5I%3D&ddcId=m47qH0MLK7A7yJNVdjLYJBM4I4E%2B6F%2****8QutUHkz0%3D&pass=lt%5E1&needDDC=Y&from=iexpcore",
    "paymentActionForm": "{"method":"POST","parameters":"{\"JWT\":\"eyJraWQiOiJDQVJESU5BTF9KV1RfYWxpcGF5IiwiY3R5IjoiQ0FSRElOQUxfSldUX2FsaXBheSIsImFsZyI6IkhTMjU2In0.eyJPcmdVbml0SWQiOiI1ZD*****2MjRiNzkyYTFhZTBkN2Y3MTEiLCJSZWZlcmVuY2VJZCI6ImEzMTFmNTE4LTY2ZjQtNGQzMC1hMmFhLTI2ZWU0YmI5NjMzMSIsIlJldHVyblVybCI6Imh0dHBzOi8vb3Blbi1uYS5hbGlwYXkuY29tL2FwaS9vcGVuL3VybF9jYWxsYmFja19nZXQvY2FyZGluYWwvY2FyZGluYWwwMDcuaHRtP3NpZ25EYXRhPUdGWUhkWUl2VFBjZE9sJTJCdUl5emk3VG5RbHYwWlNaWG5jaVlOM3NQb0JCUXMlMkZLMXZhdThaVTJwR1hHUVRNVndieVFOV3V5OElMV0p6b2dIdExzbFJ0U3BhYVNUbGpsY3doQ1pRTnNaM2U3JTJGcVVMZFBUNElEYUJvQ1pkTERFTkFiS0NFd3pzQSUyQjF1UFk1dU1neE5zRmt4dSUyQkhXZVpSaldDekplRVNGVUtqMUMwNyUyRkpleGVTZmltRDBEN1dvemJKdmlud2pObjZ5bko3RGVuVTl1a2NRSXlkeFNSJTJGJTJCUWc4TTNUMGNHMFZuWkdXN2xUZ25OcExEd0ZHUlZlJTJCWlFSM2xpQTEyUkE2TjZjTmo1VTVpM0VpUk8yNHRRczVWWmJOTyUyRkFDdHZBWmxmR0hjbXdldyUyQmNBQ0doR3gyNjI0emplNmZGOGZZY1djbGJJYVNkckxJazMzWlElM0QlM0QmaW5TZXJpYWxObz0yMDI2MDMxMzg5MDMxMzQxMDAwMkoyNTQzNjY1OTAzJm91dE9yZGVyTm89MjAyNjAzMTM4OTAzMTM0MTAwMDJKMjU0MzY2NTkwMyIsImV4cCI6MTc3MzM4Nzg1NiwiaWF0IjoxNzczMzg2OTU2LCJpc3MiOiI1ZDVmZGRlOGNjZWY3NjFhZDhiODJiNjgiLCJqdGkiOiIyMDI2MDMxMzg5MDMxMzQxMDAwMkoyNTQzNjY1OTAzIn0.6ZPZv8AflJ10Nwpjj22WTXKrG6J6ldthzJiGcEHrYwg\",\"Bin\":\"405469\",\"DDCFlag\":\"Y\"}","paymentActionFormType":"RedirectActionForm","redirectUrl":"https://iexpfront-sea.alipay.com/authorise3d?merchantId=1887SjzZ56b1lvObJWQTaqG4PhACjUGncnl0Sihzg8en5I%3D&ddcId=m47qH0MLK7A7yJNVdjLYJBM4I4E%2B6F%2BWD98QutUHkz0%3D&pass=lt%5E1&needDDC=Y&from=iexpcore"}",
    "paymentAmount": {
        "currency": "SGD",
        "value": "4200"
    },
    "paymentCreateTime": "2026-03-13T00:29:15-07:00",
    "paymentId": "202603131940108001001882J0282278120",
    "paymentRequestId": "a1513804-d4ab-4dc8-9ec5-775e3aeb6587",
    "paymentResultInfo": {
        "cardBrand": "VISA",
        "cardNo": "************0768",
        "credentialTypeUsed": "PAN",
        "threeDSResult": {

        }
    },
    "paymentTime": "2026-03-13T00:29:16-07:00",
    "redirectActionForm": {
        "method": "POST",
        "parameters": "{"JWT":"eyJraWQiOiJDQVJESU5BTF9KV1RfYWxpcGF5IiwiY3R5IjoiQ0FSRElOQUxfSldUX2FsaXBheSIsImFsZyI6IkhTMjU2In0.eyJPcmdVbml0SWQiOiI1ZDVmMTA2MjRiNzkyYTFhZTBkN2Y3MTEiLCJSZWZlcmVuY2VJZCI6Im****FmNTE4LTY2ZjQtNGQzMC1hMmFhLTI2ZWU0YmI5NjMzMSIsIlJldHVyblVybCI6Imh0dHBzOi8vb3Blbi1uYS5hbGlwYXkuY29tL2FwaS9vcGVuL3VybF9jYWxsYmFja19nZXQvY2FyZGluYWwvY2FyZGluYWwwMDcuaHRtP3NpZ25EYXRhPUdGWUhkWUl2VFBjZE9sJTJCdUl5emk3VG5RbHYwWlNaWG5jaVlOM3NQb0JCUXMlMkZLMXZhdThaVTJwR1hHUVRNVndieVFOV3V5OElMV0p6b2dIdExzbFJ0U3BhYVNUbGpsY3doQ1pRTnNaM2U3JTJGcVVMZFBUNElEYUJvQ1pkTERFTkFiS0NFd3pzQSUyQjF1UFk1dU1neE5zRmt4dSUyQkhXZVpSaldDekplRVNGVUtqMUMwNyUyRkpleGVTZmltRDBEN1dvemJKdmlud2pObjZ5bko3RGVuVTl1a2NRSXlkeFNSJTJGJTJCUWc4TTNUMGNHMFZuWkdXN2xUZ25OcExEd0ZHUlZlJTJCWlFSM2xpQTEyUkE2TjZjTmo1VTVpM0VpUk8yNHRRczVWWmJOTyUyRkFDdHZBWmxmR0hjbXdldyUyQmNBQ0doR3gyNjI0emplNmZGOGZZY1djbGJJYVNkckxJazMzWlElM0QlM0QmaW5TZXJpYWxObz0yMDI2MDMxMzg5MDMxMzQxMDAwMkoyNTQzNjY1OTAzJm91dE9yZGVyTm89MjAyNjAzMTM4OTAzMTM0MTAwMDJKMjU0MzY2NTkwMyIsImV4cCI6MTc3MzM4Nzg1NiwiaWF0IjoxNzczMzg2OTU2LCJpc3MiOiI1ZDVmZGRlOGNjZWY3NjFhZDhiODJiNjgiLCJqdGkiOiIyMDI2MDMxMzg5MDMxMzQxMDAwMkoyNTQzNjY1OTAzIn0.6ZPZv8AflJ10Nwpjj22WTXKrG6J6ldthzJiGcEHrYwg","Bin":"405469","DDCFlag":"Y"}",
        "redirectUrl": "https://iexpfront-sea.alipay.com/authorise3d?merchantId=1887SjzZ56b1lvObJWQTaqG4PhACjUGncnl0Sihzg8en5I%3D&ddcId=m47qH0MLK7A7yJNVdjLYJBM4I4E%2B6F%2BWD98Qu****0%3D&pass=lt%5E1&needDDC=Y&from=iexpcore"
    },
    "result": {
        "resultCode": "PAYMENT_IN_PROCESS",
        "resultMessage": "payment in process",
        "resultStatus": "U"
    }
}
```

**Tab: CRYPTOGRAM_3DS**

An example of the obtained [Google Pay](https://docs.antom.com/ac/antomop/googlepay.md) message:

 ```json
{
  "paymentMethod": "CARD",
  "paymentMethodDetails": {
    "authMethod": "CRYPTOGRAM_3DS",
    "pan": "1111222233334444",
    "expirationMonth": 10,
    "expirationYear": 2020,
    "cryptogram": "AAAAAA...",
    "eciIndicator": "eci indicator"

  },

  "messageId": "some-message-id",
  "messageExpiration": "1577862000000"
}
```

  When the card transaction authentication scenario in the decryption result is   `CRYPTOGRAM_3DS`   (that is, when the card information type obtained after decryption is DPAN), the key [Google Pay](https://docs.antom.com/ac/antomop/googlepay.md) parameters in the request are listed below:

 | **Parameter name** | **Required** | **Description** |
| --- | --- | --- |
| *paymentMethod.paymentMethodType* | Yes | Payment method enum value. In [Google Pay](https://docs.antom.com/ac/antomop/googlepay.md) scenarios, when you    decrypt the     *paymentToken*     yourself and obtain DPAN information, set    this    parameter to  `GOOGLEPAY`  . |
| *paymentMethod.paymentMethodMetaData.is3DSAuthentication* | No | In [Google Pay](https://docs.antom.com/ac/antomop/googlepay.md) scenarios, when you decrypt the     *paymentToken*     yourself and obtain DPAN information, set this parameter to  `false`   or omit the parameter, as the buyer has already completed [Google Pay](https://docs.antom.com/ac/antomop/googlepay.md)'s authentication process. |
| *paymentMethod.paymentMethodMetaData.cardNo* | Yes | Pass the obtained value of     *paymentMethodDetails.pan*    . |
| *paymentMethod.paymentMethodMetaData.expiryMonth* | Yes | Pass the obtained value of     *paymentMethodDetails.expirationMonth.* |
| *paymentMethod.paymentMethodMetaData.expiryYear* | Yes | Pass the obtained value of     *paymentMethodDetails.expirationYear.* |
| *mpiData.cavv* | Yes | Pass the obtained value of     *paymentMethodDetails.cryptogram*    . |
| *mpiData.eci* | No | Pass the obtained value of     *paymentMethodDetails.eciIndicator*    . |

 For more information about the parameters used to initiate an authorized payment, refer to   [Step 2: Create a subscription payment request](https://docs.antom.com/ac/subscriptionpay/cardinfocallmerchant.md?locale=en-us#d1yRJ)  .

 The following sample code shows how to call the   [**pay (One-time Payments)**](https://docs.antom.com/ac/ams/payment_cashier.md)   API:

 ```java
public static void payByGooglePayServer2Server() {
    AlipayPayRequest alipayPayRequest = new AlipayPayRequest();
    alipayPayRequest.setProductCode(ProductCodeType.CASHIER_PAYMENT);

    // Replace with your paymentRequestId
    String paymentRequestId = UUID.randomUUID().toString();
    alipayPayRequest.setPaymentRequestId(paymentRequestId);

    // Set subscription information
    SubscriptionInfo subscriptionInfo = new SubscriptionInfo();
    subscriptionInfo.setSubscriptionDescription("Subscription test");
    LocalDateTime localNow = LocalDateTime.now();
    OffsetDateTime offsetDateTime = localNow.atOffset(ZoneOffset.of("+08:00"));
    String startTime = offsetDateTime.format(DateTimeFormatter.ISO_OFFSET_DATE_TIME);
    subscriptionInfo.setSubscriptionStartTime(startTime);
    subscriptionInfo.setSubscriptionNotifyUrl("https://www.yourDomain.com/subscription/notify");
    PeriodRule periodRule = new PeriodRule();
    periodRule.setPeriodType("MONTH");
    periodRule.setPeriodCount(1);
    subscriptionInfo.setPeriodRule(periodRule);
    alipayPayRequest.setSubscriptionInfo(subscriptionInfo);

    // Set payment amount
    Amount amount = Amount.builder().currency("SGD").value("4200").build();
    alipayPayRequest.setPaymentAmount(amount);

    // Set settlement strategy
    SettlementStrategy settlementStrategy = SettlementStrategy.builder().settlementCurrency("SGD").build();
    alipayPayRequest.setSettlementStrategy(settlementStrategy);

    // Set payment method - CRYPTOGRAM_3DS scenario
    PaymentMethod paymentMethod = PaymentMethod.builder().paymentMethodType("GOOGLEPAY").build();
    alipayPayRequest.setPaymentMethod(paymentMethod);

    // Set MpiData information -- CRYPTOGRAM_3DS scenario
    Map<String, Object> paymentMethodMetaData = new HashMap<>();
    paymentMethodMetaData.put("cardNo", "4054695723100768");
    paymentMethodMetaData.put("cvv", "123");
    paymentMethodMetaData.put("expiryMonth", "12");
    paymentMethodMetaData.put("expiryYear", "99");

    MpiData mapiDate = new MpiData();
    mapiDate.setCavv("googlePay cryptogram");
    mapiDate.setEci("eci indicator");
    paymentMethodMetaData.put("mpiData", mapiDate);
    paymentMethod.setPaymentMethodMetaData(paymentMethodMetaData);

    // Replace with your orderId
    String orderId = UUID.randomUUID().toString();

    // Set buyer information
    Buyer buyer = Buyer.builder().referenceBuyerId("yourBuyerId").build();

    // Set order information
    Order order = Order.builder().referenceOrderId(orderId)
            .orderDescription("antom testing order").orderAmount(amount).buyer(buyer).build();
    alipayPayRequest.setOrder(order);

    // Set environment information
    Env env = Env.builder().terminalType(TerminalType.WEB).clientIp("1.2.3.4").build();
    alipayPayRequest.setEnv(env);

    // Set authorization capture mode
    PaymentFactor paymentFactor = PaymentFactor.builder().isAuthorization(true).build();
    alipayPayRequest.setPaymentFactor(paymentFactor);

    // Replace with your notification URL
    alipayPayRequest.setPaymentNotifyUrl("https://www.yourNotifyUrl.com");

    // Replace with your redirect URL
    alipayPayRequest.setPaymentRedirectUrl("https://www.yourMerchantWeb.com");

    // Execute payment
    AlipayPayResponse alipayPayResponse = null;
    try {
        alipayPayResponse = CLIENT.execute(alipayPayRequest);
    } catch (AlipayApiException e) {
        String errorMsg = e.getMessage();
        System.out.println("支付失败: " + errorMsg);
        // Handle error case
    }
}
```

 The following shows the sample code of a request:

 ```json
{
    "env": {
        "clientIp": "1.2.3.4",
        "terminalType": "WEB"
    },
    "order": {
        "buyer": {
            "referenceBuyerId": "yourBuyerId"
        },
        "orderAmount": {
            "currency": "SGD",
            "value": "4200"
        },
        "orderDescription": "antom testing order",
        "referenceOrderId": "b2ad9478-2eec-4aee-8403-13432ca66a38"
    },
    "paymentAmount": {
        "currency": "SGD",
        "value": "4200"
    },
    "paymentFactor": {
        "isAuthorization": true
    },
    "paymentMethod": {
        "paymentMethodMetaData": {
            "cvv": "123",
            "expiryMonth": "12",
            "expiryYear": "99",
            "cardNo": "4054695723100768",
            "mpiData": {
                "cavv": "googlePay cryptogram",
                "eci": "eci indicator"
            }
        },
        "paymentMethodType": "GOOGLEPAY"
    },
    "paymentNotifyUrl": "https://www.yourNotifyUrl.com",
    "paymentRedirectUrl": "https://www.yourMerchantWeb.com",
    "paymentRequestId": "383bc587-0a45-479c-8e2a-ef719c0e9b93",
    "productCode": "CASHIER_PAYMENT",
    "settlementStrategy": {
        "settlementCurrency": "SGD"
    },
    "subscriptionInfo": {
        "periodRule": {
            "periodCount": 1,
            "periodType": "MONTH"
        },
        "subscriptionDescription": "Subscription test",
        "subscriptionNotifyUrl": "https://www.yourDomain.com/subscription/notify",
        "subscriptionStartTime": "2026-03-13T15:47:56.201+08:00"
    }
}
```

 The following shows a sample code of a response:

 ```json
{
    "authExpiryTime": "2026-03-20T00:47:59-07:00",
    "paymentAmount": {
        "currency": "SGD",
        "value": "4200"
    },
    "paymentCreateTime": "2026-03-13T00:47:58-07:00",
    "paymentId": "20260313194010****001884C0282432224",
    "paymentRequestId": "383bc587-0a45-479c-8e2a-ef719c0e****",
    "paymentResultInfo": {
        "avsResultRaw": "I",
        "cardBrand": "VISA",
        "cardNo": "************0768",
        "credentialTypeUsed": "PAN",
        "cvvResultRaw": "P",
        "networkTransactionId": "2026031389031****004C9843804231",
        "threeDSResult": {
            "cavv": "",
            "eci": ""
        }
    },
    "paymentTime": "2026-03-13T00:47:59-07:00",
    "result": {
        "resultCode": "SUCCESS",
        "resultMessage": "success.",
        "resultStatus": "S"
    }
}
```

<!-- /TabGroup -->

<!-- /TabGroup -->

### (Optional) Step 3: Redirect to the 3DS authentication page   **[Client-side]** {#SDNrj}

 Once the merchant server obtains the     *normalUrl*     returned by Antom, it should pass     *normalUrl*     to the frontend, which will then redirect the buyer to the 3DS authentication page. For details, see   [Step 3: Redirect to the 3DS authentication page (normalUrl)](https://docs.antom.com/ac/subscriptionpay/cardinfocallmerchant_subscription.md#zrBmS)  .

 > **[INFO]** **Note**    :    In the [Google Pay](https://docs.antom.com/ac/antomop/googlepay.md) scenario, when Antom hosts decryption of _paymentToken_ or you decrypt _paymentToken_ yourself and the received information is FPAN, the returned _normalUrl_ is the 3DS authentication page.

### Step 4: Obtain the authorization result   **[Server-side]** {#kBb1r}

 Whether the authorization is successful or fails, Antom will send the payment result to you via the   [**notifyPayment**](https://docs.antom.com/ac/ams/notify_subpayment.md)   API. For details, please refer to   [Step 4: Obtain the authorization result](https://docs.antom.com/ac/subscriptionpay/cardinfocallmerchant_subscription.md#LgYfG)

### Step 5: Capture and recieve the capture notification   **[Server-side]** {#kBb2r}

 > **[INFO]** **Note**    :
>
>  - Only successful authorized payments will trigger capture.
> - Shipping desicion should be based on the capture result.

 After successful authorization, Antom will automatically initiate capture for you, or you can choose to initiate capture manually. Meanwhile, Antom will send the capture result notification to you via the   [**notifyCapture (One-time Payments)**](https://docs.antom.com/ac/ams/notify_capture.md)        API, or you can proactively query to obtain the capture result. Shipping of goods should be based on the capture result. For detailed steps, refer to   [Capture](https://docs.antom.com/ac/cashierpay/capture.md)  .

### Step 6: Recieve subscription notifications   **[Server-side]** {#w6CGr}

 After the subscription takes effect, Antom will send the following notifications:

 - [First subscription notification](https://docs.antom.com/ac/subscriptionpay/cardinfocallmerchant.md?locale=en-us#7u3Fq)
- [Subscription renewal notification](https://docs.antom.com/ac/subscriptionpay/cardinfocallmerchant.md?locale=en-us#4yLq5)

 For more details, refer to   [Step 6: Receive subscription notifications](https://docs.antom.com/ac/subscriptionpay/cardinfocallmerchant.md?locale=en-us#AQnvC)  .

## **After subscription** {#r6FIV}

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

### Subscription trial {#n4oAa}

 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, please refer to the  [Subscription trial](https://docs.antom.com/ac/subscriptionpay/subscription_trial.md)  .

### Subscription cancellation {#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, please refer to the  [Subscription cancellation](https://docs.antom.com/ac/subscriptionpay/subscription_cancellation.md)  .

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

 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]** {#imetF}

 To learn about Antom refund rules and how to initiate a refund for a successful transaction, see   [Refund](https://docs.antom.com/ac/cashierpay/refund.md)      for more information.

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

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