#cent

1 messages · Page 1 of 1 (latest)

stiff estuaryBOT
drowsy mantle
#

Hi 👋 can you elaborate?

foggy ibex
#

but my endpoint is not doing redirect

drowsy mantle
#

Hm, it looks like your endpoint is sending that 308 status code back to us, we won't have much insight into why it is doing that.

Can you share the ID of an Event where you saw this behavior?

foggy ibex
#

evt_1Mmak4EnD23RzUmzxgUb21ID

drowsy mantle
foggy ibex
#

but how do I fix this?

drowsy mantle
#

We won't know that, it depends on how your endpoint is built and which part of your stack is causing your endpoint to respond with a redirect. Since you own and maintain that endpoint, you'll be best suited to debug and troubleshoot it.

foggy ibex
#

now I got different error when I added "/" to then end of my endpoint

#

but now I'm getting 400

#

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.
Signature verification is impossible without access to the original signed material.
Learn more about webhook signing and explore webhook integration examples for various frameworks at https://github.com/stripe/stripe-node#webhook-signing

GitHub

Node.js library for the Stripe API. . Contribute to stripe/stripe-node development by creating an account on GitHub.

#

here's my setup

drowsy mantle
#

Based on the error, it sounds like your endpoint is parsing the request we send to JSON rather than working with the raw request body as a string or a buffer. You'll need to identify the part of your flow that is doing that parsing and adjust/remove it.

foggy ibex
#

how ?

#

that's all I got

#

there's no other flow

drowsy mantle
#

I don't know, I'm not seeing anything in the code that you share that looks like it would do that, so I suspect it is happening somewhere else.

#

What web framework are you using?

foggy ibex
#

the event is been triggered by customers action in the billing portal

foggy ibex
drowsy mantle
#

Ah, I don't know Next, so the next part is going to be some guessing. Are you using API Routes?

foggy ibex
#

maybe I should try req.rawBody ??

drowsy mantle
foggy ibex
#

okay

#

done but it's still returning parsed obj

drowsy mantle
#

It's still throwing the error?

#

The request includes JSON data as a string, it will look like JSON even if it hasn't been parsed into a JSON object.

foggy ibex
#

but I'm still getting the error on stripe

drowsy mantle
#

You mean the constructEvent function that is being executed is still saying it's receiving a parsed object?

foggy ibex
#

this helped

#

thanks

drowsy mantle
#

Awesome, glad to hear you were able to get to the bottom of it!

stiff estuaryBOT