#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/1216661575105118239
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
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);
});
}).catch(err => {
reject({ type: 'REFUND_ERROR_LACK_OF_BALANCE', message: 'This refund cannot be processed because there are not enough funds available in your Adit Pay account. Please try again later once your available balance is greater than the refund amount.' });
});;
hello
Hi looking
Hmm
The code snippet above, is it creating a Transfer and errored?
How is it related to debitting account and refund?
so we are using flo fo refund
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
{ amount: '100', charge: 'ch_3Os3cPBTDnqJlDMT0wee6ipz', reverse_transfer: true, refund_application_fee: false }
Yeah this has reverse_transfer = true, so it will also pull back the fund which was originally transfer from the Platform to the Connected Account
You don't need to debit the CA in addition to this
then what we have to do to hanle this issue
Which issue? The error message above? That's a different thing related to the Balance of the Platform
no
Is that a Transfer from Platform to Connected Account?
Ah I see that's the debit from Connected Account to Platform
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.
understand this
now we need that money bck from our conneted account to our main account
so is there any way to handle this
Um but after the destination charge, you connected account has the fund, right? When you reverse transfer you should have back the portion of the fund
they was sent to it
there is chance that after refund connected account not have enough balance then our main acount have loss
if we not allow to refund more then amount that connected account have then client can not refund even if they have balance in bank account
so client is asking take money from bank account and allow refund to us
so we decided that even there is not enough money in connected account we will allow to refund from main account and same time we will get money from bank account
Hmm okie I see (?) How do you do that? By not enabling reverse_transfer?
no
using
so at same time we are debting bank account of connected account
That's not possible if the Connected Account balance is not enough
The API is built on an assumption that the Connected Account has enough funds
So yes the error is expected
wait we are not getting catch here
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
do you have a clear example of that happening?
the code you posted just transfers from the connected account to the platform. The only way it would debit the account twice is if you ran that code twice, or if you are also calling some other API like the Refunds API or a TransferReversal.