The translation was generated automatically and may contain mistakes
How to request transaction information
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 request transaction information when conducting payments and returns . For this purpose:
- 1.Send a request to the system API Form the body of the request, sign it and send it
POSTRequest by URL:https://api.money.mail.ru/money/2-03/transaction/get. - 2.Get a payment system response : check his signature and process the data.
- 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 transaction information
- 1.Form a request body with one parameter: transaction ID
transaction_idthe transaction ID on your sideissuer_idor the transaction ID on the payment system sidetxn_id. - 2.Sign the request . When concatenating in step 3, use the relative request URL:
/money/2-03/transaction/get. - 3.Send it
POST-request to the system API by URL:https://api.money.mail.ru/money/2-03/transaction/get.
Query parameters
In the request, you must pass at least one of the parameters: transaction_id , issuer_id , txn_id .
Parameter | Type | Description |
|---|---|---|
transaction_id | string | Transaction ID (payment or refund). Format: UUID by RFC 4122 . |
issuer_id | string | The transaction ID is on your side. |
txn_id | string | Transaction ID on the payment system side. |
Example body to request transaction information
{
"transaction_id": "8678B2BC-4E57-11EF-9F49-267810E93B89"
}Example of request
?2?The command line $ curl -X POST -d 'version=2-03&data=eyJib2R5Ijp7InRyYW5zYWN0aW9uX2lkIjoiODY3OEIyQkMtNEU1Ny0xMUVGLTlGNDktMjY3ODEwRTkzQjg5In0sImhlYWRlciI6eyJ0cyI6MTcyMjMzMzU1OSwiY2xpZW50X2lkIjozMTAyMDh9fQ%3D%3D&signature=76e29db9b1e1d43d863aec826bebc422f4166e0d' https://api.money.mail.ru/money/2-03/transaction/get
## Шаг 2. Получите ответ платёжной системы на запрос информации о транзакции
[Проверьте подпись ответа](pay/seller/response/sign) и обработайте данные.
При успешной обработке запроса платёжная система вернёт [тело ответа](pay/seller/response#Структура%20заголовка%20header%20при%20успешной%20обработке%20запроса).
При [ошибке обработки запроса](pay/seller/response#Структура%20заголовка%20header%20при%20ошибке%20обработки%20запроса) платёжная система вернёт заголовок в формате JSON [с описанием и кодом ошибки](#Ошибки%20при%20запросе%20информации%20о%20транзакции).
### Пример `body` ответа на запрос информации о транзакции
```JSON
{
"amount": "7.00",
"currency": "RUB",
"transaction_id": "8678B2BC-4E57-11EF-9F49-267810E93B88",
"issuer_id": "8419575_vk_id",
"txn_id": "",
"user_info": {
"beneficiary_id": "746905200",
"buyer_ip": "123.12.123.123",
"user_id": "220005200",
"user_verified": true
},
"keep_uniq": "1",
"pay_method": "vkp_card",
"pay_method_info": {
"payer_id": "214905200",
"skin": "VK_WALLET",
"recipient": {
"client_id": "3103408"
},
"sender": {
"currency": "rub",
"amount": "7.00"
}
},
"gate_response": {
"txn_id": ""
},
"description": "Оплата ?1?’Контакте",
"merchant_param": {
"currency": "RUB",
"amount": "7.00"
},
"social_auth": {
"vk": "119605200"
}
}
Object Fields body Response to request for transaction information
Field | Type | Description |
|---|---|---|
transaction_id | string | The transaction ID. Format: UUID by RFC 4122 . |
notify_type | string | Type of notification.
Contains the meaning: transaction_status . |
added | string | Date and time of creation of the transaction in format Unix Timestamp . It is calculated according to Moscow time (GMT+3). |
user_info | object | Information about the user. More details in the description object user_info . |
issuer_id | string | The order ID is on your side. |
txn_id | string | Order ID on the payment system side. |
keep_uniq | boolean | The service field. |
amount | number | Amount of payment. It takes a positive value when receiving funds and a negative - when writing off. Example: -21.05 |
currency | string | Currency of payment by ISO 4217 . |
payee_amount | number | Amount of credit, including commission. Example: -21.05 |
payee_fee_amount | number | The amount of the payment recipient’s commission. Example: -21.05 |
payer_amount | number | Amount of write-off, including commission. Example: -21.05 |
payer_fee_amount | number | The amount of the commission of the sender of payment. Example: -21.05 |
description | string | Description of payment. |
virtual_amount | number | Amount in game currency. Example: -21.05 |
virtual_currency | string | The game currency code. |
status | string | status of the transaction. Possible values:
• new A new transaction. Request transaction status with a reasonable interval method POST /transaction/status .
• rejected Payment rejected, the money returned to the payer.
• paid — payment is successful (the status is final), the money is credited to the recipient’s account.
• expired - the life of the payment in the system has expired, the money has returned to the payer. It can return if, when forming the payment, the life time was limited in the parameter ttl .
• held — payment is blocked (for two-stage payments).
• hold_failed — it was not possible to write off the amount of payment, the money was returned to the payer (for two-stage payments).
• hold_canceled Cancellation of payment, commission is not charged (for two-stage payments).
• wait The transaction is rejected, but the cause is still unknown. Request transaction status with a reasonable interval method POST /transaction/status .
• process The transaction is still being processed. Request transaction status with a reasonable interval method POST /transaction/status . |
expires | string | The date and time when the life of the transaction will end, in the format Unix Timestamp . It is calculated according to Moscow time (GMT+3). Relevant for unfinished transactions. |
pay_method | string | Method of payment. |
pay_system_name | string | The name of the payment system. |
bind_id | string | Binding ID in case of a binding payment. Format: UUID by RFC 4122 . |
payment_info | object | Payment information on the payment system side. More details in the description object payment_info . |
store_info | object | Additional parameters transmitted by you in response to payment notification . |
merchant_param | string | Additional parameters that you passed on during the transaction. |
paid | string | Date and time of payment in format Unix Timestamp . It is calculated according to Moscow time (GMT+3). |
merchant_id | integer | Identification of the recipient of the payment. |
merchant_name | string | Name of the recipient of the payment. |
decline_reason | string | Reason for rejection of payment. If you want this field to return, write to technical support at vkpay_solutions@vk.team .
Format: string or structure in the form {code = "Код ошибки", descr = "Описание"} . |
refund_for | string | The return transaction ID. It is present when the payment is returned. |
refunds | string | Information on refunds for the current transaction. |
gate_response | string | Contains txn_id Transaction ID on the payment system side. |
social_auth | object | User IDs on social networks. Possible parameters in the format string :
• vk The user ID is VKontakte>
• ok User ID in Classmates.
• mm User ID in My World social network. |
Object Fields user_info
The object returns inside.. the answer bodies It contains information about the payer.
Field | Type | Description |
|---|---|---|
user_id | string | A user ID on your side (e.g. email, ID, username, phone number).
Minimum length: 1 symbol |
buyer_ip | string | IP address of the user. Format: IP version 4 by RFC 791 . |
avatar | boolean | The presence of the avatar of the user: true There is an avatar, false There is no avatar. |
avg_check | number | The average payment check of the user in VK Pay in rubles. |
avg_card_check | number | The average check of the user on bank cards in VK Pay in rubles. |
balance | number | The balance of funds in the user's account in rubles. |
birth_date | string | Date of birth of the user. Format: ДД.ММ.ГГГГ . |
cid | string | ClientID a unique identifier of the session, machine, User-Agent, IP of the user or a combination thereof. |
city | string | City of the user. |
country | string | User country in accordance with alpha-3 ISO 3166-1 .
Length: 3 symbols. |
ip_country | string | User country by IP address according to alpha-3 ISO 3166-1 .
Length: 3 symbols. |
friends | number | The number of friends is VKontakte> Format: A positive integer. |
games | string | The name of the game is VKontakte>
One thought on “Fun Farm?2? |
name | string | User name.
Example: Персик |
surname | string | User's name. |
patronymic | string | User's name. |
nick | string | Name of the character in VK Play. |
payments | boolean | Availability of payments to the user: true - there is, false - No. |
phone | number | Telephone number, including country code.
Template: ^[0-9]{10,16}$ |
phone_country_code | string | Country identified by the user's phone number. Format: in accordance with alpha-3 ISO 3166-1 .
Length: 3 symbols. |
prev_agent | string | User-Agent of the last user login. |
prev_ip | string | IP address of the user's last login. Format: IP version 4 by RFC 791 . |
reg_agent | string | User-Agent during registration. |
reg_date | string | Date of User Registration.
Format: ДД.ММ.ГГГГ . |
reg_email | string | The phone number or email with which the user has registered. |
reg_ip | string | IP address of user registration. Format: IP version 4 by RFC 791 . |
reg_ip_country | string | The country of registration of the user, defined by IP, in accordance with alpha-3 ISO 3166-1 .
Length: 3 symbols. |
reg_time | string | Registration time. It is calculated according to Moscow time (GMT+3).
Format: ЧЧ:ММ:СС |
sex | string | User's gender. Possible values: w - woman, m - a man. |
user_verified | boolean | Confirmation of User Authorization ( user_id ) on your part: true Confirmed, false - not confirmed. |
shown_id | string | User ID, which will be displayed in the payment form.
Maximum length: 255 characters. |
hwid | string | The user's device ID is Hardware ID. |
passport_full | string | Passport data of the user: series, number, by whom and when issued. |
reg_address_full | string | User registration address. |
tax_id | number | The Individual Taxpayer Number (INN). |
beneficiary_id | string | Beneficiary ID. |
benef_reg_date | string | Date of registration of the beneficiary identifier. |
tax_profile_country | string | The country code specified in the user profile, in accordance with alpha-3 ISO 3166-1 .
Length: 3 symbols. |
tax_ip_country | string | The country code specified in the user profile, in accordance with alpha-3 ISO 3166-1 .
Length: 3 symbols. |
tax_phone_country_code | string | Country code defined by the phone number specified in the user profile, in accordance with alpha-3 ISO 3166-1 .
Length: 3 symbols. |
Object Fields payment_info
Object payment_info contains data on the payment side of the payment system.
See the other fields in the description.. object body .
Field | Type | Description |
|---|---|---|
sender | string | Data from the payer. |
recipient | string | Recipient's data. |
payer_id | string | User ID in the payment system. |
date | string | Date and time of payment in format Unix Timestamp . It is calculated according to Moscow time (GMT+3). |
amount | number | The amount of payment in the currency of payment on the payment system side. Example: -21.05 |
currency | string | Currency of payment in the payment system ISO 4217 . |
sms_service | string | Service ID for SMS payments. |
sms_text | string | Text of SMS. |
refund_type | string | Type of return . Returns in response to a refund. Possible values: refund Refund of payment, reversal Cancellation of payment. |
chained_transaction_id | string | Identifier of chain transaction. |
refunded_transaction_id | string | The ID of the cancelled transaction. Format: UUID by RFC 4122 . |
card_payment_amount | number | The amount that will be debited from the bank card. Example: -21.05 |
bonus_payment_amount | number | The amount that will be deducted from the bonus balance (if available). Example: -21.05 |
country | string | Country in accordance with alpha-3 ISO 3166-1 .
Length: 3 symbols. |
mit | boolean | A sign of recurrent payment, such as autopayment, regular subscription payment. Values available:
• 1 - recurrent payment.
• 0 Non-recurrent payment (by default). |
card_rec_id | string | Recurrent payment identifier. Present if the payment is repeated periodically. |
phone_number | string | Phone number. Returns for payment methods where the user needs to specify it. |
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 Information
Mistake | Description |
|---|---|
ERR_NOT_FOUND | Transaction with such identifier is not found. Check the value of the identifier and repeat the request. |
ERR_RETRY | There is no data on this transaction. The system may not have finished pre-processing yet. Repeat the request later. |
ERR_REFUND_FAILED | There was an error during the return. Try to repeat the request. |
ERR_PAY_METHOD_DISABLED | This payment method is disabled or unavailable to you. Please contact technical support at vkpay_solutions@vk.team . |
ERR_BUSY | The system is busy. Try to repeat the request later. |