#suryansh_checkout-events

1 messages ยท Page 1 of 1 (latest)

mellow bronzeBOT
#

๐Ÿ‘‹ Welcome to your new thread!

โฒ๏ธ We'll be here soon! We typically respond in a few minutes, but in some cases we might need a bit more time (e.g., server's busy, you've got a complex question, etc.).

โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can 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/1251233850646990969

๐Ÿ“ Have more to share? Add details, code, screenshots, videos, etc. below.

earnest oriole
#

When you trigger checkout.session.completed, Stripe has to create all the associated objects that would lead to a successful Checkout Session. So it's expected that you would see other objects being created as a result of that trigger

nocturne hatch
#

But I also expect this event which is not coming

#

stripe trigger checkout.session.completed --add checkout_session:metadata.userId=665b7e58989a31e378890efa --add checkout_session:metadata.orderId=666c0125a489f157f9681cf6

this is the command that I ran

#

Setting up fixture for: product
Running fixture for: product
Setting up fixture for: price
Running fixture for: price
Setting up fixture for: checkout_session
Running fixture for: checkout_session
Setting up fixture for: payment_page
Running fixture for: payment_page
Setting up fixture for: payment_method
Running fixture for: payment_method
Setting up fixture for: payment_page_confirm
Running fixture for: payment_page_confirm
Trigger succeeded! Check dashboard for event details.

this is the output I received

#

@earnest oriole

earnest oriole
#

So the issue is that the metadata isn't being included?

nocturne hatch
earnest oriole
#

Is that endpoint on a running server? I'm confused about what's actually happening here. Is your endpoint responding at all?

nocturne hatch
#

it is running on local right now.
I ran this command to listen webhook triggers on local

stripe listen --forward-to http://localhost:3000/api/webhooks/stripe

earnest oriole
#

Do you have an example Event ID for one of the events you triggered? I wanna look to see what's happening with the webhook delivery status

nocturne hatch
#

from where can I get the event id?

earnest oriole
mellow bronzeBOT
nocturne hatch
#

test event id - evt_3PReRzSGZCEQMkDa1X5Fnmt0

river tundra
#

Hi, are you using two different terminals one where you forward events to the localhost and the second where you trigger these events?

nocturne hatch
#

yess correct

river tundra
#

Does the checkout.session.completed event id show on your terminal?

#

If your local server running?

nocturne hatch
#

No the id doesn't show up, local server is running

river tundra
#

What CLI version are you using?

#

Can you run this debugger stripe listen --forward-to localhost:3000/hooks --log-level=debug?

nocturne hatch
nocturne hatch
#

These are events triggered just now

stable lava
#

And what did your terminal show while those events were being sent? Was there any debug output?

nocturne hatch
stable lava
#

Interesting that you did get the product.created event but not the others.

nocturne hatch
#

I got all the events

#

mentioned above

#

only checkout.session.completed is missing

#

I don't know why it is missing even though I'm triggering it by same name

stripe trigger checkout.session.completed --add checkout_session:metadata.userId=665b7e58989a31e378890efa --add checkout_session:metadata.orderId=666c0125a489f157f9681cf6

stable lava
#

And when you ran that command a few minutes ago, it gave the normal output about setting up and running the fixtures? I don't see any record of a Checkout Session with that metadata being created in the last twelve hours, which is also when I see the last instance of that event on your account being triggered.

nocturne hatch
# nocturne hatch I don't know why it is missing even though I'm triggering it by same name `stri...

Setting up fixture for: product
Running fixture for: product
Setting up fixture for: price
Running fixture for: price
Setting up fixture for: checkout_session
Running fixture for: checkout_session
Setting up fixture for: payment_page
Running fixture for: payment_page
Setting up fixture for: payment_method
Running fixture for: payment_method
Setting up fixture for: payment_page_confirm
Running fixture for: payment_page_confirm
Trigger succeeded! Check dashboard for event details.

This is the output of this command

nocturne hatch
#

these are all test events

stable lava
#

Ah actually, the only time I can see a checkout session with that metadata being created in the past 24 hours was from you running your Node.js code. The strange thing is that I can see my own API calls from the CLI in our logs but I don't see them for your account for anything that would create a checkout session like this recently.

nocturne hatch
stable lava
#

Actually, spoke a bit too soon there. Digging in to the logs more and I will get back to you with what I can find. Apologies this is a bit of a weird one. Can you try creating and completing an actual test mode checkout session to see if that triggers the event properly?

nocturne hatch
#

Ah I received it when I used the deployed webhook but not coming on local test

#

evt_1PRgehSGZCEQMkDalWYQvY0D - check this event id

#

let me know if I'm doing something wrong on local test

stable lava
#

I actually see that we got an HTTP 200 acknowledgment back from the CLI about that event. It is so strange that we are getting that but it isn't even showing up on your debug logging

#

Just to go back to IT basics, have you tried restarting your machine? I am trying to think of what else to check.

nocturne hatch
#

Yes I have.. It's ok for now it is working on deployed url.. I'll continue testing this way

#

Thank you for helping out

stable lava
#

Gotcha, thank you for your patience. Good luck with testing

mellow bronzeBOT