#muhammad-hamza-siddiqui_transfer

1 messages ยท Page 1 of 1 (latest)

tranquil violetBOT
#

๐Ÿ‘‹ 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.

rough crag
#

hi there!

silent oasis
#

hey

rough crag
silent oasis
#

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;
  }
rough crag
#

can you share the failed request ID (req_xxx)?

silent oasis
#

by request id

rough crag
silent oasis
#

{
"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

Use test cards to validate your Stripe integration without moving real money. Test a variety of international scenarios, including successful and declined payments, card errors, disputes, and bank authentication. You can also test non-card payment methods and redirects.

rough crag
#

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

silent oasis
#

req_F40KOkFGlARRRh

rough crag
silent oasis
#

means source transaction is not being set?

rough crag
#

if you click on the link above, you'll see that there's no source_transaction set

silent oasis
#

okay let me check my code even though it is being set

rough crag
#

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.

ashen vapor
#

What's the value of the chargeId when you set it? Could you print it please?

silent oasis
#

yes

#

sure

#

ch_3QltEbCfBzLdBwO51evvDsfc

silent oasis
frail drift
#

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?

tranquil violetBOT
#

muhammad-hamza-siddiqui_transfer

silent oasis
#

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

frail drift
#

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

silent oasis
#

but what is the link with enough funds?

frail drift
#

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.

silent oasis
#

when transferred amount is deducted from the charge id

#

that is being created from payment intent

frail drift
#

Oh, so you do want to tie the Transfer to a payment being processed liked I asked earlier?

silent oasis
#

yess yess

frail drift
silent oasis
#

i am using it but still let me test once again

#

please do not close the thread yet

frail drift
#

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.