#thamoddya-rashmitha_webhooks

1 messages ¡ Page 1 of 1 (latest)

timber jasperBOT
#

👋 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.

fallow tartan
#

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"}

tawny light
#

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)));
}

fallow tartan
tawny light
#

Can you check my code and give me the solution please

fallow tartan
#

Is the rawBody that you pass constructEvent to of type buffer or string?

tawny light
#

Buffer

fallow tartan
#

Do you use bodyParser in your project? or any other middleware?

tawny light
#

Yes.

#

app.use('/api/v1/uma/job-quotations/stripe/payment/webhook', bodyParser.raw({ type: 'application/json' }));

fallow tartan
tawny light
#

Thank You. Give me some minutes