Card-on-File (COF) transactions

COF (Card-on-File) refers to a card that the buyer has previously used for payment and stored at the merchant's site during a transaction. With the buyer’s authorization, you can either store the card information yourself or have Antom store it on your behalf. When your buyer makes a payment using the stored card information, it is strongly recommended that you mark the transaction as a stored card payment in the request. Using stored card payments can effectively reduce the decline rate from card schemes and issuing banks, and improve the payment success rate. This article introduces how to enable COF.

How to enable

When the buyer initiates a payment using a stored card, you need to set availablePaymentMethod.paymentMethodMetaData.isCardOnFile to true in the createPaymentSession (One-time Payments) API to identify the transaction as a stored card payment.

The following is a sample code for initiating a subsequent transaction where the card information is stored by Antom, and the cardToken information provided by Antom is used:

copy
{
  ...
    "availablePaymentMethod": {
        "paymentMethodMetaData": {
            "isCardOnFile": true
        }
    },  
  "savedPaymentMethods": [
        {
            "paymentMethodType": "CARD",
            "paymentMethodId": "ALIPAYEfG2DFbGx2Eh739qU+VMnCPEe7MfRKfMfC5k7k/IFASWpAh/vCxHV3dPYpbkGz1iyWCloE4MwfmN48sP8+rSPQ=="
        }
    ]
  ...
}

Note: In COF (Card-on-File) transactions, the payment may fail if the buyer’s card has expired. In such cases, Antom will return the error code INVALID_EXPIRATION_DATE. We recommend guiding the buyer to bind the card again to update the card information.