The translation was generated automatically and may contain mistakes

How to check transaction status

This section is intended for developers who have already connected VK Pay.

If you want to connect and start accepting payments through VK Pay, write to vkpay_solutions@vk.team .

More about the service - in the section About VK Pay .

With help Payment system API (hereinafter referred to as the system API), you can specify the status of the transaction when conducting payments and returns . For this purpose:

  1. 1.
    Send a request to the system API Form the body of the request, sign it and send it POST Request by URL: https://api.money.mail.ru/money/2-03/transaction/status .
  2. 2.
    Get a payment system response : check his signature and process the data.
  3. 3.
    Get a payment notice with the results of the transaction and respond to it: form a response body with data on the success or failure of processing the notification, sign the response and send it to the payment system.

Step 1. Send a request for the status of the transaction

  1. 1.
    Form the request body with the transaction ID in the parameter transaction_id .
  2. 2.
    Sign the request . When concatenating in step 3, use the relative request URL: /money/2-03/transaction/status .
  3. 3.
    Send the system API POST Request by URL: https://api.money.mail.ru/money/2-03/transaction/status .

Query parameters

Parameter
Type
Description
transaction_id Mandatory
string
Transaction ID (payment or refund). Format: UUID by RFC 4122 .

Example body Requesting the transaction status

JSON
{ "transaction_id": "668F9F5C-FB00-11E8-B50F-025A0E4FD3B8" }

Example of request

?2?The command line $ curl -X POST -d 'signature=2501667f7589a9d0991c1453de88a9c75e381239&data=eyJib2R5Ijp7InRyYW5zYWN0aW9uX2lkIjoiNjY4RjlGNUMtRkIwMC0xMUU4LUI1MEYtMDI1QTBFNEZEM0I4In0sImhlYWRlciI6eyJjbGllbnRfaWQiOjY5MTQ0NywidHMiOjE1Njg3OTc3MzF9fQ%3D%3D&version=2-03' https://api.money.mail.ru/money/2-03/transaction/status

## Шаг 2. Получите ответ платёжной системы на запрос о статусе транзакции [Проверьте подпись ответа](pay/seller/response/sign) и обработайте данные. При успешной обработке запроса платёжная система вернёт [тело ответа](#Пример%20body%20ответа%20на%20запрос%20о%20статусе%20транзакции). При [ошибке обработки запроса](pay/seller/response#Структура%20заголовка%20header%20при%20ошибке%20обработки%20запроса) платёжная система вернет заголовок в формате JSON [с описанием и кодом ошибки](#Ошибки%20при%20запросе%20статуса%20транзакции). ### Пример `body` ответа на запрос о статусе транзакции ```JSON { "transaction_id": "668F9F5C-FB00-11E8-B50F-025A0E4FD3B8", "action": "stop", "action_param": { "status": "success" } }

Object Fields body Response to the transaction status request

Field
Type
Description
transaction_id
string
Transaction ID on the payment system side. Format: UUID by RFC 4122 .
action
string
Scenario of further actions on payment. Values available: • redirect The user must be redirected to the URL link for payment. • wait The system waits for the transaction to complete. Request transaction status with a reasonable interval method POST /transaction/status until the status changes. • offline The system expects an offline payment. Request transaction status with a reasonable interval method POST /transaction/status until the status changes. • stop — the transaction status is final, the status value is contained in status.action_param . • need_data The system waits for the user to enter the data.
action_param
object
Set of fields for action . Depending on the scenario, it may come back empty.
pay_method
string
The payment method.

Object Fields action_param

Set of fields for action . Depending on the scenario, it may come back empty.

Field
Type
Description
order_id
string
Order ID for offline payment. Return to Scenario action = offline .
url
string
URL to move to an external payment system or to the next step on the VK Pay payment system side. Transferred by action = redirect .
status
string
Further clarification of the status of action = stop . Possible values: • success The transaction is successful • fail The transaction is unsuccessful
user_choice
object
decline_reason
string
Reason for cancellation of transaction.
is_reverse
boolean
A sign that a refund has been made on this transaction. Possible values: • true - the transaction has been returned. • fail There was no return.
externalPaymentUrl
string
URL when paying through the service YuMoney and the mobile application Sberbank Online (SBOL).
externalTransactionNumber
string
Transaction ID from the YuMoney service when paying through the YuMoney service and the Sberbank Online mobile application (SBOL).

Object Fields user_choice

Fields for user input. They come back inside object action_param .

Field
Type
Description
input
array
Set of fields for user input. Return to Scenario action = need_data . More specifically, in description of the object input .
update_key
string
A constant for transmitting user input data to POST -request /transaction/update . Mandatory field for the script action = need_data .
extra
string
Additional fields.

Object Fields input

Fields for user input. They come back inside object user_choice.action_param .

Field
Type
Description
name
array
Set of fields for user input. Return to Scenario action = need_data .
validator
string
A regular expression to check the values the user has entered.
hint
string
A hint for the user.
required
boolean
Possible values: • true The user must enter the data. • false Data entry is optional.

Step 3. Reply to Payment Notification

After the transaction, the payment system will return payment notice with result. Check the signature of the notification using the public key of the payment system, which you received when you connected. Decipher the notification data, process and send the system API response successful processing or error.

Errors in Requesting Transaction Status

Mistake
Description
ERR_NOT_FOUND
Transaction with such identifier is not found. Check the value sent in the request transaction_id And try again.
ERR_PAY_METHOD_NOT_FOUND
The payment method that was specified during the transaction was not found.
ERR_PAY_METHOD_DISABLED
The payment method that was specified during the transaction is disabled or unavailable. Please contact technical support at vkpay_solutions@vk.team .