skip to Main Content

How to Validate a Xero webhook payload with HMACSHA256 in PHP Laravel

I need to validate Xero webhook in PHP. Here's My Code $payload = file_get_contents("php://input"); $webhookKey = '-----Webhook Key-----'; $computedSignatureKey = base64_encode(hash_hmac('sha256', $payload, $webhookKey, true)); if ($computedSignatureKey === $_SERVER['HTTP_X_XERO_SIGNATURE']) { return response(200); } return response(401); suppose the xero signature is =…

VIEW QUESTION
Back To Top
Search