#jainnikesh_code
1 messages ¡ Page 1 of 1 (latest)
đ Welcome to your new thread!
â˛ď¸ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
âąď¸ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
đ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1217036835167932418
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
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.
- jainnikesh_code, 23 hours ago, 43 messages
Current Flow:
- Our system is the service provider between the clinic and patient here the clinic is our client and clinic is accepting the payment from the patient. so we are using stripe as the payment gateway where the clinic can accept the money from their patient. i.e. Clinic is the connected account and We have the Main stripe account where all the connected account exists.
- And all the connected account is created from our portal and also the payment is accepted through our portal by the clinics and also the clinics can refund if the patient requested for the refunds.
- So for the payment we are using the destination charge in which the payment gets credited into our main account and we transfer them to the connected account using the Payment Intent API (https://docs.stripe.com/api/payment_intents/create).
- And as per the payout setting i.e. daily, weekly or monthly they would get the payout to thier bank account.
Problem Statement: So here what problem we are facing is some clinic refund the amount after they get the payout to thier bank account so in this case main account fund gets reserved and connected account doesn't have the balance amount.
Do you have a question?
Trying to Implementation flow to avoid the above problem
- At the time of refund process we try to pull the amount from the connected account using stripe.transfers.create method (https://docs.stripe.com/connect/account-debits-stripe-managed-risk). Once we get the success from this api we process to refund the amount. But in this case connected account debiting the balance 2 times
- 1st is for the pull the amount
- 2nd is when the amount get refunded actually.
Can you please suggest what concept we should take to avoid the main account fund reserve or if get reserve but how can we pull the amount from the connected account and when we should pull that amount i.e. at the time of refund or at any other place we need to pull it. So can you please help with what approach we should take to avoid our problem.
yes
Please use the form fields to provide your question in future, thanks
Can you share an example of the API requests you're making?
Code Snippet:
stripe.transfers.create({
amount: amountToRefund,
currency: reqData.currency || 'usd',
destination: account.id
}, {
stripeAccount: accountId
}).then(async (transfer) => {
refundInitialization(reqData.refunds || [], accountId, []).then(async (result) => {
resolve(result);
}).catch(err => {
reject(err);
});
})
What abotut the refund?
To be clear, what you describe is expected with destination charges. The platform is ultimately responsible for the refunds, disputes, etc
But depending on how you're creating the refund, you may be debiting accounts multiple times
If you can share an actual example of where this has happened, I can see what's going wrong
yes
As per the current flow we are using the destination charge for the payment and when we refund we do reverse transfer so due to this when the connected account doesnot have the balance then it pull the amount from the main account at the time of the payouts.
So, to avoid the main account pull we are trying to pull the amount from the connected account using (https://docs.stripe.com/connect/account-debits-stripe-managed-risk). but we are facing the issue that the connected account is debitting the account 2 time i.e. while refunding as well as transferring the amount to the main account
Code Snippet:
stripe.transfers.create({
amount: amountToRefund,
currency: reqData.currency || 'usd',
destination: account.id
}, {
stripeAccount: accountId
}).then(async (transfer) => {
refundInitialization(reqData.refunds || [], accountId, []).then(async (result) => {
resolve(result);
}).catch(err => {
reject(err);
});
})
You didn't answer this