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



Request for payment using Android Pay (payment.do)

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

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

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

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.

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.

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

String

Yes

A token received from Android 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

No

Payment amount in minimum currency units (kopecks, cents, etc.). Must match the total amount for all line items in the shopping cart.

Before summing up all line items, the product of quantity and price for each good item is rounded to an integer. If the value is followed by 5 or greater after the decimal point, it is rounded up. Below there are examples of rounding.

  1. If quantity = 0.111, and price = 5500, then the result is 611 (610.5 rounded up).
  2. If quantity = 1.455, and price = 6900, then the result is 10040 (10039.5 rounded up).
  3. If quantity = 1.211, and price = 6988, then the result is 8462 (8462.468 rounded down).

Therefore, the «amount» parameter value must be equal to the sum of the line items rounded.

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.

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

Not applicable

Yes

It is returned only if the payment was successful and contains one nested parameter (see below).

orderId

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.

The following parameter is returned if bindings are used.

bindingId

The identifier of the previously created binding. Can only be used if the merchant has permission to work with bindings. If this parameter is passed in the given request, it means that:
1. The given order can be paid only using a binding;
2. The payer will be redirected to the payment page on which only entering CVC is required.

The parameters below are required only if additional authentication is used on the ACS of the issuing bank.

acsUrl

On a successful response in case of payment using 3-D Secure. The URL to go to the access control server.

paReq

On a successful response in case of payment using 3-D Secure. Payment Authentication Request – payment authentication request.

termUrl

In case of a successful response, in the case of a payment in which a check was made to ensure that the card belongs to 3-D Secure. The URL to return from the access control server.

error

Not applicable

Yes

This parameter is returned only if the payment failed. Listed below are the nested parameters.

code

Error code.

description

A detailed technical explanation of the error – the contents of this parameter is not to be displayed to the customer.

message

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.

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",
    "currency" : "643"
}

Response example

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
}