FeatureFuel
4

Related to Stripe integration in directus

Source: directus/directus#25371 · opened by @OveshTappN
Summary I'm trying to implement Stripe webhooks directly within a Directus endpoint (without using a separate Express server). The goal is to listen for events like payment_intent.succeeded, verify the Stripe signature, and update a related Directus collection. The issue I'm facing is: Stripe requires access to the raw request body (Buffer) to verify the signature. But inside Directus, req.body is already parsed into a JavaScript object — meaning the raw body is no longer available, and verification fails with: ❌ Webhook payload must be provided as a string or a Buffer Here’s what I tried: Created a middleware hook in extensions/hooks/stripe-raw-body/index.js to use express.raw() for the /stripe-webhooks route: <img width="1792" alt="Screenshot 2025-06-27 at 5 03 05 PM" src=" /> export default ({ app }) => { app.use('/stripe-webhooks', express.raw({ type: 'application/json' })); }; In the end…

No pledges yet. Be the first to back this.

Make a pledge

Pledge your monetary support if this feature is added.

$

Comments

No comments yet.

Replying to

Add a comment

What do you think about this feature request?


Similar requests