Specify a payment method

You can pass the parameters in the createPaymentSession (One-time Payments) API to specify the display of payment methods, the order of the payment method list, and the display of quick payments on Payment Element or Checkout Page (CKP).

Note: For Checkout Page (CKP), you can also specify payment methods on Antom Dashboard through Payments > Checkout page> Payment methods. If you pass parameters through the API, the API values take priority.

This feature offers you the following benefits:

  • Filter local payment methods based on your business region.
  • Sort your preferred payment methods.
  • Display the mainstream quick payments, such as Alipay, Apple Pay, and Google Pay.

To specify the payment method, pass the following parameters in the availablePaymentMethod parameter of the createPaymentSession (One-time Payments) API:

Parameter name

Required

Description

paymentMethodTypeList

No

List of payment methods available to the buyer. The list includes the following parameters:

  • paymentMethodType: The type of payment method included in the payment option. See Enumeration values of payment methods for valid values.
  • paymentMethodOrder: The priority order you set for payment methods, represented by sequence numbers. The smaller the number, the higher the priority. If no sequence is set, Antom's default sorting will be used.
  • expressCheckout: Specifies whether to enable the express checkout option for a payment method. Currently, only ALIPAY_CN, APPLEPAY, and GOOGLEPAY can be set as express checkout methods. Valid values are:
    • true: Enables express checkout for this payment method.
    • false: Disables express checkout for this payment method.

Note: For Payment Element, the expressCheckout parameter is currently supported only on Android and iOS.

The following is a sample code for specifying the payment method:

copy
{ ...
  "availablePaymentMethod": {
    "paymentMethodTypeList": [
      {
        "paymentMethodType": "ALIPAY_CN",
        "expressCheckout": true,
        "paymentMethodOrder": "0"
      },
      {
        "paymentMethodType": "TNG",
        "expressCheckout": false,
        "paymentMethodOrder": "1"
      }
    ]
  }
}