Securing Webhook
Securing Webhook and Signature Hash validation
validateSignature = (secret, body, signature) => {
// Create a SHA256 hashed code using the HMAC/Secret key and update the hash with body using utf8
var signatureComputed = crypto.createHmac('SHA256', secret).update(
new Buffer(JSON.stringify(body), 'utf8')).digest('hex');
return (signatureComputed === signature);
};Last updated