Инструменты страницы
Request for recurrent payments (recurrentPayment)
The request used for registering an order is recurrentPayment
In this document, the following data type conventions are used when describing request and response parameters:
- A<n> – a sequence of Latin letters of length <n>;
- A..<n> – a sequence of Latin letters with a length not exceeding <n>;
- N<n> – a sequence of digits of length <n>;
- N..<n> – a sequence of digits with a length not exceeding <n>;
- AN<n> – a sequence of Latin letters and numbers of fixed length <n>;
- AN.. <n> – a sequence of Latin letters and numbers with a length not exceeding <n>;
- ANS<n> – a sequence of Latin letters, numbers and characters of fixed length <n>
- ANS.. <n> – a sequence of Latin letters, numbers and characters with a length not exceeding <n>;
- UTC – date and time, in this case: the date must be passed without specifying the time zone, Moscow time, for the SOAP protocol, the standard encoding xs: dateTime is used.
Request parameters
The request parameters are given in table below.
Name | Type | Mandatory | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
|
AN..30 | Yes |
Login of the service account of the merchant. If login and password are used for authentication during token registration, then the |
|||||||||
|
AN..30 | Yes |
Merchant's service account password. If login and password are used for authentication during token registration, then the |
|||||||||
|
ANS..32 | Yes |
Order number in the store system. |
|||||||||
|
A2 | No |
Language in the ISO 639-1 encoding. If the language is not specified, the default language defined in the store settings is used. |
|||||||||
|
AN..255 | Yes |
Identifier of the binding created earlier. |
|||||||||
|
N..12 | Yes |
Payment amount in minimum currency units. |
|||||||||
|
ANS..255 | Yes |
Identifier of the Customer in the Store system. This parameter is used for the binding functionality. May be present if the store is allowed to create bindings. Specifying this parameter when processing payments with the use of bindings is mandatory. Otherwise, a payment will be unsuccessful. |
|||||||||
|
N3 | No |
ISO 4217 code of the payment currency. If not specified, default value is used. |
|||||||||
|
ANS..512 | No |
Description of the order in free form. To enable sending this field to the processing system, contact the technical support service. |
|||||||||
|
Not applicable | No |
Additional parameters of the order that are stored in the merchant personal account for the subsequent viewing. For each additional parameter, use the
Below is an example of how to use this parameter.
<entry> <key>parameter_1</key> <value>value_1</value> </entry> <entry> <key>parameter_2</key> <value>value_2</value> </entry> If the merchant has fiscalization set up, when indicating email (the buyer's email address) and/or phone (the buyer's cell phone number) as additional parameters, these parameters are first used to send the fiscal receipt. It is forbidden to pass reserved names in the parameter (if they are passed, the order may be rejected):
|
Response parameters
The response parameters are given in table below.
Name | Type | Mandatory | Description |
---|---|---|---|
|
A..5 | Yes |
Designates a successful request. The following values are available:
|
data block (returned only if the request was successful) |
|||
|
ANS36 | Yes |
Identifier of the order in the payment system. It is unique within the system. The identifier is missing if the order registration failed due to an error detailed in errorCode. |
error block (returned only if the request resulted in an error) |
|||
|
N3 | Yes |
Error code. |
description | ANS..512 | Yes | A detailed technical explanation of the error – the contents of this parameter is not to be displayed to the customer. |
|
|
Yes |
|
Error codes
Error code | Error text |
---|---|
0 |
The request has been processed without system errors. |
1 |
The funds on the card are not sufficient. |
1 |
Wrong order number. |
2 |
The binding is not found. |
4 |
Invalid binding identifier |
5 |
Using binding is disabled. |
5 |
Invalid amount |
5 |
Incorrect login. |
5 | Incorrect password |
5 | Authentication error |
7 |
System error. |
10 |
An order with this number has already been registered. |
10 | Incorrect value of [currency] |
10 | Incorrect value of [language] |
10 | Duplicate order number |
10 | Incorrect value of [orderNumber] |
10 | Incorrect value of [orderDescription]. Links in the order description are not allowed |
Examples
Request example
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:mer="http://engine.paymentgate.ru/webservices/merchant"> <soapenv:Header/> <soapenv:Body> <mer:recurrentPayment> <arg0> <orderNumber>123123</orderNumber> <bindingId>binding_id</bindingId> <amount>123</amount> <description>description</description> <additionalParameters> <entry> <key>firstParamName</key> <value>firstParamName</value> </entry> </additionalParameters> </arg0> </mer:recurrentPayment> </soapenv:Body> </soapenv:Envelope>
Example of successful payment
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <ns1:recurrentPaymentResponse xmlns:ns1="http://engine.paymentgate.ru/webservices/merchant"> <return> <success>true</success> <data> <orderId>134561314642</orderId> </data> <orderStatus errorCode="0"/> </return> </ns1:recurrentPaymentResponse> </soap:Body> </soap:Envelope>
Example of unsuccessful payment
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <ns1:recurrentPaymentResponse xmlns:ns1="http://engine.paymentgate.ru/webservices/merchant"> <return> <success>false</success> <error> <code>10</code> <description>An order with this number has already been registered.</description> </error> <orderStatus errorCode="0"/> </return> </ns1:recurrentPaymentResponse> </soap:Body> </soap:Envelope>