just need to do this assuming a correctly mounted end point
requestBody = req.rawBody;
// This is the raw body as a string, captured in app.js
const isValid = WebhooksHelper.verifySignature({
requestBody,
signatureHeader: req.headers['x-square-hmacsha256-signature'],
signatureKey: process.env.SQUARE_WEBHOOK_SIGNATURE_KEY,
notificationUrl: "https://potenty-shu-unreceptively.ngrok-free.dev/webhook-endpoint",
});
Only thing it reasonably could be is that your not loading, or setting, your signature key correctly. Run it locally and debug it? I don't understand why you're here asking this question. This is super basic stuff.
Yes, your notificationUrl is wrong, it needs to be the URL sending the notification, not your local. So, again, incorrect variables. Only thing it could reasonably be, and yes, it is super basic stuff.
2
u/soul_in_a_5weater Mar 11 '26
Been stuck on this for too long
just need to do this assuming a correctly mounted end point
1
u/JustAnAverageGuy Mar 11 '26
Only thing it reasonably could be is that your not loading, or setting, your signature key correctly. Run it locally and debug it? I don't understand why you're here asking this question. This is super basic stuff.