Simplify your stack and build anything. Or everything.
Build tomorrow’s web with a modern solution you truly own.
Code-based nature means you can build on top of it to power anything.
It’s time to take back your content infrastructure.

Stripe plugin webhooks error - No signatures found matching the expected signature for payload

default discord avatar
philiposaurus2 years ago
2

I am getting this error when locally testing a Stripe webhook:


ERROR (payload): No signatures found matching the expected signature for payload. Are you passing the raw request body you received from Stripe? https://github.com/stripe/stripe-node#webhook-signing


I basically only use payment intents in Stripe and would like to sync succesful payments into payload.


I am using this webhook:

payment_intent.succeeded

.



When running the stripe forward command


stripe listen --forward-to localhost:8000/stripe/webhooks


And then triggering the webhook:


stripe trigger payment_intent.succeeded

The above error gets logged. Never is my function called in the plugin config. Does someone know what is up here?



Ahhh after banging my head into the keyboard for 3 hours I find the solution 5 mins after posting. It was logging some webhook secret upon starting the connection which needed to be added into the .env file.



How do I find this secret for production though?

  • discord user avatar
    jacobsfletch
    2 years ago
    @786879227466874891

    heyyy glad you figured it out. You're exactly right, in dev that secret just gets logged to the console and you need to paste it into your

    .env

    . That webhook server is only ever run in development, though. In production you create webhooks via the admin panel and Stripe provides the signing secret at that time.

  • default discord avatar
    philiposaurus2 years ago

    Right, thanks for clarifying! That makes sense.

Star on GitHub

Star

Chat on Discord

Discord

online

Can't find what you're looking for?

Get dedicated engineering support directly from the Payload team.