Hi! Could we please enable some services and cookies to improve your experience and our website?

PHPize Online / SQLize Online  /  SQLtest Online

A A A
Login    Share code      Blog   FAQ

Online Sandbox for SQL and PHP: Write, Run, Test, and Share SQL Queries and PHP Code

Copy Format Clear

Stuck with a problem? Got Error? Ask AI support!

Copy Clear
Copy Format Clear
<?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";
Copy Clear