#thamoddya-rashmitha_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/1412639556112617512
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hi there, looks like you encountered problem in verifying the webhook sigature
{"statusCode":400,"message":"Webhook Error: Webhook payload must be provided as a string or a Buffer (https://nodejs.org/api/buffer.html) instance representing the _raw_ request body.Payload was provided as a parsed JavaScript object instead. \nSignature verification is impossible without access to the original signed material. \n\nLearn more about webhook signing and explore webhook integration examples for various frameworks at https://docs.stripe.com/webhooks/signature\n"}
My Code,
Api Geteway
@Post('stripe/payment/webhook')
@Decorators.Common.Public()
async handleWebhook(@Req() req: RawBodyRequest<Request>, @Headers('stripe-signature') signature: string) {
const rawBody = req.body;
const payload = { rawBody, signature };
return Utils.Common.Rpc.handleRpc(await firstValueFrom(this.coreServiceClient.send('uma-job-offer-payment-webhook', payload)));
}
https://docs.stripe.com/webhooks/signature this page provide solutions to solve your problem
Can you check my code and give me the solution please
Is the rawBody that you pass constructEvent to of type buffer or string?
Buffer
Do you use bodyParser in your project? or any other middleware?
Yes.
app.use('/api/v1/uma/job-quotations/stripe/payment/webhook', bodyParser.raw({ type: 'application/json' }));
https://github.com/stripe/stripe-node/issues/341 try soutions listed on this ticket
Thank You. Give me some minutes