Initialize Payment Request
Request Parameters
To initialize a payment, two parameters need to be included in an HTTP POST request to the URL https://secure(-test).8b.world/pay
:
data
: A base64-encoded JSON document string.sign
: A signature created based on thedata
string using hash_hmac for data validity confirmation.
JSON Document Parameters
Name | Type | Max Length | Description | Example |
---|---|---|---|---|
api_key | String | 255 | Shop key (identifier) | c84f1ac0-e4f0-0000-5298-70900c00c2a2 |
expiration | String | Maximum duration till when a payment can be provided | 2014-01-01 00:00 | |
amount | Float | 10.2 | Payment amount. Format: positive number with "." as a separator, no more than two digits after the dot | 327.78 |
currency | String | 3 | Payment currency. Possible values: EUR, USD, UZS | USD |
reference | String | 255 | Unique shop order number for further order identification | 123456789 |
description | String | 255 | Order description | test |
success_url | String | 255 | URL where User will be redirected after a successful payment | http://test.com/success |
failure_url | String | 255 | URL where User will be redirected after an unsuccessful payment | http://test.com/failure |
lang | String | 2 | Language of the payment page. | en, uk |
params.user_email | String | - | User E-mail | [email protected] |
Additional Parameters (Optional)
Name | Type | Max Length | Description | Example |
---|---|---|---|---|
pay_token | String | 255 | Recurrent payment token. Parameter is optional and depends on payment gateway settings | |
ip | String | 255 | Payer’s IP in IPv4/IPv6 format. Parameter is optional and depends on payment gateway settings | 8.8.8.8 / 2001:0db8:85a3:0000:0000:8a2e:0370:7334 |
params.user_id | String | - | User identifier in Merchant's system | test_user |
params.verification_flag | Integer | 1 | Verification of bank card attribute (Depends on an acquirer). 1 — Blocked for verification funds are automatically unlocked after successful verification | 0 or 1 (0 as a default) |
params.random_amount_flag | Integer | 1 | Lock of a random value for verification of bank card attribute. 1 — A random value from 0 to basic parameter amount is locked | 0 or 1 (0 as a default) |
params.pay_token_flag | Integer | 1 | Attribute designed for recurrent payment token. See detailed description in article 10 | 0 or 1 (0 as a default) |
params.extra_params | JSON | Any other Merchant’s parameters | { "merchant_field1":"val1", "merchant_field2":"val2" } |
Signature Generating Rule (the sign
parameter)
sign
parameter)The signature is formed based on a data string (Base64 encoded parameters string) with the help of hash_hmac
.
The MD5 algorithm is used for the signature creation.
hash_hmac('md5', $data, $secret_key);
Where:
data
- base64 encoded JSON document stringsecret_key
- shop password
API Reference
You can view a Reference API implementation for this method at this link
Updated about 1 month ago