#tovirio-payments
1 messages · Page 1 of 1 (latest)
@tired stump hi! it depends what information you already are starting with. So can you talk about your overall use case in more depth and what you already have?
sure
i need to retrive thi information
the same exact information that i can find inside a payment via web
amount, fee and net
each payment that i recive and is Succeeded
in the The charge object i can't find the fee
https://stripe.com/docs/expand/use-cases#stripe-fee-for-payment is how you get the fee for the payment
it's in the BalanceTransaction object, which is linked from the Charge
is possible to make one single query like a join to get it inside the charge?
yep that's what my first link is about
ah lol i didn't see
that Expand feature lets you expand other objects when retrieving one, so you can get a Charge object with the BalanceTransaction inside it.
can i do something like this?
charges = stripe.Charge.list(
limit=100,
expand=['balance_transaction.data.fee'],
)
it's just expand=['data.balance_transaction'] , like the docs say
then you write some code to loop over charges.data and you can read the information you want
this is not valid python, just pseudo code, but something like
https://stripe.com/docs/api/pagination/auto?lang=python
for charge in charges.auto_paging_iter():
print(charge.balance_transaction.fee_details.type)