Skip to main content

Payments with delayed capture

You can accept payments with an authorization hold: the customer's payment is first placed on hold ("frozen"), and then, on your command, it is captured—either in full or in part. This is convenient, for example, for paying for services after they have been rendered.

Once the feature is enabled, all payments are processed with an authorization hold. The hold period is up to 5 days. If you do not capture the funds or cancel the payment by the end of this period, the payment is automatically returned to the customer. As an alternative to automatic refunds, you can enable automatic capture of the amount after the hold period expires.

To enable authorization hold or set up automatic capture, contact your personal manager at Bank 131.

The procedure depends on the payment method: with or without our widget.

Step 1. Create a payment session​

Send a (session/create) request. In response you will get the session identifier.

Alternatively, you can use the (session/init/payment method to create a session and a payment at the same time. In this case, specify all the payment parameters and skip the next step. This option is not recommended.

Step 2. Start the payment​

Send a session/start/payment request with the session identifier and payment parameters.

Step 3. Wait for a webhook confirming the payment is ready​

Bank 131 will then send you a ready_to_confirm webhook to notify you that you should now confirm or cancel the payment.

Step 4. Confirm or cancel the payment​

Check the data, then confirm (session/confirm) or cancel (session/cancel) the payment.

Step 5. Wait for a webhook on additional actions​

An action_required webhook from Bank 131 arrives if the customer's bank requests 3D Secure authentication or other actions.

Redirect the customer using the link from the customer_interaction.redirect.url parameter to complete 3D Secure authentication.

Step 6. Wait for a webhook confirming that the funds have been placed on hold​

Bank 131 will send you a ready_to_capture webhook once the customer's funds are on hold.

Webhook example
curl -X POST \
https://partner.ru \
-H 'Content-Type: application/json' \
-H 'X-PARTNER-SIGN: signature' \
-d '{
"type": "ready_to_capture",
"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": "pm_2018",
"status": "pending",
"created_at": "2018-05-27T02:03:00.000000Z",
"customer": {
"reference": "user123",
"contacts": [{
"email": "user@gmail.com"
}]
},
"payment_details": {
"type": "card",
"card": {
"last4": "4242",
"brand": "visa"
}
},
"amount_details": {
"amount": 10000,
"currency": "rub"
},
"metadata": "good"
}]
}
}'

Step 7. Capture the amount or cancel the payment​

Capture (session/capture) the full or partial amount (amount_details) or cancel the payment (session/cancel)—the held amount will be returned to the customer.

Step 8. Wait for a webhook on the payment results​

Bank 131 will send you a payment_finished webhook. The payment status is in the acquiring_payments/payment_list array.

If the status is succeeded, the payment went through. If the status is failed, the payment was not processed due to an error.

Sequence diagram​

Payment diagram with holding