#muhammad-hamza-siddiqui_transfer
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/1333445002335879229
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
hi there!
hey
you forgot to set source_transaction: https://docs.stripe.com/api/transfers/#create_transfer-source_transaction
nopes i have set it check this
async transferToConnectedAccount(
amount: string,
connectedAccountID: string,
adId: number,
chargeId: string,
): Promise<Stripe.Response<Stripe.Transfer>> {
const amountInCents = Number(amount) * 100;
const amountToTransfer = amountInCents * 0.75; //75% cut
const amountAfterComission = amountToTransfer - amountToTransfer * 0.035; //taking 0.03% fee
const roundOffAmount = Math.ceil(amountAfterComission);
const transfer = await this.stripe.transfers.create({
amount: roundOffAmount,
currency: 'aed',
destination: connectedAccountID,
metadata: {
ad_id: adId,
mover_keeps: roundOffAmount,
},
source_transaction: chargeId,
transfer_group: String(adId),
});
return transfer;
}
can you share the failed request ID (req_xxx)?
by request id
you can find it here https://dashboard.stripe.com/test/logs
{
"amount": "9409",
"currency": "aed",
"destination": "acct_1QZqF9E2ZqWD320Z",
"metadata": {
"ad_id": "211",
"mover_keeps": "9409"
},
"transfer_group": "211"
}
and error:
You have insufficient available funds in your Stripe account. Try adding funds directly to your available balance by creating Charges using the 4000000000000077 test card. See: https://stripe.com/docs/testing#available-balance
in the full error message, there is a request ID (req_xxx)
or you can find it in your Dashboard in the link I shared above
req_F40KOkFGlARRRh
well, you didn't set source_transaction in that request: https://dashboard.stripe.com/test/logs/req_F40KOkFGlARRRh
means source transaction is not being set?
if you click on the link above, you'll see that there's no source_transaction set
okay let me check my code even though it is being set
maybe you are looking at the wrong code, or an old version of your code is cached, or you didn't set the parameter properly. not sure.
What's the value of the chargeId when you set it? Could you print it please?
nopes i am looking on the correct one let me recheck
Hi there ๐ jumping in as my teammates need to step away soon. Let's take a step back. Can you tell me a bit more about what you're trying to accomplish in this flow? Are you trying to create a Transfer to move funds from your Platform's available balance to a Connected Account? Or are you trying to create a Transfer that is tied to an in-progress payment, such that the Transfer happens automatically when the payment completes?
muhammad-hamza-siddiqui_transfer
transfer to move funds
i am using stripe standard connect
like first the payment intent api is called when a certain action happens and secondy after sometime when its delivery is made then transfer api is being called with source transaction
Currently your account doesn't have an available balance in the currency that you're trying to make the Transfer for, which is why the request is failing.
You can check your account's balance before trying to create a Transfer to ensure you have enough funds to cover the transfer's amount:
https://docs.stripe.com/api/balance/balance_retrieve
but what is the link with enough funds?
In testmode, funds still go to your pending balance first, the same way they do in livemode, before moving to the available part of your balance for Transfers and Payouts.
when transferred amount is deducted from the charge id
that is being created from payment intent
Oh, so you do want to tie the Transfer to a payment being processed liked I asked earlier?
yess yess
Then you will want to use the source_transaction parameter that my teammates were suggesting earlier. We talk about it a bit more here in our guide for building a Separate Charges & Transfers flow for your Connect integration:
https://docs.stripe.com/connect/separate-charges-and-transfers?platform=react-native#transfer-availability
I'll be here. I checked the log for the request that you shared earlier and did not see the source_transaction parameter included in the payload that we received.