I am trying to verify shopify webhook in NetSuite. But the SHA256 signature created in Suitescript doesn't match the Shopify signature. Here is the code used to generate the signature:-
var sKey = crypto.createSecretKey({
guid: 'd4dba1012fd34132b161083039d0d5cd',
encoding: encode.Encoding.UTF_8
});
var hmacSHA256 = crypto.createHmac({
algorithm: crypto.HashAlg.SHA256,
key: sKey
});
hmacSHA256.update({
input: JSON.stringify(context.request.body),
inputEncoding: encode.Encoding.UTF_8
});
var digestSHA256 = hmacSHA256.digest({
outputEncoding: encode.Encoding.BASE_64
});
log.debug('digestSHA256' , digestSHA256);
I guess I am doing as specified in the Shopify docs but the SHA256 doesn't match at all. Any ideas/help is much appreciated.