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 | Payment token for recurrent payments | |
params.user_id | String | - | User ID within Partner's system | test_user |
params.pay_token_flag | Integer | 1 | Payment token flag. See Recurrent Payments section for a detailed description. | 0 or 1 (0 as a default) |
params.flag_get_url | Integer | 1 | Flag used to receive payment form link in response to payment request | 0 or 1 (0 as a default) |
params.extra_params | JSON | - | Custom Merchant parameters | { "merchant_field1":"val1", "merchant_field2":"val2" } |
params.extra_params.merchant_site | String | - | Merchant website address | www.realsite.com |
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 2 months ago