#roshe10_code
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/1366803196667891744
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
Could you share an example Charge ID (ch_xxx) for the issue that you're describing?
sure, ch_3RJGGdGSblWe99ue0mEQ6T8O
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?
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
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
For this ch_3RJGGdGSblWe99ue0mEQ6T8O as an example, balance_transaction is available at charge.updated event: https://dashboard.stripe.com/test/events/evt_3RJGGdGSblWe99ue0sefH00X
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
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 ?
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
okay, thank you
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
I see, thanks once again