The request used for making a refund is refundOrder
.
Use the following URL to connect to the Test Service (WSDL):
https://3dsec.sberbank.ru/payment/webservices/merchant-ws?wsdl.
Orders that initiate recurring payments cannot be reversed and refunded, as in these cases there is no real debiting.
Upon this request, the funds for the specified order are to be returned to the payer. The request will end with an error if the funds have not been debited for this order.
To process a refund operation, it is necessary to have the corresponding permissions in the system.
In this document, the following data type conventions are used when describing request and response parameters:
The request parameters are given in table below.
Name | Type | Mandatory | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
|
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. |
|||||||||
|
N..12 | Yes |
The refund amount in the order currency. The amount can be equal to or less than the order remaining amount. |
|||||||||
|
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. |
|||||||||
|
See column with the description. | No |
Additional tag with the attributes for passing additional parameters.
The fields for additional information and its subsequent storage. These fields can be submitted for processing by the bank for further display in the registers. By default, the order number
Enabling the functionality is possible upon agreement with the Bank during the integration period. To pass N parameters, a request must contain N
It is forbidden to pass reserved names in the parameter (if they are passed, the order may be rejected):
|
The response parameters are given in table below.
Name | Type | Mandatory | Description |
---|---|---|---|
|
ANS..3 | No |
Error code. |
|
|
No |
|
Error code | Error text |
---|---|
0 |
The request has been processed without system errors. |
5 |
Access denied. |
5 |
The user must change the password. |
5 |
|
5 |
Incorrect amount. |
6 |
Wrong order number. |
7 |
Payment must be in the correct state. |
7 |
The refund amount exceeds the debited amount. |
7 |
System error. |
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:mer="http://engine.paymentgate.ru/webservices/merchant"> <soapenv:Header/> <soapenv:Body> <mer:refundOrder> <order language="ru" orderId="4302d369-a5e8-4432-a5e5-42acfab52c86" refundAmount="20000"> <!-- Zero or more repetitions: --> <params name=" " value=" "/> </order> </mer:refundOrder> </soapenv:Body> </soapenv:Envelope>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <ns1:refundOrderResponse xmlns:ns1="http://engine.paymentgate.ru/webservices/merchant"> <return errorCode="7" errorMessage="The refund amount exceeds the debiting amount"/> </ns1:refundOrderResponse> </soap:Body> </soap:Envelope>