#Fonseca - checkout redirects and webhooks
1 messages · Page 1 of 1 (latest)
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
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
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
oh, so its supposed to be 2 different pages?
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
Some high level info: https://stripe.com/docs/webhooks
A guide to build a basic endpoint: https://stripe.com/docs/webhooks/quickstart
Fonseca - checkout redirects and webhooks
well, now its redirecting to the success page
but the /webhook page still has the same error
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)
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
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?
No im not seeing nothing
No im not sure
Yes
Are you getting redirected to your success page after finishing checkout?
yes
And what does the stripe cli show in the listen command output?
yep
Can you share an example checkout session id?
like a new one or one that was completed alr
Is that on the stripe webpage, the CLI commands?
yes
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?
Yes
evt_123
evt_1LuM8eLVPYcWi3a5XcayfpGp
I'd suggest installing and running the CLI in your local terminal: https://stripe.com/docs/stripe-cli#install