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



Request for a payment using Google Pay (googlePay)

The request used for payment via Google Pay is googlePay.

Use the following URL to connect to the Test Service (WSDL):
https://3dsec.sberbank.ru/payment/webservices/merchant-ws?wsdl.

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.

Name Type Mandatory Description

merchant

AN..255

Yes

Merchant login in the payment gateway.

orderNumber

ANS..32

Yes

The number (identifier) of the order in the store system is unique for each store within the system – up to 30 characters. If the order number is generated on the Payment Gateway side, this parameter is not mandatory.

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.

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.

description

ANS..512

No

Description of the order in any format. Only the first 24 characters of this field are transferred to Sberbank's processing for inclusion in the merchant's financial statements.

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. For each additional parameter, use the entry block which includes the following nested parameters.

Name Type Description

key

String

The name of the optional parameter.

value

AN..1024

The value of the additional parameter is up to 1024 characters.

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

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

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.

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.

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.

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. The identifier is missing if the 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
1

The funds on the card are not sufficient.

0

The request has been processed without system errors.

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.

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:googlePay>
         <arg0>
            <merchant>OurBestMerchantLogin</merchant>
            <orderNumber>UAF-203974-DE</orderNumber>
            <language>RU</language>
            <preAuth>true</preAuth>
            <paymentToken>eyJhcHBsaWNhdGlvblByaW1hcnlBY2NvdW50TnVtYmVyIjoiNDExMTExMTExMTExMTExMSIsImFwcGxpY2F0aW9uRXhwaXJhdGlvbkRhdGUiOiIxOTEyMjAiLCJjdXJyZW5jeUNvZGUiOiI2NDMiLCJ0cmFuc2FjdGlvbkFtb3VudCI6MzY1MDAsImRldmljZU1hbnVmYWN0dXJlcklkZW50aWZpZXIiOiIwNDAwMTAwMzAyNzMiLCJwYXltZW50RGF0YVR5cGUiOiIzRFNlY3VyZSIsInBheW1lbnREYXRhIjp7Im9ubGluZVBheW1lbnRDcnlwdG9ncmFtIjoiQWtaTzVYUUFBMHJoQnhvYXVmYStNQUFCQUFBPSIsImVjaUluZGljYXRvciI6IjcifX0=</paymentToken>
            <ip>127.0.0.1</ip>
            <amount>230000</amount>
         <currencyCode>643</currencyCode>
         <returnUrl>https://test.ru</returnUrl>
         </arg0>
      </mer:googlePay>
   </soapenv:Body>
</soapenv:Envelope>

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

Successful payment

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
   <soap:Body>
      <ns1:googlePayResponse xmlns:ns1="http://engine.paymentgate.ru/webservices/merchant">
         <return>
            <success>true</success>
            <data>
               <orderId>12312312123</orderId>
            </data>
            <orderStatus errorCode="0"/>
         </return>
      </ns1:googlePayResponse>
   </soap:Body>
</soap:Envelope>

Failed payment

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
   <soap:Body>
      <ns1:googlePayResponse xmlns:ns1="http://engine.paymentgate.ru/webservices/merchant">
         <return>
            <success>false</success>
            <error>
               <code>10</code>
               <description>Invalid parameter [orderNumber]</description>
            </error>
            <orderStatus errorCode="0"/>
         </return>
      </ns1:googlePayResponse>
   </soap:Body>
</soap:Envelope>