Инструменты страницы



Request for a payment using Google Pay (payment.do)

The request used for registering an order is «payment.do» (see below).

https://3dsec.sberbank.ru/payment/google/payment.do

Use the standard requests to the payment gateway for the operations of reversal, refund and payment completion.

There is no difference in requests between tokenized and non-tokenized cards.

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

merchant

AN..255

Yes

Merchant login in the payment gateway.

orderNumber

ANS..32

Yes

Order identifier in the Store system.

protocolVersion

AN

No

Version of the protocol of the message received from Google. If this parameter is present, it can have either of the following values:

  • ECv1
  • ECv2

By default (if the parameter is not present), version ECv1 is used.

description

ANS..512

No

Description of the order in free form.

To enable sending this field to the processing system, contact the technical support service.

language

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.

additionalParameters

Not applicable

No

Additional parameters of the order that are stored in the merchant personal account for the subsequent viewing. Each new pair of a parameter name and its value must be separated by a comma. Below is an example of how to use this parameter.

{
    "firstParamName": "firstParamValue",
    "secondParamName": "secondParamValue"
}

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):

  • sbrf_spasibo:amount_bonus
  • sbrf_sbermiles:amount_bonus
  • loyaltyId

preAuth

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:

  • true – the parameter is enabled, a two-phase payment is made;
  • false – the parameter is disabled, a one-phase payment is made (funds are debited immediately).

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).

clientId

ANS..255

No

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.

paymentToken

AN..8192

Yes

A token obtained from Google Pay and encoded in Base64.

ip

ANS..39

No

IP-address of the buyer. IPv6 is supported in all requests (up to 39 characters).

amount

N..12

Yes

Payment amount in minimum currency units.

currencyCode

N3

No

Numeric ISO 4217 code of the payment currency. If this parameter is not specified, it is considered to be equal to the default currency code.

email

ANS..40

Mandatory if the online store has fiscalization configured and no phone number is specified.

Customer's email address. You can specify several comma separated (without spaces) email addresses – in this case the receipt will be delivered to all specified addresses.

phone

NS..12

Required if the online store has fiscalization configured and no email address is specified.

Customer's phone number. It can be of the following format: ^((+7|7|8)?([0-9]){10})$. Examples:

  • +79000000000
  • 89000000000
  • 9000000000
  • 79000000000

If the number is passed in a separate parameter and in additional parameters, the number specified in this phone parameter will be used.

returnUrl

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 failUrl parameter is not passed). The address must be specified in full including the protocol used (for example, https://test.ru instead of test.ru). Otherwise, the user will be redirected to the address of the following type: http://<payment_gateway_address>/<merchant_address>.

failUrl

ANS..512

No

The address to which the user is to be redirected in case of a failed payment. The address must be specified in full including the protocol used (for example, https://test.ru instead of test.ru). Otherwise, the user will be redirected to the address of the following type: http://<payment_gateway_address>/<merchant_address>.

The parameter is optional. In this case, an unsuccessful payment will lead to a redirect to returnUrl, in the same way it happens when the payment is successful.

dynamicCallbackUrl

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.

billingPayerData

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

billingCity

AN..50

No

City registered for the card at the Issuer Bank.

billingCountry

AN..50

No

billingAddressLine1

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.

billingAddressLine2

AN..50

No

Address registered for the card at the Issuer Bank.

Line 2.

billingAddressLine3

AN..50

No

Address registered for the card at the Issuer Bank.

Line 3.

billingPostalCode

AN..50

No

Postal code registered for the card at the Issuer Bank.

Mandatory if «AVS/AVV use allowed» permission is enabled for merchant.

billingState

AN..50

No

State registered for the card at the Issuer Bank (ISO 3166-2).

Response parameters

The response parameters are given in table below.

Name Type Mandatory Description

success

A..5

Yes

Designates a successful request. The following values are available:

  • true – request is processed successfully;
  • false – request failed.
data block (returned only if the request was successful)

orderId

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.

termUrl

AN..512

Only if additional authentication is used on the issuing bank's ACS

URL to redirect the payer to after authentication.

This parameter returns only if the data from the non-tokenized card was passed in the request.

acsUrl

AN..512

Only if additional authentication is used on the issuing bank's ACS

Redirect address to the address of the ACS server.

This parameter returns only if the data from the non-tokenized card was passed in the request.

paReq

AN..512

Only if additional authentication is used on the issuing bank's ACS

Request for the payer authentication.

This parameter returns only if the data from the non-tokenized card was passed in the request.

bindingId

AN..255

The parameter is returned if the bindings are used

Identifier of the binding created earlier.

error block (returned only if the request resulted in an error)

code

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.

message

AN..512

Yes

Comprehensive error description – it is intended for displaying to the user.

Error codes

Error code Error text
0

The request has been processed without system errors.

1 The funds on the card are not sufficient
5

Access denied.

5

The user must change the password.

7

System error.

10

Invalid parameter value [paymentToken].

10

Invalid parameter value [orderNumber].

10

Invalid parameter value [merchant].

10

Invalid parameter value [ip].

10

Encryption of the data passed in unsuccessful.

POST request example

{
    "merchant": "OurBestMerchantLogin",
    "orderNumber": "UAF-203974-DE",
    "language": "RU",
    "preAuth": true,
    "description" : "Test description",
    "additionalParameters":
    {
        "firstParamName": "firstParamValue",
        "secondParamName": "secondParamValue"
    },
    "paymentToken": "eyJtZXJjaGFudCI6ICJrdXBpdmlwIiwib3JkZXJOdW1iZXIiOiAyMDUxOTIzMzkxLCJwYXltZW50VG9rZW4iOiAie1wiZXBoZW1lcmFsUHVibGljS2V5XCI6XCJrZXlcIixcImVuY3J5cHRlZE1lc3NhZ2VcIjpcIm1lc3NhZ2VcIixcInRhZ1wiOlwidGFnXCJ9In0=",
    "ip" : "127.0.0.1",
    "amount" : "230000",
    "currencyCode": 643
    "returnUrl": "https://test.ru"
}

Пример ответа

Successful payment

{
"success":true,
"data": {
    "orderId": "12312312123"
  }
}

Failed payment

{
  "error": {
    "code": 1,
    "description": "Processing Error",
    "message": "The funds on the card are not sufficient"
  },
  "success": false
}