#Hamza-Reverse-Transfer
1 messages ยท Page 1 of 1 (latest)
Hi! Can you share the request ID (req_xxx)? Here's how you can find it: https://support.stripe.com/questions/finding-the-id-for-an-api-request
Find help and support for Stripe. Our support center provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
req_ljlPFi4oX2QTlX
Thanks for the ID, you've specified an amount when creating this refund, that's why it's a partial refund
i want a partial refund with any transfer which was created "reversed completely" but right now it is only reversing partial amount
i don't have issue with refund amount rather the transfer reversal amount which should be reversed completely.
Here's my code:
$response = $stripe->refunds->create([
'payment_intent' => $invoice2[0]->auth_code,
'amount' => $invoice[0]->total * 100,
'reverse_transfer' => true
]);
What do you mean by reversed completely ?
the amount which was transferred to the connected account should be reversed completely.
Let's say you made a charge of 100. Now you are going to refund 50, and you expect a reversed transfer of 100?
No, A charge of 100 was created with let's say 50 was transferred to the connected account using transfer_data->destination. Now i want to refund the customer 60 and i expect the 50 which was transferred to the connected account back completely.
So you are doing a separate charge and transfer, am I right?
No, Transfer is being created with the checkout session.
OK, so you are using destination charge, and collecting a fee via transfer_data[amount]. If you want to do a full refund+reversed transfer, you should just set reverse_transfer to true and don't specify an amount when creating a refund
If the refund results in the entire charge being refunded, the entire transfer is reversed. Otherwise, a proportional amount of the transfer is reversed.
but i don't want to refund the full amount
is there a way to refund partial amount but reverse_transfer the full amount
No, there's no way.
so i'll have to make 2 requests.
- create a manual transfer reversal.
- refund the amount from the parent account
But you still need a transfer object in order to create a transfer reversal.
Hmm, it might work. You can try to the transfer object created from the destination charge to create a reverse transfer.
i can get the transfer id from charge id which i can get from payment Intent (which i am saving in my database) then create a transfer reversal using the transfer id.
its a bit long process but it will work
I was hoping there would be a much simpler process but i don't think it's possible by any other way
This is a unique flow and I haven't tried it myself. So I'll suggest you to try it out in test mode and see if the resulting behaviour is what you want.
I've managed to make it work. thank you for your help ๐
Great! I hope I can help more, you figure out most of it by yourself ๐