#suryansh_checkout-events
1 messages ยท Page 1 of 1 (latest)
๐ 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.
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
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
These are the events received by webhook @earnest oriole
@earnest oriole
So the issue is that the metadata isn't being included?
that is also the case but main issue is that webhook is not receiving checkout.session.completed event. Check file for all events and session object received
Is that endpoint on a running server? I'm confused about what's actually happening here. Is your endpoint responding at all?
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
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
from where can I get the event id?
You should be able to view it from here: https://dashboard.stripe.com/test/events
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
test event id - evt_3PReRzSGZCEQMkDa1X5Fnmt0
Hi, are you using two different terminals one where you forward events to the localhost and the second where you trigger these events?
yess correct
Does the checkout.session.completed event id show on your terminal?
If your local server running?
No the id doesn't show up, local server is running
What CLI version are you using?
Can you run this debugger stripe listen --forward-to localhost:3000/hooks --log-level=debug?
stripe version 1.20.0
sure
These are events triggered just now
And what did your terminal show while those events were being sent? Was there any debug output?
Yes
Interesting that you did get the product.created event but not the others.
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
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.
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
Are you checking test events? created by stripe-cli
these are all test events
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.
Yeah I'm also confused about the same thing. other event logs are coming but only checkout session is not present
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?
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
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.
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
Gotcha, thank you for your patience. Good luck with testing