#zeke_best-practices
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/1268667402569252894
π 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.
- zeke_error, 14 hours ago, 30 messages
- zeke_code, 1 day ago, 18 messages
- zeke_best-practices, 1 day ago, 6 messages
- zeke_code, 2 days ago, 16 messages
- zeke_code, 2 days ago, 18 messages
- zeke_error, 2 days ago, 10 messages
and 1 more
Hi π what are you hoping to have checked? Did you run your code in testmode to ensure it behaves the way you're expecting?
Yes!
so I am a little concerned that my destination is going to the wrong connected account.
transfer_data: {
destination: account.id, // Connected account ID
},
const account = await stripe.accounts.create({
type: 'standard',
});
I took this code from my connect account and put it here
We typically don't really do end-to-end code reviews, since we typically don't know your business requirements so we aren't familiar with what is "right" for you. That's why we typically encourage using testmode to test the flow you've built and confirm it works as you're expecting.
What are you seeing that is leading you to believe the Transfer is being made to the wrong account. Do you have IDs of examples from your testing that you can share?
yes give me one second
excuse me what do I set as the destination charge Me or my user who is a seller?
payment_intent_data: {
application_fee_amount: totalApplicationFeeAmount, // Application fee amount in cents
transfer_data: {
destination: account.id, // Connected account ID
},
},
Just confused if the application_fee_amount is connected with the transfer data because if So I need to put my application down as the id? correct?
The comment in your code has the right answer π
We have the step by step guide here for destination charges: https://docs.stripe.com/connect/destination-charges
With destination charges, payment settles on the platform.. transfer_data parameter allows you to set the destination where you want to send the funds from the payments and application_fee_amount allows you to deduct any fees your platform wants to levy
I'd recommend reading through the doc I linked above, especially the flow of funds piece: https://docs.stripe.com/connect/destination-charges?platform=web&ui=stripe-hosted#collect-fees
But to answer your question, destination there would be the connected account ID
Ok I just felt like it was wrong... When I go to transactions and then collected fees it pops up for me and I see the fee. I just wanted to make sure that I was not sending an application fee to a userπ
because this is what it looks like
const account = await stripe.accounts.create({
type: 'standard',
});
const stripeSession = await stripe.checkout.sessions.create({
success_url: `${process.env.NEXT_PUBLIC_SERVER_URL}/thank-you?orderId=${order.id}`,
cancel_url: `${process.env.NEXT_PUBLIC_SERVER_URL}/cart`,
payment_method_types: ["card"],
mode: "payment",
metadata: {
userId: user.id,
orderId: order.id,
},
line_items: line_items,
payment_intent_data: {
application_fee_amount: totalApplicationFeeAmount, // Application fee amount in cents
transfer_data: {
destination: account.id, // Connected account ID
},
},
});
All good! Let's say I take an uber ride for $20:
Uber as platform would receive the $20 when the ride is complete. Then the platform would deduct any fees they want and transfer rest of the amount to the driver (connected account)
Mmmm I see
application_fee_amount is what platform sets for their fees
transfer_data.destination is where platform sets the account ID of the connected account
So in my situation I am using connect for Onboarding and for creating a account Id for the session? Is that why I am seeing the fees pop up in "connect accounts" on stripe dashboard?
I'm not sure what you mean by that. My team isn't really familiar with the dashboard.. But the fees in connected account's payment details would be the application fee charged by the platform
This guide has an end-to-end example for how you integrate destination charges: https://docs.stripe.com/connect/collect-then-transfer-guide