#krista_webhooks

1 messages ¡ Page 1 of 1 (latest)

round radishBOT
#

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

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

fleet wadi
#

You have to grab the Payment Intent's latest_charge object and grab the Balance Transaction from that Charge instead

tardy jay
#

Ah ok! Thanks for such a quick answer. Can you give me a few minutes to try that before this chat is closed

#

When I run payment_intent.get("latest_charge") I get back the charge id... which in this case, is "ch_3Po7rMCkCC4mnept1gcR1rdc". Then when i run stripe.Charge.retrieve("ch_3Po7rMCkCC4mnept1gcR1rdc") the following error

stripe.error.InvalidRequestError: Request req_wFMQN88usrfzGS: No such charge: 'ch_3Po7rMCkCC4mnept1gcR1rdc'

fleet wadi
#

What do you see if you expand the latest_charge when you retrieve the Payment Intent?

tardy jay
#

Ah, I see the issue. You have to pass the stripe account id in that request.

#

I have the charge object now but there isn't a line for stripe fees... just the application fees

fleet wadi
#

You have to get the Balance Transaction from the Charge. Also, going back to your original question: why not listen for charge.succeeded event and skip the Payment Intent entirely?

tardy jay
#

Oh you're saying we can just short cut all this and listen for charge.succeeded webhook instead of checkout.session.completed?

fleet wadi
#

Yup!

tardy jay
#

ok, ill have our team look into it but for now, i am able to get to the balance transaction object through the latest change on the pyamnet intent.

#

thank you!

fleet wadi
#

Sure thing!