Esc
Start typing to search...

Hash Response (hashDataV2)

You must check the hashDataV2 information returned to you at the end of each payment transaction...

HashDataV2 is the hash information you need to check at the end of the payment transaction.

The parameters we return to you are as follows. It is important for your security that you create your hash with the method here and compare it with the hash coming from us. If the hashes are not the same, you can terminate the transaction.

RESPONSE_CODE : 2
RESPONSE_DATA : Transaction Successful.
REFERENCE_CODE : IKSIRPF3938836128
USE_3D : true
MERCHANT_NO : 400000002
AUTH_CODE : S32533320
CLIENT_REFERENCE_CODE : 24809740
TIMESTAMP : 2022-02-24 13:58:36.353
TRANSACTION_AMOUNT : 1.00
AUTHORIZATION_AMOUNT : 1.00
COMMISION : 0.00
COMMISION_RATE : 0.0000
INSTALLMENT : 1
RND : 1645700316156
CURRENCY_CODE : TRY
hashData : NL5R04M8C4sjDNgBUnEZ/RCocEo=
hashDataV2 : Y4GMhUse2gPGV8UlDg6p96SZ7cDYR5mgUIp0p0cp0qbrvd14P4MS30KLlpC6oDbDaHceZ20XIJJdcvxHnOHJNg==

Response Hash Test #

With the variables we post to your Success page...

example.php
$hashstr = $MERCHANT_NO . "|" . $REFERENCE_CODE . "|" . $AUTH_CODE . "|" . $RESPONSE_CODE . "|" . $USE_3D . "|" . $RND . "|" . $INSTALLMENT . "|" . $AUTHORIZATION_AMOUNT . "|" . $CURRENCY_CODE . "|" . $MERCHANTSECRETKEY;
$hash = mb_convert_encoding($hashstr, 'UTF-8');
$hashedBytes = hash("sha512", $hash, true);
$hashDataV2 = base64_encode($hashedBytes);
var raw = $"{MERCHANT_NO}|{REFERENCE_CODE}|{AUTH_CODE}|{RESPONSE_CODE}|{USE_3D}|{RND}|{INSTALLMENT}|{AUTHORIZATION_AMOUNT}|{CURRENCY_CODE}|{MERCHANTSECRETKEY}";
using var sha512 = SHA512.Create();
var hashDataV2 = Convert.ToBase64String(sha512.ComputeHash(Encoding.UTF8.GetBytes(raw)));
function calculateHash(merchantNo, referenceCode, authCode, responseCode, use3D, rnd, installment, authAmount, currencyCode, merchantSecretKey) {
  const raw = `${merchantNo}|${referenceCode}|${authCode}|${responseCode}|${use3D}|${rnd}|${installment}|${authAmount}|${currencyCode}|${merchantSecretKey}`;
  const hash = CryptoJS.SHA512(raw);
  return CryptoJS.enc.Base64.stringify(hash);
}
import base64
raw_string = f"{MERCHANT_NO}|{REFERENCE_CODE}|{AUTH_CODE}|{RESPONSE_CODE}|{USE_3D}|{RND}|{INSTALLMENT}|{AUTHORIZATION_AMOUNT}|{CURRENCY_CODE}|{MERCHANTSECRETKEY}"
hash_data_v2 = base64.b64encode(hashlib.sha512(raw_string.encode('utf-8')).digest()).decode('utf-8')
print(f"Generated Hash: {hash_data_v2}")