[Stripe] No signatures found matching the expected signature for payload.
See original GitHub issueI am trying to configure Stripe webhooks and it doesn’t seem to work for me:
I configured the app:
StripeModule.forRoot(StripeModule, {
apiKey: stripeSecretKey,
webhookConfig: {
stripeWebhookSecret: stripeWebhookSecret,
// controllerPrefix: 'webhooks/stripe', // seems to have no effect
},
}),
And created a handler service:
@Injectable()
export class WebhookService {
@StripeWebhookHandler('*')
handlePaymentIntentCreated(evt: Stripe.Event) {
// execute your custom business logic
console.log(evt);
}
}
I used stripe-cli (./stripe listen --forward-to localhost:3000/stripe/webhook
) to forward webhooks to my dev instance and triggered a webhook customer.updated
event from the dashboard, which throws:
[Nest] 126333 - 04/23/2022, 12:55:43 PM LOG [NestApplication] Nest application successfully started +2ms
[Nest] 126333 - 04/23/2022, 12:55:53 PM ERROR [ExceptionsHandler] 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
Error: 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
at validateComputedSignature (/home/alko/Development/IvanOnTech/Moralis/moralis-billing-coordinator-stripe/node_modules/stripe/lib/Webhooks.js:208:11)
at Object.verifyHeader (/home/alko/Development/IvanOnTech/Moralis/moralis-billing-coordinator-stripe/node_modules/stripe/lib/Webhooks.js:103:5)
at Object.constructEvent (/home/alko/Development/IvanOnTech/Moralis/moralis-billing-coordinator-stripe/node_modules/stripe/lib/Webhooks.js:10:20)
at StripePayloadService.tryHydratePayload (/home/alko/Development/IvanOnTech/Moralis/moralis-billing-coordinator-stripe/node_modules/@golevelup/nestjs-stripe/src/stripe.payload.service.ts:23:39)
at StripeWebhookController.handleWebhook (/home/alko/Development/IvanOnTech/Moralis/moralis-billing-coordinator-stripe/node_modules/@golevelup/nestjs-stripe/src/stripe.webhook.controller.ts:31:45)
at /home/alko/Development/IvanOnTech/Moralis/moralis-billing-coordinator-stripe/node_modules/@nestjs/core/router/router-execution-context.js:38:29
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at /home/alko/Development/IvanOnTech/Moralis/moralis-billing-coordinator-stripe/node_modules/@nestjs/core/router/router-execution-context.js:46:28
at /home/alko/Development/IvanOnTech/Moralis/moralis-billing-coordinator-stripe/node_modules/@nestjs/core/router/router-proxy.js:9:17
I’ve created a min repo from typescript starter: https://github.com/alko89/nest-stripe-webhook
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:7
Top Results From Across the Web
Stripe Error: No signatures found matching the expected ...
Error: No signatures found matching the expected signature for payload. Are you passing the raw request body you received from Stripe?
Read more >Webhook validate signing error: No signature found matching ...
I want to verify all my received WebHooks from Stripe. ... Error message: No signatures found matching the expected signature for payload.
Read more >Check the webhook signatures | Stripe Documentation
Use one of our official libraries to verify signatures. You perform the verification by providing the event payload, the Stripe-Signature header, ...
Read more >Stripe Webhook Error on Vercel server: No signatures ... - Reddit
I've been running into an issue with Stripe Webhooks and Vercel, ... No signatures found matching the expected signature for payload.
Read more >Stripe & Laravel Cashier - Signature not found - Laracasts
'No signatures found matching the expected signature for payload'. I've checked the docs and I have already added the Stripe webhook secret key...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
In my case, I set the
bodyParser
to false but forgot to comment the following lines referencing the body parse.I have the same issue but also have the bodyParser off like @displaynone is suggesting. Interestingly it seems to work when I use StripeCLI and a local deploy but if I deploy it on my test environment then it fails for some reason