#krista_webhooks
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/1275511425686700033
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- krista_webhooks, 4 days ago, 15 messages
That's a Checkout Session object. If you want the Balance Transaction, then you need to get the Payment Intent from the Checkout Session object and inspect its corresponding Charge object via latest_charge: https://docs.stripe.com/api/payment_intents/object#payment_intent_object-latest_charge
The Charge object will ultimately have the Balance Transaction on it
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
yes we do that.
From the webhook, we query the payment intent, then the charge event and then the balance transaction (all in that order). When we first get the webhook, this fails to get the balance transaction from the charge event because its null.
If I click resend from the dashboard, it all works and we are able to get the balanace transaction event.
Hello, are you still there?
Hi, sorry for the wait. Looking now
Ok no rush at all! Just making sure we were still coneected. Thank you
So what are you actually doing? You're retrieving the Charge using the Charge ID on the Checkout Session's Payment Intent, yes?
Correct
And that happens immediately after getting the checkout.session.completed event?
Yes as soon as we get the webhook, we create the order on our end and then run this section of code
The line that fails when we get the webhook is balance_id = charge_event.get("balance_transaction") ... and thats because in the logs, I can see the charge event's balance_transaction is null.
The second time when I manually trigger the webhook to be resent, it does have the balance_transaction
Usually this happens because the Charge has been confirmed but hasn't yet resulted in money movement, so there is no corresponding Balance Transaction. You can get around this by listening for the charge.succeeded Event instead. Not sure if that helps your situation or not though.
Hmmm ok I understand. For the charge.succeeded events, where do I subscribe to that? In the dashboard, I am only getting the checkout.session.completed events
You need to setup your webhook endpoint in the Dashbaord to listen for them: https://dashboard.stripe.com/test/webhooks
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
I have that setup here https://dashboard.stripe.com/test/webhooks/we_1KQyLlCfwYrvlXdJinHeZQ1y
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
But the only event coming through is account updated checkout.session.compelted
It doesn't look like that webhook endpoint has charge.succeeded enabled. I only see these events:
checkout.session.expired
checkout.session.completed
account.updated
how do i update that? I dont see that option on this secreen
You select the elipses menu at the top right and edit it to enable that event
oh im an idiot sorry
thank you for your help. ill try working with teh charge.succeeded webhook.
No worries, we really don't surface that functionality especially well IMO. I had to check myself to make sure it was there
Appreciate the help! Hope you had a great day