Инструменты страницы
Request for order payment (paymentOrder)
The request used for payment for an order is paymentOrder
.
The Payment Gateway supports usage of both internal and external MPI.
Validation of card data occurs in accordance with the table:
Name | Meaning | Validation |
---|---|---|
pan | N..19 | Card validation (check whether the card number is valid), the number of digits in the card number from 13 to 20 |
cvc | CVC code | 3 digits |
year, month | Year, Month | Present or future date If the card is valid until the current year of the current month, payment is possible before the end of the calendar month |
cardholderName | Cardholder | Not tested |
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.
Internal MPI
Request parameters:
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. |
|||||||||
|
N12…19 | Yes |
Payment card number. |
|||||||||
|
N3 | Yes |
CVC/CVV2 code on the back of the card. |
|||||||||
year | N4 | Yes | The last year of the expiration period of the card. | |||||||||
month | N2 | Yes | Month of the billing period in the MM format. |
|||||||||
|
A..200 | Yes |
Cardholder's name in Latin characters, if available. |
|||||||||
|
A2 | Yes |
Language in the ISO 639-1 encoding. If the language is not specified, the default language defined in the store settings is used. |
|||||||||
|
ANS..39 | No |
IP-address of the buyer. IPv6 is supported in all requests (up to 39 characters). |
|||||||||
|
ANS..40 | No |
Customer's email address. |
|||||||||
|
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):
|
|||||||||
|
See description | No |
Customer's registration data (street address, postal code). Required for AVS/AVV checks. Mandatory if «AVS/AVV use allowed» permission is enabled for merchant |
billingPayerData
billingPayerData block parameters
Name | Type | Mandatory | Description |
---|---|---|---|
|
AN..50 | No |
City registered for the card at the Issuer Bank. |
|
AN..50 | No |
|
|
AN..50 | No |
Address registered for the card at the Issuer Bank. Line 1. Mandatory if «AVS/AVV use allowed» permission is enabled for merchant. |
|
AN..50 | No |
Address registered for the card at the Issuer Bank. Line 2. |
|
AN..50 | No |
Address registered for the card at the Issuer Bank. Line 3. |
|
AN..50 | No |
Postal code registered for the card at the Issuer Bank. Mandatory if «AVS/AVV use allowed» permission is enabled for merchant. |
|
AN..50 | No |
State registered for the card at the Issuer Bank (ISO 3166-2). |
*By default, the orderNumber and description fields are passed to the bank's processing system (no more than 99 characters, %, +, carriage return \r and line feed \n cannot be used)
Response parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
|
ANS..3 | Yes |
Error code. |
|
|
No |
|
|
ANS..* | No |
On a successful response. Result of a payment attempt. The available values are presented below.
|
|
ANS..* | No |
On a successful response. In the case of a payment without the need for authentication to the ACS – URL to which redirect is performed after the payment. In case of a 3D-Secure payment, the URL to return to ACS. |
|
AN..512 | No |
Redirect address to the address of the ACS server. Not used for payments that do not require additional authentication on the issuing Bank's ACS. |
|
AN..512 | No |
Request for the payer authentication. Not used for payments that do not require additional authentication on the issuing Bank's ACS. |
Error codes
Error code | Error text |
---|---|
0 | Request processing took place without system errors |
5 | Access denied |
5 | The user must change the password |
5 | The maximum number of payments attempted run out or the session timeout expired |
5 | Data validation error |
7 | System error |
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:paymentOrder> <order orderId="09808814-eb60-4cea-86bb-ed849dbe7ae9" year="2015" month="12" pan="4111111111111111" cvc="123" cardholderName="A Moriarty" language="ru" ip="?"> <!-Zero or more repetitions:-> <params name="name" value="value"/> </order> </mer:paymentOrder> </soapenv:Body> </soapenv:Envelope>
An example of a response in case of a payment that does not require additional authentication on the ACS of the Issuing Bank:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <ns1:paymentOrderResponse xmlns:ns1="http://engine.paymentgate.ru/webservices/merchant"> <return info="Your payment has been processed, redirecting..." redirect="www.ya.ru?MDORDER=6d295b5b-84c3-44cd-adea-c0eaca122465&ANSWER=%3C%3Fxml+version%3D%221.0%22+encoding%3D%22UTF-8%22%3F%3E%0A%3CPSApiResult+primaryRC%3D%220%22+secondaryRC%3D%220%22%2F%3E&STATE=payment_deposited&ACTION_CODE=0&AUTH_CODE=2" errorCode="0"/> </ns1:paymentOrderResponse> </soap:Body> </soap:Envelope>
An example of a response in case of a 3DS payment that requires additional authentication on the ACS of the Issuing Bank:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <ns1:paymentOrderResponse xmlns:ns1="http://engine.paymentgate.ru/webservices/merchant"> <return errorCode="0" info="ВYour payment has been processed, redirecting..." redirect="https://test.paymentgate.ru:443/testpayment/rest/finish3ds.do" acsUrl="https://test.paymentgate.ru/acs/auth/start.do" paReq="eJxVUk1zgjAQ/SsM95KEr1pnjUOLnXqgYxUvvVHYAVQ+DFDUX99EUeshM/t2N2/3vQSmh2Kn/aJo8qqc6MyguoZlXCV5mU70dfj+NNKnHMJMIPorjDuBHAJsmihFLU8metGkBtM5LLwl7jkMTFwSGSaQK5RXRJxFZcshivev809uWzazHCADhALF3OfMtGzHfR4BuWAoowJ5iE27yqoayBlCXHVlK47ctS0gVwCd2PGsbesxIX3fG2lVpTs04qoAokpA7jssOhU1kuqQJzzwvf5yZqdPf0uDcHsM/C8WnNIJENUBSdQiNykzGaWOxujYpmNqAznnISrUDtx1XUqloguCWg3xHkr/UyC9FNLqq4wrAjzUVYmyQ/p3iyHBJr4ZodWDALmBygO5K3r7UB7HrXRvnXxvhdufxGKUdH34kiUb15mZ3k+3WSrnz01qXi79Yw67DFQAiKIhw6OS4cFl9PAR/gAOWr9V"/> </ns1:paymentOrderResponse> </soap:Body> </soap:Envelope>
If the payment requires the use of 3-D Secure technology, then once the response to order payment request is received, the Customer must ne redirected to ACS. There are two ways to redirect: standard and simplified (see table below).
Redirect types | Description | |
---|---|---|
Standard | To redirect to ACS the merchant must send to the customer to the address specified in the acsUrl parameter with the request body MD=mdorder&PaReq=pareq&TermUrl=redirect, where:
The request must be in POST format. Depending on the connection scheme used, the Customer after being authenticated on ACS will be redirected to the Payment Gateway or to the Store. The payment completion processes for each of these cases are described below. |
|
Simplified |
In order for the Customer to get to the ACS page, the Merchant redirects him to the Payment Gateway page with the following URL pattern: Please remember to include api. before the domain name.
< |
In case of an incorrect payment attempt, the gateway returns the following response.
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <ns1:paymentOrderResponse xmlns:ns1="http://server/webservices/merchant"> <return info="Operation declined. Please check the data and available balance of the card and retry." redirect="https://yandex.ru?orderId=39f1f59f-1836-7195-8452-1f6900003ad4&lang=ru" errorCode="0"/> </ns1:paymentOrderResponse> </soap:Body> </soap:Envelope>
The redirect URL is the value passed in the failUrl
parameter (or returnUrl
, if failUrl
is missing).
If payment attempts are exhausted, the gateway returns the following response.
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <ns1:paymentOrderResponse xmlns:ns1="http://engine.server.ru/webservices/merchant"> <return errorCode="5" errorMessage="Max payments attempted or session timeout occurred"/> </ns1:paymentOrderResponse> </soap:Body> </soap:Envelope>
Return from ACS to Payment Gateway. Standard scheme.
The issuer's ACS authenticates the cardholder and redirects the client to the payment gateway while passing PARes. The payment gateway authorizes the order if the client is successfully authenticated on ACS, or rejects the pre-authorization if the client is not successfully authenticated on the ACS.
Returns from ACS to the store. Scheme involving additional Finish 3DS method
The Issuer's ACS authenticates the cardholder and redirects the Customer back to the Store. The PARes received from ACS is passed to the Store, then the Store passes it to the gateway using the finishThreeDS
method.
Description of finishThreeDS
method is given below:
Request parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
|
AN..30 | Yes |
Order number received on its registration. |
|
ANS | Yes |
Response to the payer's authentication request. |
Response parameters:
Name | Type | Mandatory | Description |
---|---|---|---|
|
ANS..512 | Yes |
The URL to which the user is to be redirected in case of a successful payment (and also in case of a failed payment where the |
|
ANS..3 | No |
Error code. |
|
|
No |
|
If errorCode=0 and info=«Your order is proceeded, redirecting» – payment was successful. In other cases with an error see the errorMessage
message.
Error codes (errorCode
field):
Error code | Error text |
---|---|
0 | Request processing took place without system errors |
5 | Access denied |
5 | The user must change the password |
7 | Order is not found |
7 | System error |
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:finishThreeDs> <request language="ru" md="8b5b7ee5-eb5a-4cf4-81ec-7153f7ca2864" paRes="eJzFV2mzokoS/Ssd/T4at1kEkRe0EcW+WCCLgH5jBwVRWfXXD2r37ft6eiZ6ZuLFEGFYnKjMypOZp4pinPyaJLydRN01WTEwaZogSz4V8dfPi/k8JKg5+kahYfBGYPjyLcRD+i2g8GWEzRdBvEA/r5gNsJLmZZAuyZBOF28EkU4GwWQaYAk6vS5CFMXxJUlGk0GfXJuiPq2wL+gXnEG+v05rX6M8OLUrJogurKKvCJxaoCiDfHtlquSq8CuKQV4DBvlhsekeo2ZiMBbxCvJgeP0EVOeFucFnI7xnN3iAXxnkMYOJgzZZ4ShGojRKf8KwPwn8T2zJIE+cOT/cgaruJt8kSVJLmkE+YsyUrWtyim6rBTFnkPc3JhnP9SmZZkzE3scM8iO8c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cJHLcgNCi7rsk2MeVpQWUVuKqOrZ6ZZDO7OaPSMu3i5zTT+s8a0aaGCipQFhRMQr/++n4yO2Pk0VgkcHkIAD/8mSBd7RPp6ovAtea407QOq4jqKejJ1b5FVPNppD3FiFnKXaXziiYB3mejm2na5q0pQrphEVwvNcnhRaoI8nZ2tq1D0VpuMt83h3PzgzX8hbvacINCxbZnLPM8DrRh2CnD2k6coG4KQ+zPdbJTlljBrsVGyXa5bgx6woxZzfa2WvndjXG8sL81cmC/PgeRN6/EX98PT6vnc9L8uOe9PHy/A9JE/bD"/> </mer:finishThreeDs> </soapenv:Body> </soapenv:Envelope>
Response example:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <ns1:finishThreeDsResponse xmlns:ns1="http://engine.paymentgate.ru/webservices/merchant"> <return errorCode="0" returnUrl="http://ya.ru?orderId=8b5b7ee5-eb5a-4cf4-81ec-7153f7ca2864"/> </ns1:finishThreeDsResponse> </soap:Body> </soap:Envelope>