#salmanaliawann_connect-transfers
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/1220419458086998086
đ 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.
- salmanaliawann_unexpected, 4 hours ago, 10 messages
see the code snippet in the attached image file
Hello! Usually I'd expect transfers to send the funds to your connected account - do you have a transfer ID I can take a look at to see what's going on?
salmanaliawann_connect-transfers
Hello..
Unfortunately I don't have the transaction_id currently.. is there anything else that I can provide you?
Do you have a connected account ID?
acct_1OsrfMGfOauuTwHL
As far as I can tell, you haven't made any transfers to that connected account at all
have you seen the code snippet image that I have shared above? If there's something wrong in the logic, then we can work on it.
I took a look and nothing seems wrong initially, but really the best way for you to figure out the issue is to run the code on your end and do some debugging to see at what point it fails /doesn't behave as expected. It's hard to know if code is correct just be looking at it because I have no idea what each of your calls is returning
There is no error in the code. I have asked the client (Platform owner) if he had registered the same account while onboarding that has received the amount he said that the connected account was different but the amount was received in the Platform's connected account and not in the newly onboarded user account.
If the transfer was being made to the wrong account, then that would be a bug in your code, right?
but there is no other stripe connect account ID in the complete database. How can the system send money to another stripe-connected account while it doesn't exist and the Platform owner receives the same amount from the stripe in his Platform business bank account.
I'm guessing what happened is that the Transfer to the connecred account never went through, so the funds stayed in the platform account's stripe balance. The platform likely had automatic payouts enabled, so those funds were then paid out the platform's bank account
So really the core issue here is why is Transfer creation not working
Looking at some logs on the platform that's tied to acct_1OsrfMGfOauuTwHL, I do see some recent failing transfer requests that failed because there was insufficient balalnce
yes it is currently
Yeah you likely want to change your Transfers code to set source_transaction (https://docs.stripe.com/api/transfers/create#create_transfer-source_transaction). We call out in the notes at https://docs.stripe.com/connect/separate-charges-and-transfers#transfer-options that you'll likley want to set source_transaction if you're using automatic payouts
we are not using automatic payouts through the API.. the transaction happens through the system only when requested like the user clicking on the withdraw balance button. But is it possible that automatic payouts are enabled in the stripe dashboard? how can we make sure that the transaction succeeds.
$transfer = $stripe->transfers->create([
'amount' => $stripeWithdrawalAmount,
'currency' => 'usd',
'destination' => $user["stripe_connect_account_id"],
]);
if (!$transfer) {
return redirect()->back()->with("error", "Undefined Error!");
}
If there is an error proceeding the request.. It should return the error like connected account not found or similar but not return the amount to Platform's bank account
automatic payouts aren't something you do through the API - it's a setting that you configure on the dashboard (https://dashboard.stripe.com/settings/payouts). As I said, if you want to be sure the transfer succeed you'll want to use the source_transaction parameter I linked you to earlier
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
I don't understand. How is it connected to our problem here that the amount is being sent to the Platform's bank account even if it has enough balance to make the transaction to the user's connected bank account? Am I missing something?
The amount is being sent to the Platform's bank account because the Transfer to the conneced account wasn't able to succeed (which is because automatic payouts were enabled). If you use the source_transaction param it'll allow the trnasfer to succeed even if automatic payouts are enabled, so the funds will be moved to the connected account before they're paid out automatically on the platform
what if there were 10 different transactions happened to make up the cost of one withdrawal amount like 10 tickets sold and the host gets his profit in the connected account? there seems to be no logic behind this payment flow.. what if he withdraws after an year, till then the system may have automatically paid out to the platform bank account
If you enable manual payouts on the connected accounts you can transfer the funds to the connected account and leave them in the connected accounts stripe balance. When they want to send the funds to their connected bank account then you'd create a manual payout
can you please refer to the documentation of the manual payouts?
If I create new accounts like
$stripe->accounts->create(
'type' => 'custom"
['settings' => ['payouts' => ['schedule' => ['interval' => 'manual']]]]
);
and then pay out them manually like
$stripe->payouts->create(
[
'amount' => 1000,
'currency' => 'usd',
],
['stripe_account' => '{{CONNECTED_ACCOUNT_ID}}']
);
It will send them money from Platform's stripe balance to Users connected bank account without the issue we are currently facing. Is this approach correct?
No - that will send money from the CONNECTED ACCOUNT's stripe balance to the connected accounts' bank account.
If you want to send money from the platform's stripe balance you still need to do the transfer
but as we have encountered so far, the transfer is sending the money to the Platform's bank account instead of user's bank account.. Still, I am not too sure about the flow as things are getting more complicated as we are trying to solve the issue..
can we force the transfer to send money to connected account id or else cancel the transfer instead of sending the amount to Platform's balance and return an error
the transfer is sending the money to the Platform's bank account instead of user's bank account.
No, that's not what's happening at all
Right now you have no Transfer being created, which is what's causing your problems
To be super clear - to get this to work you need to successfully create a Transfer with the source_transaction parameter. Right now that platform has not successfully created a Transfer
I have coded the checks to make sure that the withdrawal amount is lesser than the Platform's balance amount
$usdBalance = array_values(array_filter($stripe->balance->retrieve([])->available, function ($item) {
return $item["currency"] === 'usd';
}));
if (empty($usdBalance) || !isset($usdBalance[0]) || $stripeWithdrawalAmount > $usdBalance[0]->amount) {
return redirect()->back()->with("error", "Please contact admin, unable to make payouts");
}
Alright, I understand your point that the system never requested to make the transfer. Please let me know how to avoid sending the funds to Platform's bank account in any case whatsoever.
I have coded the checks to make sure that the withdrawal amount is lesser than the Platform's balance amount
I already explained what the issue here was - you need to make sure you're setting source_transaction when you create your transfer
If you want to be 100% sure you never automatically send any funds to your platform's bank account you can have them disable it in the dashboard like I already shared earlier
Can you please elaborate on what I declare as a source transaction? We are using multiple payment intents to capture payments that will eventually add up in the final amount that will be paid out.
Understood.
We talk about source_transaction in our API Reference (https://docs.stripe.com/api/transfers/create#create_transfer-source_transaction) and in our docs (https://docs.stripe.com/connect/separate-charges-and-transfers#transfer-availability). It allows you to transfers funds that are not yet available
Alright, I will look into these now and hope that we'll resolve the current issue. I am thankful for your time, patience and support.