Callback events
Signature
using System;
using System.Globalization;
using System.Security.Cryptography;
using System.Text;
public class DigitalHMACSignature {
public static string ComputeHash(string key, string message) {
//Changes the hexadecimal string to a byte array by parsing the string byte-by-byte.
byte[] keyBytes = new byte[key.Length / 2];
for (int i = 0; i < keyBytes.Length; i++) {
keyBytes[i] = byte.Parse(key.Substring(i * 2, 2), NumberStyles.HexNumber);
}
//Encodes a message into a sequence of bytes.
byte[] encodedMessage = new ASCIIEncoding().GetBytes(message);
//Computes a Hash-based Message Authentication Code (HMAC) by using the SHA256 hash function.
byte[] hash = new HMACSHA256(keyBytes).ComputeHash(encodedMessage);
//Converts the numeric value of each element of a specified array of bytes to its equivalent hexadecimal string representation
var computedString = BitConverter.ToString(hash).Replace("-", "").ToLower();
return computedString;
}
}Payout
Below is a sample of the callback body:
Last updated