#rafaelbaptista-disputes

1 messages · Page 1 of 1 (latest)

serene aspen
#

👋 happy to help

#

Disputes usually come directly from the issuing bank

#

Submitting the evidence on the other hand is something that the Platform should handle and not the connected account

serene abyss
#

Right, what i'm asking is this:
From what i read the platform is the one responsable to submit the evidences on the disputes. But on our system, in some cases the connected account is the one that have the evidence (for example: if the product as delivered or not,...) .. so what i was asking if stripe allow connected accounts to submit evidence insted of the platform

#

Another question that i have is on the payments part. I'm using destination charges and when a payment is made on my platform i store the chargeid on the database so i can know what charge on stripe is associated with the checkout .. The problem is, when listing the charges i dont get the ch_ but the py_ so i dont have a way to link it to my system checkout

serene aspen
#

Submitting the evidence on the other hand is something that the Platform should handle and not the connected account
since the Payment was initially created but the Platform (as a Destination Charge)

#

so what i was asking if stripe allow connected accounts to submit evidence insted of the platform
in that case you could do something in your Platform's application to let the Connect Account know about the dispute and submit to you the evidence which you would eventually submit to the Stripe API on their behalf afterwards

serene abyss
serene aspen
#

unfortunately today there is no way of filtering this

serene abyss
#

so if i want to show the disputes to a particular connected account i would have to list all of the disputes of the platform?

#

The only what that i saw to accomplish this is do a get of all the charges and then use the charge id to filter the disputes in a loop, that way i only get the disputes of the charges associated with that connected account

serene aspen
#

honestly I don't know that, but I'm trying to get you an answer

serene abyss
serene aspen
#

what do you mean by py?

serene abyss
#

the id of the charge is py_1KuaYd2EN2fYHAOBpBSeA4C8

#

insted of ch_

serene aspen
#

yes sorry

serene abyss
#

do you need more information ?

serene aspen
#

no sorry, basically in order to filter the disputes you could list them all and expand on payment_intent and then filter on the transfer_data.destination

serene abyss
#

when i do expand from the payment_intent i get no info

                $disputes = \Stripe\Dispute::all(["limit" => 999999],["expand" =>["payment_intent"]]);
serene aspen
#

it's data.payment_intent for the expand

#

my bad 🙈

serene abyss
#

one of disputes is working but the one that was originated by the test payment card for disputes is not showing the payment intent, can you help me?

serene aspen
#

could you give me the dispute id ?

serene abyss
#

of course, is this one dp_1KuZvpCRI4H2eNZZXB8dEmzU

serene aspen
#

this one was created by the old Charges API and not the PaymentIntents API

#

you can expand on data.charge as well

serene abyss
#

yes our system is on the old api version, is that a problem?

serene abyss
serene aspen
#

yes our system is on the old api version, is that a problem?
no

#

I would recommend moving to Payment Intents but it's up to you

serene abyss
#

alright, thanks
to do the filter of the transfer_data.destination do i have to do it manually with a loop or stripe api lets me filter that property ?

serene aspen
#

unfortunately you'll have to do it manually

serene abyss
#

allright no problem, regarding the other question that i ask, you were able to find an answer?

serene aspen
#

which one please?

serene aspen
#

the py charge originated by the ch dont get any information of the checkout i pass
I don't think I got your question, could you please elaborate?

serene abyss
#

no problem i'll explain and give you contest so you can understand.

So on my system i'm using destination charges. When i make a checkout on my system i save allways the charge id on db linked to that checkout ( that charge id is starting with ch_).

But when i'm listing all the payments to the connected account i only get ids that start with py_ and not the charge id that was previusly linked on my internal checkout

side note : (what is the correct way to retrive the charges of a connected account, using secret key from platform and stripe-account header with connected account id?

serene aspen
#

But when i'm listing all the payments to the connected account i only get ids that start with py and not the charge id that was previusly linked on my internal checkout
because you're listing all the Payments and not all the Charges

serene abyss
#

sorry i call the charges payment sorry for confusing you

\Stripe\Stripe::setApiKey($strPrivate);

                $invoices = \Stripe\Charge::all(["limit" => ($this->input->get("length")>0 ? $this->input->get("length") : 999999)]);
serene aspen
#

which API version are you using?

#

any request id you could share?

serene abyss
#

how can i get that information?

serene aspen
serene abyss
#

found it, was on different timezone

#

req_XAx0pYUWk74RX4

#

version Stripe/v1 PhpBindings/6.43.1

serene aspen
#

could you please send me the response message you get? just one charge would be enough

serene abyss
#

1sec

serene aspen
#

do you have an example of a ch_xxx that you're not able to see in the list?

serene abyss
#

yes, this is the last checkout that i made on my system, the charge id that was save on database was this one : ch_3KuaYcCRI4H2eNZZ060CnkvR

serene aspen
#

are you using your Platform secret to get all of the Charges? or you're using the Connect Account's secret key?

serene abyss
#

I'm using the connect account secret key

serene aspen
#

there you go, here lies the problem

#

so to explain it simply, the idea is when you create a Destination Charge, the charge is created on the Platform's account, but the Platform is also paying a cut to the Connect Account, which means that a Charge object ch_xxx will be created on the Platform's account data and a Payment object py_xxx will be created on the Connect Account

#

so when you're using the secret of the Connect Account you're asking for all the payment that this account has received, which technically are the payments the platform has sent.

serene abyss
#

So when listing the payments to a connected account should i List the charges or the payments sent by the platform?

serene aspen
#

you need to list them on the Platform account and then use the transfer_data.destination to filter on the account

#

for the time being it's the best way to keep track of the ch_xxx ids you store in your db

serene abyss
#

So to reflet also the correct information to show to the connected account i should use also the amount of the transfer data insted of the global amount of the charge since that is the amount paid to the platform... Is this correct?

#

Should i also store the payment id when a check-out is made? If yes how can i get that info when a charge is made

serene aspen
#

Should i also store the payment id when a check-out is made?
Do you mean the py_xxx for the Connected Account?

serene abyss
serene aspen
#

So to reflet also the correct information to show to the connected account i should use also the amount of the transfer data insted of the global amount of the charge since that is the amount paid to the platform... Is this correct?
yes

#

Should i also store the payment id when a check-out is made?
no need I guess

serene abyss
#

its possible to know if that charge was already paid to the connected account?

serene aspen
serene abyss
#

$invoice = \Stripe\Charge::retrieve($this->uri->segment(4), ["expand" => ["data.transfer"]]);

is called this way? seems that the transfer object dont expand when doing this

serene aspen
#

sorry I might have been wrong, I'm trying to figure this out just give me a second please

serene abyss
#

alright, no problem thanks

serene aspen
#

ok so what you need to expand on is basically the balance_transaction (without using data. because you are retrieving only on Charge vs when you expand on a call that retrieves a list, then you'd need to add the data.)

#

if the balance_transaction.status is available then the Connect Account has received the money on their Account

serene abyss
#

i got the balance_transaction empty

#

any ideia why?

serene aspen
#

can you give me the ch_xxx you're using?

serene abyss
#

yes, is this one: ch_3KuZumCRI4H2eNZZ1Tq4uxwQ

#

the code using to retrive the charge is like this
$invoice = \Stripe\Charge::retrieve($this->uri->segment(4), ["expand" => ["balance_transaction"]]);

serene aspen
#

because this charge didn't succeeded (card_declined)

serene abyss
#

ok , this one is succed ch_3KuaYcCRI4H2eNZZ060CnkvR but the expand is not working

#

only get this : [balance_transaction] => txn_3KuaYcCRI4H2eNZZ0bY5ujek

serene aspen
#

using the same code you sent earlier?

serene abyss
#

Yes

serene aspen
#

this is weird

serene abyss
#

is my code correct ?

serene aspen
#

$stripe->charges->retrieve(
'ch_xxx',
['expand' => ['balance_transaction']]
);

#

normally it is

serene abyss
#

yap that is exaccly what i'm using :

serene aspen
#

I don't know if there's a bug in the version of PHP you're using

#

but could we try to expand on another field? let's try customer and see

serene abyss
#

customer also didnt expand the customer

#

only get the id like before

serene aspen
#

I think there's a bug in the version you're using

serene abyss
#

from what i'm seeing on the sdk the second parameter where we are passing the expand is only used to pass things like this

#

i dont think there is a way to expand the object when retriving a charge by id

#

can you confirm this

serene aspen
#

I'm trying to find how to expand in your case, one second

serene abyss
#

ok, thank you

serene aspen
serene abyss
#

can i use this with the version of the sdk/api that im using?

serene aspen
#

what's the version you're using?

serene abyss
serene aspen
#

the latest version is v.7.125.0

#

I don't think the search is available for your SDK and most probably for your API version, but you could use the newest API version for this call in particular

serene abyss
#

you mean insted of the sdk use curl to make the call?

#

but this call of search that you are refering to was to insted of doing that manual filter of the transferdata . destination in a for loop replace that with this new search api call?

#

but regarding the other matter of expand to know if the charge was paid already to the connected account were you able to get more information on that?

serene aspen
#

you mean insted of the sdk use curl to make the call?
no

#

but this call of search that you are refering to was to insted of doing that manual filter of the transferdata . destination in a for loop replace that with this new search api call?
yes

#

but regarding the other matter of expand to know if the charge was paid already to the connected account were you able to get more information on that?
still looking at it

#

it seems that this is a limitation of the version you're using

#

I would strongly advise you upgrading to the latest PHP version

serene abyss
serene abyss
#

and i dont know exacly what would break if we do upgrade to the new version

serene aspen
#

for now i think i would use the sdk with that manual filter that you told me, that is also a correct way to do it right?
yes

#

if you can't expand you'll have to retrieve the balance_transaction with a separate call

serene abyss
#

theres no way to do that expand on older versions?

serene aspen
#

on the list yes

#

on the retrieve I'm afraid not

#

Just a curious question, why are you retrieving the Charge?

#

since you're getting all the Charges from the list, you don't need to make a separate calls to retrieve individual Charges

serene abyss
serene abyss
#

thats why i need to do the charge::retrive

serene aspen
#

yeah you're right, in that case you'd need to make a few extra calls

#

to retrieve the information of the expandable fields

serene abyss
#

would love to simplify the process ahah but seems that this is the only way ( retrive the charge first and after the balance transaction)

serene aspen
#

I think I found a way for you to do that

#

could you please test this?
\Stripe\Charge::retrieve(['id'=> $this->uri->segment(4), 'expand' => ['balance_transaction']]);

#

@serene abyss did it work?

serene abyss
#

srry didnt get the discord notification, let me try 1 sec

serene aspen
#

tyt

serene abyss
#

you are the men, it worked

#

so in order to use expand on call were i retrive by id, i should allways put the id with that key "id" and then the expand array

serene aspen
#

my bad as well, sometimes between versions things change and it might generate confusion

serene abyss
#

dont worry, thank you so much for the assitance

serene aspen
#

let me know if you need any more help

#

I might not be around so I will close this thread and if you need anything else you could always ask on the #dev-help channel

serene abyss
#

will do , thanks again ..
it its possible leave open, that way when i have questions i can ask them were and have my questions in one place

serene aspen
#

they will have to read everything I'm afraid and I should probably transfer the context

#

I guess it's better if you could start over if there's something new