#Didier-refund
1 messages · Page 1 of 1 (latest)
thanks
Is this direct charges or destination charges?
I think destination charges, I'll share you the code
$paymentIntent = \Stripe\PaymentIntent::create([
'amount' => $amount,
'currency' => $currency,
'metadata' => [
'cust_id' => $cust_id,
'order_id' => $order_id
],
'application_fee_amount' => $commission,
'transfer_data' => [
'destination' => $vendeur_stripe_account_id
]
]);
and for the refund
$refund = $stripe->refunds->create([
'payment_intent' => $commande->commandes_paymentintent_id,
'refund_application_fee' => false,
'reverse_transfer' => true
]);
Perfect, thank you
Hey apologies this took a bit. Still nailing down the exact details of this but closer to an answer
Essentially this can't be done in one action, you will want to do a partial refund and then transfer the application fee back to the connected account seperately
Working out the exact details still...
ok thank you, i'll wait for your complete answer and details for a way to do that
@gloomy nimbus taking over
@faint girder sorry
If you charge a customer 110€ and want to only refund 100€ then you have to control this by passing the right amount on Refund creation really
you mean I just have to create the refund with the paymentintent ID and the good amount ? what about the other parameters ?
what about them? What's confusing you?
do I keep the reverse_transfer to true and refund_application_fee to false ?
I'll try this and let you know the result
yep you keep both that way and you will pull 100€ back from the connected account
if you refund more than you gave them, say 105€ then they will go negative by 5€
@surreal thistle thank you it seems to work well ! i'm looking for some details in the dashbord to be sure