Back
Syntax
Study
Editor
Mode:
HTML
CSS
JavaScript
PHP
Reset
Run »
HTML / CSS / JS
// Sending a webhook Http::post($url, ["event" => "order.created", "data" => $order]); // Receiving (verify Stripe-style HMAC) $payload = $request->getContent(); $sig = $request->header("X-Hub-Signature-256"); $expected = "sha256=" . hash_hmac("sha256", $payload, config("webhook.secret")); if (!hash_equals($expected, $sig)) { abort(403, "Invalid signature"); } $data = json_decode($payload, true);
Result
Open