Hi! Could we please enable some services and cookies to improve your experience and our website?
Online Sandbox for SQL and PHP: Write, Run, Test, and Share SQL Queries and PHP Code
<?php
$secret_key = 'YOUR_SECRET_KEY'; // Replace with your actual IremboPay secret key
$timestamp = round(microtime(true) * 1000);
// Read payload file
$body = file_get_contents('payload.json');
$data = json_decode($body, true);
// Normalize
$normalized_body = json_encode($data, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);
$signed_payload = $timestamp . '#' . $normalized_body;
$signature = hash_hmac('sha256', $signed_payload, $secret_key);
// Output header
echo "t=$timestamp,s=$signature\n";