stripe webhook auth (unofficial)
Run the following command in the root directory of your Node-RED install
npm install node-red-contrib-stripe-webhookauth
The node-red-contrib-stripe-webhookauth uses the following open source software:
- [Stripe] (https://stripe.com/docs/webhooks): Stripe API Library for webhook.
- [raw-body] (https://github.com/stream-utils/raw-body): Get and validate the raw body of a readable stream.
See license (Apache License Version 2.0).
- Add the "stripe webhook auth" Node to the Node-RED flow.
- Double click on the node and enter the webhook url, secret key, endpoint secret.
- Add the "http response" Node to the Node-RED flow.
- Add required processing between "stripe webhook auth" and "http response".
- Deploy flow.
Before testing the flow, you need to set "httpAdminRoot" in settings.js to false, otherwise you will not be able to use the Node-RED editor.
// By default, the Node-RED UI is available at http://localhost:1880/ // The following property can be used to specifiy a different root path. // If set to false, this is disabled. httpAdminRoot: false,
Send test webhook from Stripe API menu, if the response code is 200 then the test was successful.
- If the webhook succeeds, the msg.payload should be stored in the event data.
- If an error occurs, a 400 status code will be returned.
- When you want to end the test and return to the Node-RED editor, comment out "httpAdminRoot" in "settings.js".
// By default, the Node-RED UI is available at http://localhost:1880/ // The following property can be used to specifiy a different root path. // If set to false, this is disabled. // httpAdminRoot: false,
When using this custom node in operation/testing, you need to set "httpAdminRoot" in settings.js to false.