Auto payment from the inside: How recursives work

Carding Forum

Professional
Messages
2,788
Reaction score
1,297
Points
113
Hello Habrahabr!

We have recently launched a recurring payment service and would like to share their internal structure with you. Basically, recurring payments are a series of recurring payments. The principle of their operation is simple: when making the first (parent) payment, a recurrent template is registered in the database and assigned a unique identifier. All repeated debits are made using this template - the merchant gives a command to his service provider, indicating the recurrent identifier and the payment amount, and the service provider initiates the debiting of funds from the user's card.

The user himself only needs to accept the offer once, where it is indicated for what and with what frequency the funds will be debited.

In general, the whole process can be divided into two stages -registering a recurring payment template and re-debiting the recurring payment. Let's show using the example of using the Payler Gate API:

1. Registering a template​

In the StartSession payment initialization request , set the value of the optional recurrent parameter to true :
e8aab058b06446cd8bef1c338d30d3d1.jpg


In response to the successful execution of the transaction, the identifier of the created recurrent payment template recurrent_template_id will be received . It can also be obtained by running a GetStatus request , specifying the key (merchant identifier) and order_id parameters . An example of a response for a successful request:
b7352372947a4270800c3aab0d39d1b4.jpg


2. Re-write-off​

After successful registration of the template, you can perform repeated debits without the participation of the cardholder. To do this, run a query RepeatPay, specify the following parameters:
key - an identifier merchant
order_id - order ID in the merchant system
amount - payment amount in kopecks (may be different from the first payment)
recurrent_template_id - ID recurrent payment template

Example response for a successful query:
410f10afe4b7492c8134f3ac836bd431.jpg


Templates can be register several, and information on each of them can be obtained through the GetTemplate request(it is obligatory with the indication of the template identifier, otherwise information about all templates existing at the merchant will be sent in response). If the request is successfully completed, the merchant will receive a response containing the following parameters:

recurrent_template_id - an unchanged string
created - the date and time of the template registration
card_holder - the name of the card holder to which the
template is bound card_number - masked card number
expiry - card validity period (by default, it is created for the entire card expiration date)
active - template activity (with values true or false)

And an example of a response to a successful request:
ad3f955aae8a4c279c94555845ccc653.jpg


By the way, the ActivateTemplate query will help you to activate or deactivate the template, in which you need to specify only three parameters - key, recurrent_template_id and active, with the value true if the template needs to be activated, or false - if deactivated.

As you can see, everything is very simple. A little later, we will continue to cover the topic of auto payments and write another post.

We would like to note that the recurrent service is free for our merchants. At this stage, the service is provided by Bank.

We will be glad to receive your questions and comments!
 
Top