#lucas-k_api

1 messages ยท Page 1 of 1 (latest)

harsh craterBOT
#

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

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

wide kernel
#

hi there!

#

so you are first creating the payment, then later creating the Transfer?

spare basin
#

hiya!
(full disclosure, I'm the product guy not the dev - although I was a dev in a past life)

I remember early on in pre-dev discussions we landed on having to use separate charges/transfers, but I don't recall exactly why. possibly due to needing to line item two separate fees rather than one? and/or cross-border payouts.

you're saying if we use destination charges any race condition between transfers and our own daily payouts would be avoided?

#

I think we could concede the need to line item separate fees, but the platform account is US based and most of the Connected accounts are outside the US - my understanding is that destination charges aren't feasible for that?

wide kernel
#

the advantage of Destination Charges is that you don't have to think about the Transfer at all, Stripe will do it automatically for you.

#

but if you want to handle Transfer yourself, then it's also possible. You just need to set source_transaction. Then the transfer request returns success regardless of your available balance. However, the funds won't become available in the destination account until the funds from the associated charge are available to transfer from the platform account.

harsh craterBOT
spare basin
#

okay good to know. I think we're setting that in our current approach (3rd in my original note) but I'll double check with the devs.

#

yes, looks like we're using source_transaction

    const amountInCents = Math.round(amount * 100);
    const transfer = await stripe.transfers.create(
        { amount: amountInCents, currency: 'usd', destination, source_transaction: chargeId, metadata },
        { idempotencyKey: `pro-transfer-${chargeId}-${amountInCents}` }
    );
    return transfer;
};```

so the transfer should become available as soon as the charge funds become available and only the difference would be included in our daily payouts?
narrow lintel
#

Hello ๐Ÿ™‚ I took over for soma who had to step away, please give me a moment to catch up.

spare basin
#

no worries at all, ty!

narrow lintel
#

Just caught up and yes, that's correct. Once you link the transfer to the charge with source_transaction the transfer waits until the funds from the charge are available in the platform account so you wont have a negative balance.

spare basin
#

okay good to know, thank you both for your time!

I wasn't aware of this discord until today but I suspect either myself of one of the devs may be reaching out again in the future