#TzarBuba-reports

1 messages · Page 1 of 1 (latest)

tawny hawk
hexed basin
#

Hey, let me a few minutes to see it

#

yes I'm doing it myself, using node

#

oh, that is kind of different from what I started doing

#

I started with stripe.charges.list()

#

so it's better to use stripe.paymentIntents.list()

tawny hawk
#

that works too, PaymentIntents ultimately create Charges

hexed basin
#

and then use this prop expand

hexed basin
#

unless I use like n2 forloop and on every charge payment retrieving the expand property

#

sorry for my english

#

i have to investigate more about this prop expand

tawny hawk
#

you can pass expand when listing

hexed basin
#

🤔

#

ok, yeah

tawny hawk
#

for example you pass expand=['data.balance_transaction'] when listing Charges so that the fee is returned as part of the response

hexed basin
#

I have to see the response of this call

#

I assume it would be like { amount: 1000, // number or string fees: 100, // number or string stripe_fees: 12, // number or string }

#

this is my goal

#

if I'm able to get such information from charges/paymentintents it would be great

tawny hawk
hexed basin
tawny hawk
tawny hawk
#

since you seem very lost give me a minute to write some code

hexed basin
#

now I will check the fee details

#

probably it will have everything

hexed basin
tawny hawk
#

yep

hexed basin
#

I don't know how to explain myself in english sorry

tawny hawk
#

here's roughly what I would do anyway

stripe.charges.list({limit: 3, expand:["data.balance_transaction"], created:{gte:"1641994539"}, status:"paid"})
  .autoPagingEach(function(charge) {
    console.log(charge.amount)
    if(charge.balance_transaction){
        for(let fee of charge.balance_transaction.fee_details){
             console.log(fee.amount)
             console.log(fee.type)
        }
    }
  });
hexed basin
#

this response looks ok

    {
      amount: 539,
      application: null,
      currency: 'bgn',
      description: 'Stripe processing fees',
      type: 'stripe_fee'
    }
],```
hexed basin
#

created:{gte:"1641994539"}, would list only charges after date

#

woah 🤯

#

and autoPagingEach is forlooping in the api

#

I've been amazed right now

tawny hawk
#

🙂

hexed basin
#

about the fees

#

is there different types of fee, I mean, I have to find a test card that make fees like bank fee or transaction fee, because all my balance_transaction have type: 'stripe_fee'

tawny hawk
#

the possible types are at https://stripe.com/docs/api/balance_transactions/object?lang=node#balance_transaction_object-fee_details-type

application_fee is if you're looking at a Charge on your account created by a Connect platform that took a slice of the payment (https://stripe.com/docs/connect/direct-charges#flow-of-funds-with-fees)

stripe_fee is our fee per our pricing pages on stripe.com/pricing

tax is the value-added-tax we take on the fee in certain countries

those are the only possibilities

hexed basin
#

❤️

#

it would take me some time to check it and test it

covert lake
#

Hey there @hexed basin I just wanted to confirm that my teammate was able to get you the information you were looking for?

hexed basin
#

aye, I'm ready with this

#

this thread was really helpful and open my eyes how much I don't know about the stripe api