#murat-acar_api

1 messages Ā· Page 1 of 1 (latest)

sonic flickerBOT
#

šŸ‘‹ 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.

clear bloom
#

In there you'd find the id field for the Checkout Session, for example

cursive juniper
#

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

clear bloom
#

I don't know which event type you're looking at

#

Or which fields you're expecting in the event

cursive juniper
#

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.

clear bloom
#

Well where are you setting orderId? Which parameters?

cursive juniper
#

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

clear bloom
#

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

dense gustBOT
cursive juniper
#

cs_test_a1Wx2yfGy5bCiLOh0epWr1Mfj5fFEZJGNYmyiglrU5weH1mAzjY9c2CHV4

north coral
cursive juniper
#

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

north coral
#

what parameter exactly @cursive juniper ?

cursive juniper
#

ı passed to creating the Session "client_reference_id: 'merhabamurat',"

north coral
#

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 a checkout.session.completed event, 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.

cursive juniper
#

yes but I want to store all payment status and why them declined if the customer ask or any problem

north coral
#

you don't need to do that

cursive juniper
#

šŸ˜… thanks bro you are great have a nice day 🫔