Digital Signature in Callback¶
1. All fields of the form with the “co_” prefix are sorted alphabetically.
2. The secret merchant key is added at the end.
3. Concatenation of all fields is performed through the “:” symbol without their names.
4. Example of the string for data signing for Payout Send request: 16:UAH:2019-02-19 19:12:04:2019-02-19 19:12:11:success:1:M1VJDHSI6DYXS:20:34:15.76:SecretKey
5. The line you received is hashed using MD5 method, and its bytecode is encoded in Base64: co_sign = Base64(MD5(Implode(Sort(Params) + SecretKey, ':'), true))
Example of data signing in the response for Payout Send request:
$data = [
"co_inv_id" => "1111111",
"co_inv_crt" => "2021-02-16 19:12:04",
"co_inv_prc" => "2021-02-16 19:12:11",
"co_inv_st" => "Success",
"co_payout_id" => "000002",
"co_merchant_uuid" => "M1VJDHSI6DYXS",
];
$dataSet = $data;
ksort($dataSet, SORT_STRING);
array_push($dataSet, "SecRetKey0123");
$signString = implode(":", $dataSet);
$calc_sign = base64_encode(md5($signString, true));
$data["sign"] = $calc_sign;