#pandareaper

1 messages · Page 1 of 1 (latest)

worn spearBOT
tight rampart
knotty cosmos
#

yes I am

tight rampart
#

OK. You can filter the transactions by type=== charge, one you have the charge objects, you can trace back associated payment_intent from a charge.

knotty cosmos
#

I can't seem to see any charges, both when searching with and without the payment id (py_...) as a source and on the main and connected accounts

tight rampart
#

It looks like you are using destination charge, you should filter type===payment.

knotty cosmos
#

So I believe thats what I'm doing

  const payments = await StripeClient.balanceTransactions.list({
    payout: payoutId,
    type: 'payment',
  }, {
    stripeAccount: connectedAccountId,
  });

Is it possible to link these payments to payment intents in the main account ?

eternal adder
#

can you share an example payment id?

knotty cosmos
#

py_1MSGd7FQsYB3k7vxJeKxhSW1

tight rampart
#

Hi @knotty cosmos can you also share with me the payout ID?

knotty cosmos
#

po_1MTUMqFQsYB3k7vx5rupDHUh

tight rampart
#

Thanks. You said that the result was empty when you set type to charge, can I confirm if your code is something like the following?

const payments = await StripeClient.balanceTransactions.list({
    payout: payoutId,
    type: 'charge',
  }, {
    stripeAccount: connectedAccountId,
  });
knotty cosmos
#

Thats right, I get an empty list

{
  object: 'list',
  data: [],
  has_more: false,
  url: '/v1/balance_transactions'
}
tight rampart
#

On the same payout object?

knotty cosmos
#

Yeah, the only thing I changed in that code is the type

tight rampart
knotty cosmos
#

When I list all balance transactions for the payout e.g.

  const payments = await StripeClient.balanceTransactions.list({
    payout: payoutId,
  }, {
    stripeAccount: connectedAccountId,
  });

I get back 3 balance transactions, one is for the payout itself, the other two are both of type: 'payment'. The reporting_category is charge , is this what you are referring to when you mention charges?

tight rampart
#

Yes. So if you set type=charge, does it still return empty list?

knotty cosmos
#

Yes it returns an empty list. Which I would expect given the type is actually payment on these balance transactions

Example details of the payment when searching without a type filter

      reporting_category: 'charge',
      source: 'py_1MSGd7FQsYB3k7vxJeKxhSW1',
      status: 'available',
      type: 'payment'

tight rampart
#

Alright, how about type=payment ?

knotty cosmos
#

That returns two balance transactions for two payments associated with that payout, which is what I expect. I am just trying to find the payment intents that are related to those payments

tight rampart
#

Hmm, actually another way is just to set type=transfer, and filter those transfer which have source_transaction set.

knotty cosmos
#

thanks for that mate! got what I needed

tight rampart
#

Good to hear!