#marco.melillo-earnings

1 messages · Page 1 of 1 (latest)

echo hawk
#

Hi! FYI we have a Stripe product that can help with this: https://stripe.com/sigma
Otherwise if you want to do that manually, then you have a few options:

  • List all the PaymentIntents (like you suggested)
  • List all the charges
  • List all balance transactions
hoary marten
#

yes I have tried with the paymentintent and I can get the list and the parameters I need except the commissions

echo hawk
#

By commission you mean the Stripe fee?
The PaymentIntent object has a charge parameter, the Charge object has a balance_transaction parameter. And the BalanceTransaction object has a fee parameter.

hoary marten
#

like this?

echo hawk
#

Is this Java? I'm not familiar with this language. Are you getting an error when running this code?

hoary marten
#

no but the fee is always 0. I think that being tested with paymentintents created by me, the fee will not come out if I don't confirm them somewhere. right ?

echo hawk
#

Can you share a PaymentIntent ID (pi_xxx)?

hoary marten
#

pi_3KCNDiIeBM9JjIfS2TuWHiTb

echo hawk
#

This PaymentIntent has status: requires_payment_method, so it has no charges, which means there are no fees.
You need to only look at PaymentIntent with status: succeeded.

#

Also, are you aware that you can export a csv of all your payments, including the stripe fees, directly from the Stripe dashboard?

hoary marten
#

I read that by inserting a particular card as a payment method, the payment was automatically accepted ... right?

sleek zinc
#

That depends on which test card(s) you're using?

hoary marten
#

this is my paymentintent creator

#

if i set this card, the status change in succeeded automatically

#

^^

sleek zinc
sleek zinc
sleek zinc
hoary marten
#

I created and approved a payment but it doesn't come out. in the call for the paymentintent list there is a field to take only those with status success?

sleek zinc
#

but it doesn't come out
I'm not sure what that means
in the call for the paymentintent list there is a field to take only those with status success
There's no status filter parameter no

hoary marten
sleek zinc
#

What are you looking to do/build?

hoary marten
#

i should print all my earnings in a time range. For each I need id, amount, customer, date, and the commission that stripe was taken on that payment

sleek zinc
hoary marten
#

I have seen, but it seems to me that with this I have no customer data or am I wrong?

sleek zinc
hoary marten
#

can you give me an example? it's not clear to me

sleek zinc
#

Are you using one of our client libraries?

hoary marten
#

yes

sleek zinc
#

Which..?

hoary marten
#

<dependency>
<groupId>com.stripe</groupId>
<artifactId>stripe-java</artifactId>
<version>20.93.0</version>
</dependency>

sleek zinc
#
List<String> expandList = new ArrayList<>();
expandList.add("source.customer");

Map<String, Object> params = new HashMap<>();
params.put("expand", expandList);
params.put("type", "charge");

BalanceTransactionCollection balanceTransactions =
  BalanceTransaction.list(params);
#

Maybe something like that will get you started

hoary marten
#

ok very kind, I'll try this and let you know

hoary marten
#

not work

mossy python
#

yep, as the error says, you want data.source

hoary marten
#

yes now work

mossy python
#

so on line 33 you should use "data.source.customer"