Request Hash Test (hashDataV2)
You must create and send the relevant hash with every request you send to paynkolay. The hash is calculated using the methods below. You can get your unique sx and merchantSecretKey information from your panel.
Hash Test Form #
You can test the hash calculation process using the form below:
Creating Hash for Common Payment and APIs #
When you post the hash value to us along with other parameters, we hash the same values. If the hash you send matches the hash we generate, we confirm that the request came from you.
example.php
$hashstr = $sx."|".$clientRefCode."|".$amount."|".$successUrl."|".$failUrl."|".$rnd."|".$customerKey."|".$merchantSecretKey;
$hash = mb_convert_encoding($hashstr, 'UTF-8');
$hashedBytes = hash("sha512", $hash, true);
$HashDatav2 = base64_encode($hashedBytes);var raw = $"{Sx}|{ClientRefCode}|{Amount}|{SuccessUrl}|{FailUrl}|{Rnd}|{CustomerKey}|{merchantSecretKey}";
using var sha512 = SHA512.Create();
HashDatav2 = Convert.ToBase64String(sha512.ComputeHash(Encoding.UTF8.GetBytes(raw)));import hashlib
import base64
# Assuming these variables are defined elsewhere in your code
raw = f"{sx}|{full_name}|{email}|{gsm}|{amount}|{link_expiration_time}|{merchantSecretKey}"
sha512 = hashlib.sha512()
sha512.update(raw.encode('utf-8'))
HashDatav2 = base64.b64encode(sha512.digest()).decode('utf-8')const crypto = require('crypto');
// Assuming these variables are defined elsewhere in your code
const raw = `${sx}|${full_name}|${email}|${gsm}|${amount}|${link_expiration_time}|${merchantSecretKey}`;
const hash = crypto.createHash('sha512');
hash.update(raw, 'utf8');
const HashDatav2 = hash.digest('base64');Creating Hash for Cancel-Refund Service #
example.php
$hashstr = $sx."|".$referenceCode."|".$type."|".$amount."|".$trxDate."|".$merchantSecretKey;
$hash = mb_convert_encoding($hashstr, 'UTF-8');
$hashedBytes = hash("sha512", $hash, true);
$HashDatav2 = base64_encode($hashedBytes);var raw = $"{sx}|{referenceCode}|{type}|{amount}|{trxDate}|{merchantSecretKey}";
using var sha512 = SHA512.Create();
HashDatav2 = Convert.ToBase64String(sha512.ComputeHash(Encoding.UTF8.GetBytes(raw)));import hashlib
import base64
# Assuming these variables are defined elsewhere in your code
hashstr = f"{sx}|{referenceCode}|{type}|{amount}|{trxDate}|{merchantSecretKey}"
hash_bytes = hashstr.encode('utf-8')
hashedBytes = hashlib.sha512(hash_bytes).digest()
HashDatav2 = base64.b64encode(hashedBytes).decode('utf-8')const crypto = require('crypto');
// Assuming these variables are defined elsewhere in your code
const raw = `${sx}|${referenceCode}|${type}|${amount}|${trxDate}|${merchantSecretKey}`;
const hash = crypto.createHash('sha512');
hash.update(raw, 'utf8');
const HashDatav2 = hash.digest('base64');Creating Hash for Reporting Service #
example.php
$hashstr = $sx."|".$startDate."|".$endDate."|".$clientRefCode."|".$merchantSecretKey;
$hash = mb_convert_encoding($hashstr, 'UTF-8');
$hashedBytes = hash("sha512", $hash, true);
$HashDatav2 = base64_encode($hashedBytes);var raw = $"{sx}|{startDate}|{endDate}|{clientRefCode}|{merchantSecretKey}";
using var sha512 = SHA512.Create();
HashDatav2 = Convert.ToBase64String(sha512.ComputeHash(Encoding.UTF8.GetBytes(raw)));
import hashlib
import base64
# Assuming these variables are defined elsewhere in your code
raw = f"{sx}|{startDate}|{endDate}|{clientRefCode}|{merchantSecretKey}"
sha512 = hashlib.sha512()
sha512.update(raw.encode('utf-8'))
HashDatav2 = base64.b64encode(sha512.digest()).decode('utf-8')const crypto = require('crypto');
// Assuming these variables are defined elsewhere in your code
const raw = `${sx}|${startDate}|${endDate}|${clientRefCode}|${merchantSecretKey}`;
const hash = crypto.createHash('sha512');
hash.update(raw, 'utf8');
const HashDatav2 = hash.digest('base64');Creating Hash for Pay By Link #
example.php
$hashstr = $sx."|".$full_name."|".$email."|".$gsm."|".$amount."|".$link_expiration_time."|".$merchantSecretKey;
$hash = mb_convert_encoding($hashstr, 'UTF-8');
$hashedBytes = hash("sha512", $hash, true);
$HashDatav2 = base64_encode($hashedBytes);var raw = $"{sx}|{full_name}|{email}|{gsm}|{amount}|{link_expiration_time}|{merchantSecretKey}";
using var sha512 = SHA512.Create();
HashDatav2 = Convert.ToBase64String(sha512.ComputeHash(Encoding.UTF8.GetBytes(raw)));
import hashlib
import base64
# Assuming these variables are defined elsewhere in your code
raw = f"{sx}|{startDate}|{endDate}|{clientRefCode}|{merchantSecretKey}"
sha512 = hashlib.sha512()
sha512.update(raw.encode('utf-8'))
HashDatav2 = base64.b64encode(sha512.digest()).decode('utf-8')const crypto = require('crypto');
// Assuming these variables are defined elsewhere in your code
const raw = `${sx}|${startDate}|${endDate}|${clientRefCode}|${merchantSecretKey}`;
const hash = crypto.createHash('sha512');
hash.update(raw, 'utf8');
const HashDatav2 = hash.digest('base64');Creating Hash for Recurring Payment #
example.php
$hashstr = $sx."|".$gsm."|".$amount."|".$clientRefCode."|".$merchantSecretKey;
$hash = mb_convert_encoding($hashstr, 'UTF-8');
$hashedBytes = hash("sha512", $hash, true);
$HashDatav2 = base64_encode($hashedBytes);var raw = $"{sx}|{gsm}|{amount}|{clientRefCode}|{merchantSecretKey}";
using var sha512 = SHA512.Create();
HashDatav2 = Convert.ToBase64String(sha512.ComputeHash(Encoding.UTF8.GetBytes(raw)));
import hashlib
import base64
# Assuming these variables are defined elsewhere in your code
raw = f"{sx}|{gsm}|{amount}|{clientRefCode}|{merchantSecretKey}"
sha512 = hashlib.sha512()
sha512.update(raw.encode('utf-8'))
HashDatav2 = base64.b64encode(sha512.digest()).decode('utf-8')const crypto = require('crypto');
// Assuming these variables are defined elsewhere in your code
const raw = `${sx}|${gsm}|${amount}|${clientRefCode}|${merchantSecretKey}`;
const hash = crypto.createHash('sha512');
hash.update(raw, 'utf8');
const HashDatav2 = hash.digest('base64');Creating Hash for Recurring Payment Cancellation #
example.php
$hashstr = $sx."|".$InstructionNumber."|".$merchantSecretKey;
$hash = mb_convert_encoding($hashstr, 'UTF-8');
$hashedBytes = hash("sha512", $hash, true);
$HashDatav2 = base64_encode($hashedBytes);string hashStr = $"{sx}|{instructionNumber}|{merchantSecretKey}";
using var sha512 = SHA512.Create();
HashDatav2 = Convert.ToBase64String(sha512.ComputeHash(Encoding.UTF8.GetBytes(hashStr)));import hashlib
import base64
# Assuming these variables are defined elsewhere in your code
raw = f"{sx}|{InstructionNumber}|{merchantSecretKey}"
sha512 = hashlib.sha512()
sha512.update(raw.encode('utf-8'))
HashDatav2 = base64.b64encode(sha512.digest()).decode('utf-8')const crypto = require('crypto');
// Assuming these variables are defined elsewhere in your code
const raw = `${sx}|${InstructionNumber}|${merchantSecretKey}`;
const hash = crypto.createHash('sha512');
hash.update(raw, 'utf8');
const HashDatav2 = hash.digest('base64');Creating HashDatav2 for Saved Cards #
Saving a Card:
$hashstr = $sx."|".$cardNumber."|".$cvv."|".$merchantSecretKey;Listing Saved Cards:
$hashstr = $sx."|".$customerKey."|".$merchantSecretKey;Deleting Saved Cards:
$hashstr = $sx."|".$customerKey."|".$tranId."|".$token."|".$merchantSecretKey;Processing Payment from Saved Card:
$hashstr = $sx."|".$clientRefCode."|".$amount."|".$successUrl."|".$failUrl."|".$rnd."|".$csCustomerKey."|".$merchantSecretKey;