#Giuseppe87-connect

1 messages · Page 1 of 1 (latest)

normal prairie
#

Hi! Are you using Stripe Connect? If so yes it's possible to use it with Checkout Session.
How to do so will depend on the type of charge you want to make. There are three options: direct charges, destination charges, or separate charges and transfers. You can learn more about this here:
https://stripe.com/docs/connect/charges

lunar shale
#

I'll give a look

#

Ok, i think or case could be done via a direct charge with application fee: https://stripe.com/docs/connect/direct-charges#collecting-fees

I mean, the site is a e-commerce where the users can sell products, there is a separate cart for each "seller" and the site owner must collect a fee for each sale.

However, the documentation is for

// Set your secret key. Remember to switch to your live secret key in production.
// See your keys here: https://dashboard.stripe.com/apikeys
const stripe = require('stripe')('sk_test_51HQ8W5HcbWQYCqq4erMdTYHIBmXtmmtDjmHOh76YmbcI6gA19DrgOHIREtiw8J2YkgoMaGz5wby7SD0XT0wX9Dlm00hGCFzP3A');

const paymentIntent = await stripe.paymentIntents.create({
  amount: 1000,
  currency: 'eur',
  application_fee_amount: 123,
}, {
  stripeAccount: '{{CONNECTED_STRIPE_ACCOUNT_ID}}',

});

for paymentIntents.

Does an example for checkout sessions exist? 🙂

glass holly
#

the deep link might not work but basically just pick the Connect and Direct Charges tabs

lunar shale
#

Thank you, I'm reading it and it seems it explains it. I'll study more thoroughly, however a thing is not yet clear to me, the CONNECTED_STRIPE_ACCOUNT_ID

#

is that the stripe ID? Something else?

#

and the "connected seller", must do something, or is enough to specify the id in the code, without other operations done by the users\in the dashboard?

glass holly
#

it's the ID of a Stripe account that you created on behalf of the person who is going to receive money(the "seller" in your case) or that gave you access to their existing Stripe account

glass holly
lunar shale
#

Thank you, I've read it (not yet studied xd).

From my initial understanding the flow to use stripe connect is this:

  1. When a user register on the site, a "stripe connected account" must created according the example here https://stripe.com/docs/connect/enable-payment-acceptance-guide?platform=web#create-standard-account
  2. The user must be redirect to the url provided by const accountLink = await stripe.accountLinks.create.. where he will sign up, give the authorization to connect to the "site stripe app" and fill all the necessary data
  3. Those users will be "connected" on the "site stripe app" and will have each one a dashboard for the "site stripe app"
  4. When a order is placed, use the connected_stripe_account_id and the application_fee_amount to split the payment between the user and the site owner, e.g
const session = await stripe.checkout.sessions.create({
  line_items: [{
    price: '{{PRICE_ID}}',
    quantity: 1,
  }],
  mode: 'payment',
  success_url: 'https://example.com/success',
  cancel_url: 'https://example.com/cancel',
  payment_intent_data: {
    application_fee_amount: 123,
  },
}, {
  stripeAccount: '{{CONNECTED_ACCOUNT_ID}}',
});
#

Is that correct? Thank you

glass holly
#

yes all sounds correct