COF purchase with automatic debiting
Overview
COF purchase with automatic debiting is a payment type which uses a single initial request to make a series of regularly recurring funds transfers from the customer to the merchant by using stored payment credentials without verification of the payment instrument (such as a card verification code).
The payment platform performs COF purchases with automatic debiting according to the payment model (learn more).
Managing debiting retry attempts
If a scheduled automatic debiting is declined, for example, in case when the card account has insufficient balance, initiating this debiting can be attempted again in the payment platform after a certain time period. Refer to your ecommpay account manager to add this capability. It will be used if set up for the project in question and the following two requirements are met:
- This is a card payment.
- The debiting was declined by the issuer or the payment system.
In other cases, when a scheduled debiting in the series is declined, the next scheduled debiting is expected to be processed in the payment platform according to the schedule. Whether a debiting retry should occur or whether the series of debitings should be cancelled is decided by the merchant.
When retry attempts are used for COF purchases, their number and the time allocated for making them are limited: for each scheduled debiting there can be no more than 7 retry attempts carried out within 6 days. The time interval between an initial debiting and the first retry attempt as well as between the first and the second retry attempts equals 12 hours. The rest of the retry attempts are carried out every 24 hours. Along with that, it is checked that according to the debiting schedule the next debiting is to occur at least 12.5 or 24.5 hours after the retry attempt. If not, the retry attempts are cancelled. These restrictions are applicable to all payments within any project and cannot be modified in any way.
The steps of the debiting retry procedure are as follows:
- When a scheduled debiting is declined by the payment system or the issuer, the ecommpay payment platform checks if there is a possibility to attempt performing the debiting once again. If this possibility is confirmed, the web service is sent a callback that contains the information about the debiting decline with the operation status
decline
as well as the scheduled date and time of the retry attempt. - At the scheduled time, the debiting retry attempt is performed automatically.
- Depending on the attempt result, the following steps are executed:
- If the attempt results in debiting the funds from the customer to the merchant, a callback containing the debiting result information (with the operation status
success
) is sent to the web service. The COF purchase series continues according to the existing schedule. - If the attempt results in decline and the payment platform confirms the possibility to perform another attempt, a callback containing the information about the debiting decline (with the operation status
decline
and the scheduled date and time of the next retry attempt) is sent to the web service. Then step 2 is repeated. - If the attempt results in decline and the payment platform does not confirm the possibility to perform another attempt, a final callback containing the information about the debiting decline (with the operation status
decline
and without information about the next attempt) is sent to the web service. The COF purchase series continues according to the existing schedule. In this case, whether a debiting retry should occur or whether the series of debit operations should be cancelled must be decided by the merchant.
- If the attempt results in debiting the funds from the customer to the merchant, a callback containing the debiting result information (with the operation status
Along with that, retry Retry attempts can be cancelled even after they have been scheduled. You can send a request to Gate or use the tools of the Dashboard interface. In addition, you can stop the retry attempts by modifying the parameters of the COF purchase (including its expiration or cancellation, which changes the payment status in general and cancels subsequent debit operations in the series). If necessary, you can also contact the ecommpay technical support for assistance.
Workflow
COF purchase with initiation of the first debit operation during registration
If the scheduled_payment_id
parameter has been passed during the COF purchase registration, these are the steps to perform a COF purchase with automatic debiting:
- Register a COF purchase. For more information, see Registering COF purchase.
- Accept a callback with the debiting result from the payment platform.
- Accept subsequent callbacks for each debit operation for this payment.
To update or cancel a COF purchase or to refund one or more debit operations, you need to submit the corresponding requests to the payment platform. (For more information, see Managing debiting series of a COF purchase.)
The sections that follow discuss formats for requests and callbacks; for general information about using the API, see Interaction concepts. Information about possible statuses of this payment type can be found in the corresponding article.
COF purchase with a separate initiation of the first debit operation
If the scheduled_payment_id
parameter has not been passed during the COF purchase registration, these are the steps to perform a COF purchase with automatic debiting:
- Register a COF purchase. For more information, see Registering COF purchase.
- Submit a request for performing a COF payment with an identifier of the debit series record.
- Accept a callback with the debiting result from the payment platform.
- Accept subsequent callbacks for each debit operation for this payment.
COF purchase with debiting retry attempts
If the capability of debiting retries is set up for the project, these are the steps to perform a COF purchase with automatic debiting:
- Register a COF purchase. For more information, see Registering COF purchase.
- If the
scheduled_payment_id
parameter has not been passed during the COF purchase registration, submit a request for performing a COF payment with an identifier of the debit series record (recurring.id
). - Accept a callback with the debiting result from the payment platform (one or several depending on the number of executed retries).
- Accept subsequent callbacks for each scheduled debit operation and the retry attempts (if there are any) for this payment. If necessary, you can cancel retrying a specific debiting via Gate or Dashboard.
Keep in mind that if debiting retries are cancelled, no callbacks are sent to communicate the cancellation.
To cancel retrying a specific debiting, send a request to cancel debiting retries, accept the response, and notify the customer if necessary.
Request format
Request to initiate a COF purchase
There are several things you need to consider when sending a request for a COF purchase with automatic debiting using a payment card:
- To initiate each purchase, send a separate POST request to the /v2/payment/card/recurring endpoint.
- Each request must include the following objects and parameters:
general
—object with general request identification information:project_id
—project identifier obtained from ecommpay during integration.payment_id
—payment identifier, unique within the project.signature
—request signature generated after all required parameters are specified (details—in Signature generation and verification). (details)
customer
—object with customer information:id
—customer identifier, unique within the project, the same identifier as the one used to register this COF purchase.Warning: Using different customer identifiers for operations performed as part of the COF purchase is not allowed.ip_address
—customer IP address relevant for the initiated payment.
payment
—object with payment information:amount
—payment amount in the smallest currency unit.currency
—payment currency code in the ISO-4217 alpha-3 format.
recurring
—object with the COF payment information:id
—identifier of the debit series received in the callback with the COF purchase registration data or assigned when the COF purchase information was migrated from another acquirer.
- The set of parameters required for executing a payment can vary depending on the regional characteristics and other aspects of the payment services providers. Refer to your ecommpay account manager to learn more about the providers' specifics and requirements.
- Additionally, any other parameters included in the specification can be used.
Thus, a correct request must contain the project identifier, basic payment information (identifier, amount, and currency code), customer IP address, signature, and the identifier of the debiting series record.
Request to cancel debiting retries
There are several things you need to consider when sending a request to cancel debiting retry attempts:
- To cancel a debiting retry, send a separate POST request to the /v2/recurring/retry_stop endpoint.
- Each request must include the following objects and parameters:
general
—object with general request identification information:project_id
—project identifier obtained from ecommpay during integration.signature
—request signature generated after all required parameters are specified (details—in the Signature generation and verification). (details)
recurring
—object with the COF payment information:id
—identifier of the debit series received in the callback with the COF purchase registration data or assigned when the COF purchase information was migrated from another acquirer.
trigger_operation_id
—identifier of the recurring debit operation for which you need to cancel retries.
Thus, a correct request must contain the project identifier, signature, and the identifiers of the debiting series record and the target debit operation.
Callback format
The payment platform communicates results of processing each debit operation in callbacks sent to your web service. These callbacks are arranged in a standard format the detailed description of which can be found in Callbacks.
If the capability of debiting retries is set up, callbacks will contain the recurring_retry
object that can include some or all of the following parameters:
trigger_operation_id
—identifier of the debit operation that was retried.retry_count
—the number of the retry attempt (an integer from 1 to 7) if such attempt has been performed.next_retry_exists
—an indicator that shows whether the next scheduled attempt is available.This parameter is set to
true
if the debiting resulted in decline and there is an available retry attempt (the number of attempts and the time allocated for making them are not used up). In all other cases this parameter is set tofalse
.next_retry_date
—the scheduled date and time of the next retry attempt.
The following callback contains information about processing 4.00 USD
debit operation for card 431422******0056
of the customer with identifier customer_12
within project 42
. The capability of debiting retries is not available.
The following callback contains information that the declined debiting can be retried and the first retry attempt has been scheduled ("next_retry_exists : true"
). In this case, the identifiers of the target debit operation and the retry attempt are not specified because no retry attempts have been performed yet.
The following callback contains information that the first attempt ("retry_count": 1
) to retry debit operation 344589675
was declined and, as a result, the second attempt ("next_retry_exists" : true
) has been scheduled for this debit operation at 2023-05-24T16:58:02+0000
.
The following callback contains information that the second attempt ("retry_count": 2
) to retry debit operation 344589675
was performed successfully (the funds were transferred from the customer to the merchant) and, as a result, there is no need to retry this debiting any more ("next_retry_exists" : false
).
The following callback contains information that no retry attempts were performed or scheduled for one of the debit operations in the series. Such callbacks are sent if the debiting resulted in funds transfer when it was first initiated or retry attempts cannot be performed.