#kun_webhooks

1 messages · Page 1 of 1 (latest)

sturdy heraldBOT
#

👋 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/1275534835796017236

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

sudden echoBOT
#

Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

pale orbit
#

Hello
Does your server have a middleware that parses incoming responses to JSON automatically? if so, you'd need to disable that

polar tree
#

shoud I show you the response?

pale orbit
#

If you print out the response, are you seeing JSON or buffer?

polar tree
#

its JSON

pale orbit
#

That means your server is parsing the incoming payload automatically

polar tree
#

here is the body
code

#
api_version =
'2019-02-11'
created =
1724181508
data =
{object: {…}}
id =
'evt_1PpxZYFrwl37tCGiACPt2atI'
livemode =
false
object =
'event'
pending_webhooks =
2
request =
{id: 'req_xG0TK2sXQUpRYP', idempotency_key: '9a2a3a93-67f9-4ebf-98e1-a7aff494540d'}
type =
'customer.created'```
#

yes

#

this is my request.body

#

let me shwo you the signature and webhook secret which both are string

#

any help?

pale orbit
#

I think you're confused.. The issue is not with your Stripe handler. It is with your server configuration..

Like I mentioned, it converts any incoming request payload to JSON automatically. So you'd need to look into the code that configures your node server and make sure you disable that behavior for the webhook endpoint route

polar tree
#

But the payload has to convert into JSON my whole application is using JSON formated data

#

will it be same issue on the live mode ?

pale orbit
#

Yes. Since the payload is getting converted to JSON prior to constructEvent is called, the payload is considered mutated. In which case, signature verification will fail.

polar tree
#

ok
so it should be in raw from sended by stripe webhooks/

#

?

pale orbit
#

yes

polar tree
#

ok let me ask some more questions so I can handle it perfectly

#

do I need signature and webhook signature in live enviorment Whichwill be using public https url for webhooks?

pale orbit
#

Yes, signature verification is required so that you only process the events that came from Stripe