Created
October 26, 2019 22:22
-
-
Save zlwaterfield/97ba9d5e3c354ae48736651c4a1379e7 to your computer and use it in GitHub Desktop.
Blog post snippet - https://medium.com/gofaros/stripe-webhooks-dd2aed422837
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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