29
loading...
This website collects cookies to deliver better user experience
git clone https://github.com/hookdeck/nodejs-webhook-server-example.git
cd nodejs-webhook-server-example
npm install
npm start
1337
./stripe-webhooks-endpoint
and can be found in the routes.js
file as shown below:router.post("/stripe-webhooks-endpoint", bodyParser.raw({type: 'application/json'}), function(req, res) {
console.log(req.body);
res.send("Stripe Successfully received Webhook request");
});
hookdeck listen 1337
Enter
key after each answer.+ Add endpoint
****button at the top right-hand side of the screen. This action will pop up a dialog similar to the one below:Endpoint URL
field. Next, click the Events to send
dropdown and select the account.updated
event which will be triggered each time your Stripe account is updated. Click the Add endpoint
button to complete this process.account.updated
event. After the webhook has been successfully added, you will see a screen like the one below:Send test webhook
button. This will pop open a dialog for you to select the event for which you want to send the test. See dialog below:account.updated
event and click the Send test webhook
button. This will trigger a webhook request to your webhook URL, which will be received at the endpoint you specified when creating the URL (i.e. /stripe-webhooks-endpoint
). hookdeck listen 1337
command. You will see the webhook request printed to the terminal as shown below:Headers
section of the event screen, as shown below:stripe-signature
header. This signature allows you to verify that the webhooks are being sent by Stripe. You can verify Stripe signatures either using official Stripe libraries or by developing your own solution. Details on rolling your own verification system can be found here.Body
section where you can inspect all the parameters sent in the body of the request, as shown below:test
→ inspect
→ fix
→ test
. When you fire a test webhook from Stripe and discover an issue or anomaly in your system, you inspect the request and your code to track the bug, fix it, then test again.