#Fonseca - checkout redirects and webhooks

1 messages · Page 1 of 1 (latest)

clear runeBOT
static forge
#

Do you mind moving those other messages here?

#

Is this related to the question in the other thread we had?

#

It seems different at a surface level

#

Where are you encountering the error with the request body?

#

Certainly the webhook delivery request should have a body

red root
#

Im sorry

#

oh ok yea

#

Im trying to handle this checkout.session.completed event but i keep getting this error
Im imagining its that the webhook its not sending the request that the event happened to the endpoint
but its supposed to be

static forge
#

ok you seem to be mixing up the success page redirect and the webhook event

#

This looks like a handler for your success page, there you grab that session ID from the query params

red root
#

oh, so its supposed to be 2 different pages?

static forge
#

well webhooks are a "page" so to speak, its a server endpoint for our servers to deliver messages to

#

You'd get the webhook to some /webhooks endpoint, then separately the customer is redirected to /successpage

red root
#

ok

#

lemme do that

static forge
#

Fonseca - checkout redirects and webhooks

red root
#

well, now its redirecting to the success page

#

but the /webhook page still has the same error

static forge
#

This is not a page you'd visit -- you need to set up a webhook endpoint to deliver events there, or use the Stripe CLI to test this

#

stripe listen --forward-to localhost:5000/webhooks

#

Since its a locally running endpoint, the CLI is the best way to do this (there are other ways like ngrok)

red root
#

okok

#

im doin all that, but it doesnt seem to be working since i dont see no transfers happen in my dashboard

#

im imaging its the webhook but now i dont see errors

static forge
#

Are you seeing the webhooks arrive in the terminal following checkout?

#

And is your server receiving them?

#

Are you certain your code is reaching the transfer creation code path?

red root
#

No im not seeing nothing
No im not sure
Yes

static forge
#

Are you getting redirected to your success page after finishing checkout?

red root
#

yes

static forge
#

And what does the stripe cli show in the listen command output?

red root
#

yep

static forge
#

Can you share an example checkout session id?

red root
#

oh

#

lemme show u

red root
static forge
#

Is that on the stripe webpage, the CLI commands?

red root
#

yes

static forge
#

I think you'll need to run the CLI locally for your setup, because otherwise your server wouldnt be reachable

#

But it should show events

#

Can you copy one of those IDs for me?

red root
#

Yes

static forge
#

evt_123

red root
#

evt_1LuM8eLVPYcWi3a5XcayfpGp

static forge
red root
#

ok doin that rn

#

it worked thank u