CIT recurring payments
CIT recurring payments (Customer Initialized Transaction) allow to accept payments and debit money using recurrent token with additional 3DS verification of the customer.
For CIT recurring payments, it is recommended to use the project identifier eligible for 3DS.
How to create a CIT recurring payment
- Initialize a CIT recurring payment session using the
session/init/payment
method, with thepayment_details.recurrent.initiator:client
value and a URL value within thereturn_url
setting to redirect the customer back after the payment complete. - Recieve the
action_required
webhook from Bank 131, that contains the customer redirect data. - Redirect the customer to the URL passed as
customer_interaction.redirect.url
. Note that the redirect method can be GET or POST. - Receive the
payment_finished
webhook from Bank 131. The webhook contains the recurring payment status information. - Note that after completion of 3DS verification, the customer returns to the URL that was passed as
return_url
. According to the method used, POST or GET, you might be required to convert the POST format to GET to avoid possible format processing issues.
Example of the session/init/payment
request to create a CIT recurring payment
curl --location --request POST 'https://demo.bank131.ru/api/v1/session/init/payment' \
--header 'Content-Type: application/json' \
--header 'X-PARTNER-SIGN: sign' \
--header 'X-PARTNER-PROJECT: your_project_name' \
--data-raw '{
"payment_details": {
"type": "recurrent",
"recurrent": {
"token": "token_value",
"initiator": "client"
}
},
"amount_details": {
"amount": 10000,
"currency": "rub"
},
"customer": {
"reference": "lucky"
},
"payment_options": {
"return_url": "https://131.ru"
}
}'
Example of the action_required
webhook
curl -X POST \
https://partner.ru \
-H 'Content-Type: application/json' \
-H 'X-PARTNER-SIGN: a4f1698616d6ad7b8b73a9d72d281eeb443b64dee3f38df430eeed6aa29e1dc' \
-d '{
"type": "action_required",
"session": {
"id": "ps_3230",
"status": "in_progress",
"created_at": "2018-05-27T02:03:00.000000Z",
"updated_at": "2018-05-27T02:03:00.000000Z",
"acquiring_payments": [{
"id": "131",
"status": "pending",
"created_at": "2018-05-27T02:03:00.000000Z",
"customer": {
"reference":"user@131.ru"
},
"payment_details": {
"type": "recurrent",
"recurrent": {
"token": "token_value",
"initiator": "client"
}
},
"amount_details": {
"amount": 10000,
"currency": "rub"
},
"amounts": {
"fee": {
"merchant_fee": {
"amount": 10,
"currency": "RUB"
}
}
},
"customer_interaction": {
"type": "redirect",
"redirect": {
"url": "https://bank131.ru?foo=bar",
"base_url": "https://bank131.ru",
"method": "GET",
"qs": {
"foo": "bar"
},
"params": {
"paReq": "sdfew^//asdhbv",
"MD": "abc75daefnn"
}
}
}
}]
}
}'
Example of the payment_finished
webhook
{
"type": "payment_finished",
"session": {
"id": "ps_3230",
"status": "accepted",
"created_at": "2018-05-27T02:03:00.000000Z",
"updated_at": "2018-05-27T02:03:00.000000Z",
"acquiring_payments": [{
"id": "pm_2705",
"status": "succeeded",
"created_at": "2018-05-27T02:03:00.000000Z",
"finished_at": "2018-05-27T02:03:00.000000Z",
"customer": {
"reference":"lucky"
},
"payment_details": {
"type": "recurrent",
"recurrent": {
"token": "token_value",
"initiator": "client"
}
},
"recurrent": {
"token": "feda2b2106a2e8747bbdc4c9f53c7f5f6ab845ffa1b7cc68ca839720af99b3d1",
"created_at": "2020-07-14T13:17:11+03:00",
"finished_at": "2020-07-31T16:05:42+03:00",
"is_active": true
},
"amount_details": {
"amount": 10000,
"currency": "rub"
}
}]
}
}