#murat-acar_api
1 messages Ā· Page 1 of 1 (latest)
š Welcome to your new thread!
ā²ļø We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
ā±ļø We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always 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/1242415514417106964
š Have more to share? Add more details, code, screenshots, videos, etc. below.
The full object related to the event is included in the webhook payload, under the data[object] field: https://docs.stripe.com/api/events/object#event_object-data-object
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
In there you'd find the id field for the Checkout Session, for example
None of the field values returned from the '-await this.stripe.checkout.sessions.create-' method are present in the object returned from the webhook. wanna share the responses?
so i can not handle which order i accept or decline
I don't know which event type you're looking at
Or which fields you're expecting in the event
When a payment fails, multiple POST requests are sent to my webhook. The types of incoming objects are: (charge.failed, payment_intent.payment_failed, checkout.session.completed, charge.succeeded etc.). When I receive multiple payments at the same time, I can't select which one belongs to which order. Therefore, I expect a field in the data returned from the 'await this.stripe.checkout.sessions.create' method to match with a data in the object sent by the webhook (like orderId) so that I can distinguish.
Well where are you setting orderId? Which parameters?
I want to keep track of whether customers' payments are successful or not in my database. That's why I'm trying to reference the ID information returned from the 'stripe.checkout.sessions.create' method. In the 'Fulfill orders with Checkout' step, if the payment is successful, I see that the ID value returned from the method matches with an object's ID value in the data posted to my local. This way, I can understand that my payment was successful. However, when the payment fails, none of the parameters sent to my local match with the ID returned from the method
Yes, but which parameter are you using to set the ID/reference when creating the Checkout Session? This is important as it'll determine what fields are set on what objects/events
If you can share a cs_xxx ID that'll be helpful
cs_test_a1Wx2yfGy5bCiLOh0epWr1Mfj5fFEZJGNYmyiglrU5weH1mAzjY9c2CHV4
well you are not passing anything to the API when creating the Session https://dashboard.stripe.com/test/logs/req_6WNMJvXm5fOp3u like metadata or client_reference_id . Maybe consider doing that if you need to match up this session?
ok great. I can handle payment when it success. I can see my parameter and i can see the cs_xxx inside the object. but when fail i can not see my passed parameter
cs_test_a1PhmIorji86HrvqJpCwwTUttwxrwCv98xscdodEAK5qndVykP2A95ZSWi
what parameter exactly @cursive juniper ?
ı passed to creating the Session "client_reference_id: 'merhabamurat',"
cool. That value will be inside the checkout.session.completed event.
but when fail i can not see my passed parameter
not sure what you mean. There is no failure state for Checkout. If and when the customer pays, you get acheckout.session.completedevent, that's it. If they have problems paying, it's handled inside the Checkout page and is not something you need to interact with, you only need to care about successful payments.
yes but I want to store all payment status and why them declined if the customer ask or any problem
you don't need to do that
š thanks bro you are great have a nice day š«”