#roshe10_code

1 messages ¡ Page 1 of 1 (latest)

daring tartanBOT
#

👋 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/1366803196667891744

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

dire geyser
#

Could you share an example Charge ID (ch_xxx) for the issue that you're describing?

rich fjord
#

sure, ch_3RJGGdGSblWe99ue0mEQ6T8O

dire geyser
#

I can see that balance transaction is available on this Charge object. When did you attempt to retrieve the balance transaction from this charge? Was it after receiving a specific event, or immediately after returning to the success_url of your Checkout Session?

rich fjord
#

after retrieving payment_intent.succeeded event, and I see bt object in dashboard as well. But I assume this is something with package code. In the API charge object seems to store only BT ID, not the BT object, but here it's expecting the object and I was thinking whether it was due to versions, but this image is from the latest source code

#

on the side note, is there any other route getting BT ID/object from payment intent object (since I need that from payment intent succeeded event)

#

specifically, my end goal is to get net amount after payment intent succeeded

dire geyser
#

Thanks for waiting! There is a delay in populating balance_transaction. If you retrieve the Charge object now, do you get the balance_transaction in your code?

#

We generally recommend listening to charge.* related events to get the balance transaction information

rich fjord
#

hmm, so you saying it won't be available in payment_intent.succeeded event (e.g. evt_3RJGGdGSblWe99ue0P6rhFAA), but only if I listen for charge.updated ?

#

and to answer your quesition, yes I get BT object now, so it's due to the delay

#

okay, I will give a try with charge_updated but how to be sure charge updated came after my payment intent suceeded ?

#

can charge.update ever come before it ?

dire geyser
#

In https://docs.stripe.com/upgrades#2024-04-10,

PaymentIntents now has automatic_async as the default capture method when capture method is not specified during PaymentIntents creation. For more information about async capture, view the asynchronous capture guide.

I'd recommend following the async capture guide here: https://docs.stripe.com/payments/payment-intents/asynchronous-capture#listen-webhooks

Use Asynchronous Capture to enable faster PaymentIntent confirmations.

Keep track of changes and upgrades to the Stripe API.

rich fjord
#

okay, thank you

dire geyser
#

balance_transaction will only be available after the capture is successful. Stripe will send a separate charge.updated to notify you when balance_transaction becomes available

rich fjord
#

I see, thanks once again