using System.Security.Cryptography;
public static void Main()
var epoch = new DateTime(1970, 1, 1);
var dateNow = DateTime.Now;
var epochResult = dateNow - epoch;
var message = epochResult.ToString();
Console.WriteLine("Epoch time: " + message);
var publicKey = "0oa70WuefiddqLjqlTls";
var privateKey = "m2vQxqNixqrEDcQ2heVa";
var theDigest = CalculateDigest(publicKey, privateKey, message);
Console.WriteLine("Signature: " + theDigest);
Console.WriteLine("JS Staging URL: https://checkout.tpay.me/script/CheckoutScript?epochTimeSpan="+ epochResult +"&signature="+ theDigest);
public static string CalculateDigest(string publicKey, string privateKey, string message)
var hash = new System.Security.Cryptography.HMACSHA256(System.Text.Encoding.UTF8.GetBytes(privateKey));
var correctHash = string.Join(string.Empty, hash.ComputeHash(System.Text.Encoding.UTF8.GetBytes(message)).Select(b => b.ToString("x2")));
signature = publicKey + ":" + correctHash;