Skip to content

Instantly share code, notes, and snippets.

@zlwaterfield
Created October 26, 2019 22:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zlwaterfield/97ba9d5e3c354ae48736651c4a1379e7 to your computer and use it in GitHub Desktop.
Save zlwaterfield/97ba9d5e3c354ae48736651c4a1379e7 to your computer and use it in GitHub Desktop.
try {
let sig = req.headers['stripe-signature'];
let ev = stripe.webhooks.constructEvent(req.body, sig, env.endpointSecret);
if (ev) done(null, ev);
} catch (e) {
return res.sendStatus(401);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment