#BRData
1 messages · Page 1 of 1 (latest)
Hey! So my first question is - if a payment is captured is the stripe fee only calculated on the initial payment capture?
My second question is: when I am calling this: var result = service.Capture(paymentIntentID, options, requestOptions); is there a way to get the stripe fee from that call?
Such as result.fee
Hi 👋 fees aren't our strongest area of expertise, but my understanding is they are assessed at the time of capture.
You will need to get to the associated Balance Transaction object, so you can refernce the fee and fee_details there:
https://stripe.com/docs/api/balance_transactions/object#balance_transaction_object-fee
To get there, you find the Charge in the latest_charge field on the Payment Intent:
https://stripe.com/docs/api/payment_intents/object#payment_intent_object-latest_charge
Then the Charge has a balance_transaction field pointing to the BT object:
https://stripe.com/docs/api/charges/object#charge_object-balance_transaction
Im a bit confused
so is it possible to get the fee amount with the result?
var result = service.Capture(paymentIntentID, options, requestOptions);
I noticed my result is not returning anything about balance transactions
Should be able to, but you'll need to leverage expand to expand the Charge and Balance Transaction inline:
https://stripe.com/docs/api/expanding_objects?lang=dotnet
otherwise it would take multiple requests to get those fee details.
You will want to expand "charge.balance_transaction""latest_charge.balance_transaction" (edit: corrected)
Hello! I'm taking over and catching up...
Apologies, I mispoke, it should be "latest_charge.balance_transaction"
Please let Rubeus know if that still doesn't work though.
Jo
Hi*
So I just used that instead - but im still not seeing a balance_transaction in the result object
Hello! What are you seeing? Do you see the Charge object under latest_charge?
Can you give me the request ID for that capture request? Here's how you can find a request ID: https://support.stripe.com/questions/finding-the-id-for-an-api-request
Also, what version of the Stripe .NET library are you using?
That's probably the issue; you're probably using a version pinned to an older API version, and the library isn't aware of the latest_charge property.
Yeah, you need to dive into the charges property instead.
req_Ql8xXtATroVlPw
So you would need to expand charges.data.balance_transaction I think instead, then dive into the list and grab the first one there.
Yep, have a look at the request in your Dashboard here: https://dashboard.stripe.com/test/logs/req_Ql8xXtATroVlPw
You're on API version 2019-09-09.
You can see in the response your expansion worked; latest_charge is present, and the balance_transaction inside is expanded, but your .NET library has no idea that exists because it was added later.
So yeah, instead try expanding charges.data.balance_transaction and then dive into the Charges list and grab the first one.
Looks like Charges has a list in it, what is seen if that is expanded?
What's in charges?
Right, what's in Data?
Happy to help!