#food-connect-refund
1 messages · Page 1 of 1 (latest)
Hello! We'll be with you shortly. Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- foodbyhome, 11 hours ago, 48 messages
@hardy pebble not sure I understand what that means exactly. Can you try and give a concrete example like a $100 where connected account A gets $20 and B gets $70, etc. and tell who pays what back?
customer pays 100$ and 30$ goes to driver connect account and 70$ goes to Restaurant connect account.
but when a customer is not happy about the food Restaurant has a option to refund x amount of money to the customer. but the money should be taken from Restaurant connect account.
Perfect, thanks for clarifying. So you use "Separate Charges and Transfers" right?
food-connect-refund
i don't know, you tell me, just want to refund money to the customer let say 40$ from restaurant account
i don't know, you tell me
you're the developer here, you wrote the integration/code/etc. I can't tell you what you did. Once you tell me what you did I can guide you though!
i have this so far: refund = stripe.Refund.create(
amount=amount,
charge="ch_3Ok7KiFmAcnSnAaB0lP5zsaX",
)
sorry you nee to take a step back and explain how you accpt funds in general, how charge creation happens, etc.
okay when customer want to pay i make a : paymentIntent = stripe.PaymentIntent.create(
amount=int(request.amount.totalCent),
currency=request.currency,
customer=customer_id,
)
When customer pay successfully, and the food will be delivered after 30 min, when driver set the status to delivered and when i transfer the money to restaurant and driver like this: # Create the Restaurant transfer
stripe.Transfer.create(
amount=int(transfer_amount_cents),
currency="DKK",
destination=_restaurant.resturantStripeId,
source_transaction=payment_intent.latest_charge,
)
# Create the driver transfer
stripe.Transfer.create(
amount=delivery_price_cents,
currency="DKK",
destination=_driver.resturantStripeId,
source_transaction=payment_intent.latest_charge,
)
okay so you do use the Separate Charges and Transfers flow, the one documented here: https://stripe.com/docs/connect/charges-transfers
yes
And so right now you only sent $70 to that restaurant so you can not pull back $100, that's not possible
yeah but i want to refund 70$ or less
What you need to do is something like this
- Refund the Customer (from your balance)
- Separately reverse the first Transfer (the one to the restaurant) for its full amount ($70)
- Use https://stripe.com/docs/connect/account-debits to pull the rest
ah so you only refund the restaurant, not the full $100?
correct
ah then sure it works
- Refund (pulls from your balance)
- Reverse the Transfer to the restaurant separately to pull the money back from them
can i do:
1: Transfer the money from restaurant to me
2: make the Refund
Hi @hardy pebble I'm taking over this thread
Give me a sec to go through the coversation history
ok
Sure, you can do a reverse transfer to pull the funds from the connected account, and refund the customer,
https://docs.stripe.com/api/transfer_reversals/create I think you want to use the transfer reversal API
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
but i don't have the transfer id, i only have what i get from payment_intent, latest_charge
It's the the ID of transfer that you created earlier to move the funds from your account to the connected account
yeah, so i need to save it somewhere?
Yes you are right
okay thanks for the help, i will right you again if its not working 😆