Инструменты страницы
Request for payment using Apple Pay (payment.do)
The request used for registering an order is «payment.do» (see below). |
https://3dsec.sberbank.ru/payment/applepay/payment.do |
Use the standard requests to the payment gateway for the operations of reversal, refund and payment completion.
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.
It is necessary to add to the request a header with the definition of the type of contents – «Content-Type: application/json» to ensure that the request is processed correctly.
Name | Type | Mandatory | Description |
---|---|---|---|
|
AN..255 | Yes |
Merchant login in the payment gateway. |
|
ANS..32 | Yes |
Number (identifier) of the order in the store system. It is unique for every store within the Payment Gateway. If the order number is generated on the Payment Gateway side, this parameter is not mandatory. |
|
ANS..512 | No |
Description of the order in free form. To enable sending this field to the processing system, contact the technical support service. |
|
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. |
|
ANS..255 | No |
Identifier of the Customer in the Store system. Used to implement the functionality of bindings. |
|
Not applicable | No |
Additional parameters of the order that are stored in the merchant personal account for the subsequent viewing. Additional parameters must be specified in the following format. «parameter_name»: «parameter_value» Each new pair of a parameter name and its value must be separated by a comma. 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):
|
|
A..5 | No |
Parameter that defines the necessity of a pre-authorization (putting the amount on hold on the customer's account until its debiting). The following values are available:
If the parameter is not specified in the request, a one-phase payment occurs. Two-phase payments functionality is available if specifically requested by Merchant from the bank. This parameter can be passed either as a boolean value (without quotation marks) or as a string (with quotation marks). |
|
AN..8192 | Yes |
The
|
|
ANS..512 | No |
This parameter enables dynamic callback functionality. In it, you can pass the address to which all «payment» callback notifications activated for the merchant will be sent. Payment-related notifications are callback notifications about the following events: successful hold, payment rejected by timeout, cardpresent payment rejected, successful debiting, refund, reversal. Notably, payment-unrelated callbacks that are active for the Merchant (enabling/disabling a binding, binding creation) will be sent to static callback URL. |
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. Missing if 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 |
|
The OrderStatus element contains order status parameters and is returned only if the payment gateway recognized all request parameters as correct. See the list of nested parameters below. |
|||
|
ANS..3 | No |
Error code. Can be missing if the result has not caused an error. See description of error codes on this page. |
|
ANS..32 | No |
Number (identifier) of the order in the store system. It is unique for every store within the Payment Gateway. If the order number is generated on the Payment Gateway side, this parameter is not mandatory. |
|
N1 | No |
The order status in the payment system is defined by the value of this parameter. It is missing if the order has not been found. The following values are available:
|
|
N..5 | No |
Processing code Full list of processing response codes and description of these codes is available on a separate page. |
|
AN..512 | No |
Description of the response code in the language that is passed in language parameter of the request. |
|
N..12 | No |
Payment amount in minimum currency units. |
|
N3 | No |
ISO 4217 code of the payment currency. If not specified, default value is used. |
|
ANS | No |
Date of order registration in Unix-time format (POSIX-time). |
|
ANS..39 | No |
IP-address of the buyer. IPv6 is supported in all requests (up to 39 characters). |
merchantOrderParams element |
|||
Name
TypeAN..20 Type2ANS..255 Type3A7 Type4ANS..100 DescriptionRESTName of the additional parameter. REST Online LendingThe attribute name, always takes the value of mdOrder. WSName of the additional parameter. SpasiboName or the description of an item in any format. Spasibo2Name of the parameter describing the details of a line item |
AN..20 | No |
Name of the additional parameter. |
|
AN..1024 | No |
The value of the additional parameter is up to 1024 characters. |
attributes element |
|||
|
A7 | No |
Name of the additional parameter. |
|
AN..1024 | No |
The value of the additional parameter is up to 1024 characters. |
cardAuthInfo element |
|||
|
N12…19 | No |
Masked number of the card that has been used for the payment. This parameter is to be specified only after the order has been paid. In the case of payment via Apple Pay, DPAN is used as the card number: a number associated with the buyer's mobile device and acting as a payment card number in the Apple Pay system. |
|
ANS | No |
Expiry date of the card in the format YYYYMM. |
|
A..200 | No |
Cardholder's name in Latin characters, if available. |
|
AN6 | No |
International payment system authorization code. This field has a fixed length (six characters) and can contain digits and Latin letters. |
|
ANS | No |
Authorization date and time in Unix time (POSIX time). |
|
AN..10 | No |
Identifier of the terminal in processing through which the payment was made. |
|
AN..24 | No |
Registration number of the payment authorization that has been assigned to it on the payment registration. |
paymentAmountInfo element |
|||
|
N..12 | No |
Amount confirmed to be debited. |
|
N..12 | No |
The amount in the minimum currency units (for example, in kopecks), confirmed to be debited from the card. |
|
N..12 | No |
The refund amount in minimum currency units. |
|
A..10 | No |
Payment status. |
|
N..12 | No |
Order amount + fee (if applicable to the order). |
The bankInfo element contains the following parameters. |
|||
|
AN..160 | No |
Name of the country of the issuing bank passed in the language parameter of the request or in the language of the user who has called the method if the language has not been specified in the request. |
Error codes from the error parameter
Error code | Error text |
---|---|
1 |
The funds on the card are not sufficient. |
4 |
Invalid parameter value |
10 |
Invalid parameter value |
10 |
Invalid parameter value |
10 |
Invalid parameter value |
10 |
Invalid parameter value |
10 |
Invalid parameter value |
10 |
Invalid parameter value |
10 |
Invalid parameter value |
10 |
Invalid parameter value |
10 |
Invalid parameter value |
10 |
Authorization is invalid. |
Error codes from parameter errorCode
Error code | Error text |
---|---|
1 |
Expected |
7 |
Transaction is being processed now. Please try again later. |
POST request example
{ "mer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FTEJna3Foa2lHOXcwQkJ3RXdIQVlKS29aSWh2Y05BUWtGTVE4WERURTJNVEV3TVRBNU5UY3dObG93THdZSktvWklodmNOQVFrRU1TSUVJQWpSdk9nWkxDa0w5ZmNCZjdOSm5RY3hsd2ltL09ieHkrcEltZ1M0TGRUYU1Bb0dDQ3FHU000OUJBTUNCRWN3UlFJZ1BKaHlkTXE5UDdTaHJFT2RxVk5KUk84QnN1MC93SXNCS0Y1cnlFR0JPSDRDSVFEeWo4Wml3VVV5alRJUFRUZDBKTTlaMExIdGZTQVhOWVN2T0t4eGN3MTlod0FBQUFBQUFBPT0iLCJoZWFkZXIiOnsiZXBoZW1lcmFsUHVibGljS2V5IjoiTUZrd0V3WUhLb1pJemowQ0FRWUlLb1pJemowREFRY0RRZ0FFNUdmb2t2U2Z3WnV3aXYwSGxKVE1MS0dlMS96dWtjejczSFlvVjh5cjNGNWdmZmthVmNQTmptNjFhdFNOZm9UZUxiSnQ1aHBLWkJuSWlwZlVXSXZxMmc9PSIsInB1YmxpY0tleUhhc2giOiJLMG9KcmJiYURVUDh6YitSUEZhTmxVUTdTU2I3T1FEWERVeU9vM0JXdDJzPSIsInRyYW5zYWN0aW9uSWQiOiIyYTNkZjhjNDg0Y2JmMDg1OTgyN2Y0ZDBkZjhkYjY4YjYyNjBlNTIxYWUwZmI4YjI1NDRmNzNiM2RlMDVlYjE5In19", "language": "ru", "additionalParameters": {}, "preAuth": "true" }
Пример ответа
Successful payment
{ "success": true, "data": { "orderId": "b926351f-a634-49cf-9484-ccb0a3b8cfad" }, "orderStatus": { "errorCode": "0", "orderNumber": "229", "orderStatus": 1, "actionCode": 0, "actionCodeDescription": "", "amount": 960000, "currency": "643", "date": 1478682458102, "ip": "81.18.144.51", "merchantOrderParams": [ { "name": "param2", "value": "param2" }, { "name": "param1", "value": "param1" } ], "attributes": [ { "name": "mdOrder", "value": "b926351f-a634-49cf-9484-ccb0a3b8cfad" } ], "cardAuthInfo": { "expiration": "201907", "cardholderName": "CARD HOLDER", "approvalCode": "123456", "pan": "520424**0010" }, "authDateTime": 1478682459082, "terminalId": "12345678", "authRefNum": "111111111111", "paymentAmountInfo": { "paymentState": "APPROVED", "approvedAmount": 960000, "depositedAmount": 0, "refundedAmount": 0 }, "bankInfo": { "bankCountryName": "<UNKNOWN>" } } }
Failed payment
{ "error": { "code": 10, "description": "Processing Error", "message": "Authorization is invalid" }, "success": false }