Appendix A
Appendix A
Hash is signature rule used either to validate your requests to payment platform or to validate callback from payment platform to your system. It must be md5 encoded string calculated by rules below:
Sale signature
Hash is calculated by the formula:
_md5(strtoupper(strrev(identifier + order_id + order_amount + order_currency + PASSWORD)));_
Creditvoid signature
Hash is calculated by the formula:
_md5(strtoupper(strrev(trans_id + PASSWORD)));_
Void signature
Hash is calculated by the formula:
$hash = md5(strtoupper(strrev($trans_id)) . $PASSWORD);
Credit2Virtual signature
Hash is calculated by the formula:
$hash = md5(strtoupper(strrev($order_id . $order_amount . $order_currency)) . $PASSWORD);
Debit signature
Hash is calculated by the formula:
_md5(strtoupper(strrev(identifier + order_id + order_amount + order_currency + PASSWORD)));_
Complete Debit signature
Hash is calculated by the formula:
$hash = md5(strtoupper(strrev($trans_id)) . $PASSWORD);
GET_TRANS_STATUS signature
Hash is calculated by the formula:
$hash = md5(strtoupper(strrev($trans_id)) . $PASSWORD);
Callback signature
Hash is calculated by the formula:
array_walk_recursive($params, static function (&$value) {
$value = strrev($value);
});
$params['hash'] = md5(strtoupper(convert($params) . PASSWORD));
function convert($params)
{
foreach ($params as &$value) {
if (is_array($value)) {
$value = $this->convert($value);
}
}
ksort($params);
return implode($params);
}
Sale callback signature
Hash calculation for notification in S2S APM based on the next formula:
• All parameter values from the callback are used, except for hash;
• Sort values alphabetically by their parameter names;
• Reverse each value individually;
• Concatenate all reversed values together into a single string;
• Convert this string to uppercase;
• Append the password in uppercase to the end of this string;
• Generate the MD5 hash of the resulting string
For example, for callback like this:
result=SUCCESS
amount=9.22
transactions=[ctrans1 = 123, atrans2 =32, itrans2 =325]
formula will be looking like this:
hash = reverse(action) + reverse(amount) + reverse(result) + reverse(transactions.atrans2) + reverse(transactions.ctrans1) + reverse(transactions.itrans2) + PASSWORD
and string_result:
string_result = ELASSSECCUS22.923321523PASSWORD
and hash:
hash = md5(string_result)
Credit2Virtual callback signature
Hash is calculated by the formula:
$hash = md5(strtoupper(strrev($trans_id . $order_id . $status)) . $PASSWORD);