#zeke_best-practices

1 messages Β· Page 1 of 1 (latest)

uneven heraldBOT
#

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

autumn cobaltBOT
#

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.

rustic eagle
#

Hi πŸ‘‹ what are you hoping to have checked? Did you run your code in testmode to ensure it behaves the way you're expecting?

dusky quest
#

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

rustic eagle
#

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?

uneven heraldBOT
dusky quest
#

yes give me one second

dusky quest
#

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?

heavy pond
#

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

dusky quest
#

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
        },
      },
    });
heavy pond
#

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)

dusky quest
#

Mmmm I see

heavy pond
#

application_fee_amount is what platform sets for their fees

transfer_data.destination is where platform sets the account ID of the connected account

dusky quest
#

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?

heavy pond
#

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

dusky quest
#

Would you say for a marketplace in your own opioin I am doing the right things right now?

#

Like direct and all of that

#

or any suggestions!