#️⃣Hash Generation

You can track how to compute the Hash parameters used in the callback requests sent by Paywall through this page.

🔑 Private key is a value accessible from your Paywall panel. This value is supported to be different for all possible scenarios. For example, the keys for 3D payments and APM payments are different. You should generate a separate key for each scenario and securely store these keys on your side.

The relevant keys will be included within the string value set used to generate the hash.

Hash Examples:

You can obtain the hashKey information from the panel

var hashFormat = $"{hashKey}###{paymentId}###{merchantUniqueCode}###{amount}###{installment}"

// Create a SHA256
using var sha256Hash = SHA256.Create();
// ComputeHash - returns byte array  
var bytes = sha256Hash.ComputeHash(Encoding.UTF8.GetBytes(hashFormat));

// Convert byte array to a string   
var builder = new StringBuilder();
foreach (var t in bytes)
{
    builder.Append(t.ToString("x2"));
}
return builder.ToString();

You can obtain the hashKey information from the panel

var hashFormat = $"{hashKey}###{checkoutId}###{paymentId}###{uniqueCode}###{amount}"

// Create a SHA256
using var sha256Hash = SHA256.Create();
// ComputeHash - returns byte array  
var bytes = sha256Hash.ComputeHash(Encoding.UTF8.GetBytes(hashFormat));

// Convert byte array to a string   
var builder = new StringBuilder();
foreach (var t in bytes)
{
    builder.Append(t.ToString("x2"));
}
return builder.ToString();

Last updated