#Sarvesh

1 messages ยท Page 1 of 1 (latest)

barren iglooBOT
old hare
#

๐Ÿ‘‹ happy to help

#

please use this thread for our subsequent messages

#

Hi
I am calling the refund api for connected account

$refund = $stripe->refunds->create([
'charge' => $chargeId,
"metadata" => $metaData,
]);

#

@stoic karma please remove your messages from the main channel and let's keep our subsequent messages here

stoic karma
#

I am calling the refund api for connected account

$refund = $stripe->refunds->create([
'charge' => $chargeId,
"metadata" => $metaData,
]);
getting exception as
No such charge: 'ch_3M9NnZPGjJdpmYtd04SSikVt'

#

tried with payment_intent Id but same error

old hare
stoic karma
#

request":{
"id":"req_rZQffg78U9LcWk",

old hare
#

the request id where you got No such charge

stoic karma
#

this payment object is saved in my database

#

from the payment request object, i am taking charge object id and sending to refund request

old hare
#

the request ID I'm looking for is the one from the refund request

stoic karma
#

pm_1M9NoCPGjJdpmYtdoORRub5E

#

this is same payment intent i want to send refund request

#

above request id is belong this payment intent

old hare
stoic karma
#

yes, checked just now it shows same error in your logs
resource_missing - id
No such charge: 'ch_3M9NnZPGjJdpmYtd04SSikVt'

#

what I need to change here?

#

while doing the request

old hare
#

I need the request ID to look into it

#

you need to find the req_xxx related to the refund you're creating

stoic karma
old hare
#

acct_xxx

stoic karma
#

acct_1LcWQoALTlZ8nxc3

#

acct_1M7uEWPGjJdpmYtd

old hare
#

which one are you doing the refund from?

stoic karma
#

main account id: acct_1LcWQoALTlZ8nxc3
connected account id: acct_1M7uEWPGjJdpmYtd

#

I am trying to do refund from connected account id

#

acct_1M7uEWPGjJdpmYtd

old hare
#

then you need to pass the Stripe-Account header as well

#

for the refund

stoic karma
#

how? link?

old hare
#

$refund = $stripe->refunds->create([
'charge' => $chargeId,
"metadata" => $metaData,
]
['stripe_account' => 'acct_xxx']);

stoic karma
#

ok, will try again

#

ok, succeed

old hare
#

let me know if you need any more help

stoic karma
#

Application fees:$1.18
Stripe processing fees:$0.52

#

will it send webhook response on request success?

old hare
#

yes

stoic karma
#

appliction fee and stripe will not get refunded right?

old hare
#

yes

#

you can refund the application fee though

stoic karma
#

no, we do not want to refund app and stripe fee,
will it send webhook response on request success? which webook need to subscribe?

#

I already subscribed account.updated and payment.intent

old hare
stoic karma
#

ok, thank you, I will recheck with another payment request

old hare
#

let me know if you need any more help

stoic karma
#

yes

stoic karma
#

pi_3M9RjBPGjJdpmYtd1Zf3MA1u
showing status as "Refunded" in stripe and in webhook response I can complete amount in refund object ($5.54) which looks me wrong. from amount application fee $1.12 + Stripe fee $0.46 should not be refunded so $3.96 will be correct refund amount to user right?

stark slate
stoic karma
#

ok, if i do not pass the amount but I do not want the application fee to be refund because it is not refundable. so how to handle it?

#

$5.54 - ($1.12 app fee) - $0.46 stripe fee = $3.96 only needs to refund from stripe. any params for this to not to refund?

stark slate
#

Then you'd pass amount: 396 when creating the refund

stoic karma
#

hm, I only need to deduct the our application fee and not stripe fee right if I want to pass the amount? Stripe fee is not refundable ?

stark slate
#

Correct, the Stripe fees aren't refunded