#inseamdev_webhooks
1 messages · Page 1 of 1 (latest)
👋 Welcome to your new thread!
⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
🔗 This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1239763408786559058
📝 Have more to share? Add more details, code, screenshots, videos, etc. below.
I am using the workbench to trigger the webhook as a test
stripe trigger account.updated
hello! If you're using Express to handle webhook events, the order of middleware matters.
Does your node middleware configure parse all the requests to JSON somewhere? For example, if you have app.use(express.json()); prior to your route, this will parse the requests in all JSON, not in raw form before reaching to your webhook function.
app.use(express.json({limit: "10mb", extended: true}));
is there a way to use Google Pub/Sub with Stripe webhooks? That is how I do most of my other platforms.
I'm not familiar with Google Pub/Sub. Like what the error message mentioned, we expect the raw request and not a parsed JavaScript object. So as long as you're doing that, the function to constructEvent will work fine
so, I need to set my route to raw and not the global json?
No idea what you mean by global json. contructEvent in the stripe-node library expects either a string or a Buffer
Sorry, that was poorly written. I'm rebuilding my backend now with my webhook endpoint set to raw. Will be able to test shortly.
Still working on getting the raw request instead of parsed.