Single-request payment
You can send a payment as single request, with no interim steps (if they are not necessary). You will shortly get the payment result in response.
This option can work if:
- you have the PCI DSS certificate
- you don't use the payment form widget
Here, a payment with immediate capture is described. More about delayed capture payments
How to enable
For such payments, there is a special method, session/init/payment/sync
. Inform the Bank 131 manager that you want to use it.
In this case, you will not receive webhooks from Bank 131. You can learn the transaction status with the session/status
request.
How to perform a payment
Send a session/init/payment/sync
request.
Please be aware that we do not recommend implementing this method unless you have already used it before.
In the payment_method.type
field, specify card
. In the bank_card
object, specify user bank card details. In the payment_options.return_url
field, specify the address to which the user should be redirected after the payment is processed (it is required).
The payment result will be returned in response to the request in the payment.status
field:
succeeded
– the payment has completed successfullyfailed
– the payment has not gone through because of an errorpending
– the user needs to go through 3D Secure verification
Request example
- cURL
curl -X POST \
https://proxy.bank131.ru/api/v1/session/init/payment/sync \
-H 'Content-Type: application/json' \
-H 'X-PARTNER-PROJECT: your_project_name' \
-H 'X-PARTNER-SIGN: signature' \
-d '{
"payment_details": {
"type": "card",
"card": {
"type": "bank_card",
"bank_card": {
"number": "4242424242424242",
"expiration_month": "01",
"expiration_year": "22",
"security_code": "123"
}
}
},
"amount_details": {
"amount": 10000,
"currency": "rub"
},
"customer": {
"reference": "lucky"
},
"payment_options": {
"return_url": "https://131.ru"
}
}'
If no result is returned
Sometimes, the final payment status is not returned in response to a request. For instance, if a payment is being processed for a very long time or the user card requires 3D Secure.
Too long payment
If payment processing lasts more than 40 seconds, the in_progress
intermediate payment status will be included in the response.
To learn the final payment status, send a session/status
request.
3D Secure card
If a user card requires 3D Secure, redirection details will be returned in response to the request. Redirect the user to customer_interaction.redirect.url
.
After that, send a session/status
request to learn the final payment status.