Registering COF purchase
Overview
To register a COF purchase with the payment platform, you need to save customer payment instrument credentials. You can do it in a variety of ways by processing payments via Gate, Payment Page (details), and Dashboard (details) as well as by migrating information about COF purchases from an external acquirer (details).
You can register a COF purchase via Gate by sending a request for one-time purchase, payment link purchase, or for payment instrument verification with parameters indicating that the payment instrument credentials need to be saved.
COF purchase is registered for the time specified in the underlying request; if this time is not specified in the request, COF purchase registration term is set to the card expiration date. Once COF purchase registration expires, the payment platform sends a callback with this information to merchant's web service. Any further purchases by using this registration are no longer possible; if web service attempts to initiate the COF purchase, the payment platform will respond with a callback with the 3184
(or 3301
) error code.
COF purchase registration may be blocked for specific merchant projects or providers in which case the requests with registration demand may be declined. To prevent declining of such requests, you can contact support service at support@ecommpay.com and ask them to configure your project to ignore registration demands when processing COF purchases, if COF purchase registration is blocked.
If there are changes in the payment provider's service settings, you may need to register COF purchase again. In such cases, the merchant receives an email from the ecommpay technical support with a list of IDs of COF purchases that should be re-registered. For this registration, merchant must notify customers of the termination of previous debits and the need to initiate new ones by unlinking the saved card, and then initiate registration in the platform. Each newly registered COF purchase receives a new ID, which is sent to the merchant in the callback with information on successful registration.
Registration procedure
To register a COF purchase, you need to send a request to initiate one of the following operations: sale
, auth
, account verification
, or invoice
and to populate the request with all the parameters required to process the operation and the parameters required to register the COF purchase.
The payment platform initiates and performs the requested operation including any auxiliary procedures which may be required. If credentials are stored on the payment platform, after the operation is successfully completed and is assigned the success
status, a record about debiting series is created on the payment platform. The record is assigned the following attributes:
- ID Once the record about debiting series is created, web service receives its ID in the callback inside the
id
parameter of therecurring
object. You use this ID to perform and to manage COF purchases. - Status Any active debiting series record is assigned the
active
status. The status may change tocanceled
on merchant or customer demand and in some other cases.
If credentials are stored in the web service, a record about debiting series is not created.
The payment platform sends your web service a callback with operation result that contains ID of the debiting series record, if this record has been created. Such callback confirms that COF purchase is successfully registered.
Registration when credentials are stored by web service
There are several things you must consider when performing a COF purchase with customer instrument credentials stored by web service:
- You need to use a POST request to one of the following endpoints:
- /v2/payment/card/sale—when processing a one-time one-step purchase
- /v2/payment/card/auth—when processing a one-time two-step purchase
- /v2/payment/card/account_verification—when verifying the payment instrument
- /v2/payment/card/account_verification/token when verifying the payment instrument with the use of a token
- Your request must contain all the required parameters and objects.
- Also, your request must include the
stored_card_type
parameter and specify COF purchase type by using one of the following values:3
—autopurchase5
—regular purchase (except for requests to the endpoint /v2/payment/card/account_verification/token).
Thus, along all the required parameters, complete request must contain registration flags for selected COF purchase.
The payment platform includes the COF purchase registration information in its operation result callback to your web service. The payment platform uses the standard format for callbacks. For more information, see Callbacks.
Registration when credentials are stored by the payment platform
There are several things you must consider when performing a COF purchase with customer instrument credentials stored by the payment platform:
- You need to use a POST request to one of the following endpoints:
- /v2/payment/card/sale—when processing a one-time one-step purchase
- /v2/payment/card/auth—when processing a one-time two-step purchase
- /v2/payment/card/account_verification—when verifying the payment instrument
- /v2/payment/invoice/create—when initiating a payment link purchase
- /v2/payment/invoice/card/token/create—when initiating a payment link purchase with the use of a token
- Your request must contain all the required parameters and objects.
- Also, your request must include a
recurring
object with the parameters of the COF purchase to register:register
—COF purchase registration flag; usetrue
value to have the COF purchase registered.type
—type of the COF purchase to register, possible values:C
—one-click purchaseU
—autopurchaseR
—regular purchase
time
—time of subsequent debiting for regular purchase inhh:mm:ss
formatperiod
—debiting period for regular purchase:D
—dailyW
—weeklyM
—monthlyQ
—quarterlyY
—yearly
- You can also use other parameters of the
recurring
object:expiry_year
—expiration year of the COF purchaseexpiry_month
—expiration month of the COF purchaseexpiry_day
—expiration day of the COF purchaseinterval
—multiplicator to increase debiting period, for example if you need to run debiting every third week, you can setperiod
toW
andinterval
to3
. Possible values: from1
to100
amount
—amount to debitstart_date
—date to perform the first debitscheduled_payment_id
—identifier assigned to the payment within which scheduled debits are performed; it must differ from the identifier of the payment made to register a COF purchase and must be unique within the project; (also, not to be confused with the debiting series record identifier specified in theid
parameter of therecurring
object that is passed in the callback with the COF purchase registration information)Warning: If the identifier that should be assigned to the COF purchase (scheduled_payment_id
) matches the identifier of the payment made to register a COF purchase (payment_id
), the request to register a COF purchase is declined.
Thus, along all the required parameters, complete request must contain registration flags for selected COF purchase and its type; for regular purchases, request must also contain debiting schedule.
Depending on the specific characteristics of providers involved in payment processing, the set of required parameters can vary. For the detailed information about the providers' requirements, contact the ecommpay key account manager.
The payment platform includes the COF purchase registration information in its operation result callback to your web service. The payment platform uses the standard format for callbacks. For more information, see Callbacks.
The following callback contains information about successful registration of a COF purchase with a debiting series record identifier 1001648059
.