#gummigun_best-practices

1 messages ยท Page 1 of 1 (latest)

umbral auroraBOT
#

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

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

thin latch
#

๐Ÿ‘‹ happy to help

gilded idol
#

Everything points us to Direct charges being the most appropriate for us. That leads to my follow questions:

1a. Do we need to create the products under the connected accounts profile?
1b. Can that be done when a product is created via the API/SDKs?
Is it best practice to attach a customer to the create checkout session object when creating them via the API/SDKs?

We have been experimenting with following this recipe in test mode and ran into errors indicating that if we are doing Direct charges, then the products and customers need to live under the connected account, not under the platform account.

Mostly want to see if that is true?

// See your keys here: https://dashboard.stripe.com/apikeys
const stripe = require('stripe')('sk_test_51MlV9TLVPbCZCAKX8aQiG4dI8PIBwq3ihAIBLDZnhgaQN6mOBNACgVTwXEUh89SNknl7zkyfLrElcbTaTT41k3sv00BY9kNsIM');

const session = await stripe.checkout.sessions.create(
  {
    line_items: [
      {
        price_data: {
          currency: 'usd',
          product_data: {
            name: 'T-shirt',
          },
          unit_amount: 1000,
        },
        quantity: 1,
      },
    ],
    payment_intent_data: {
      application_fee_amount: 123,
    },
    mode: 'payment',
    success_url: 'https://example.com/success?session_id={CHECKOUT_SESSION_ID}',
  },
  {
    stripeAccount: '{{CONNECTED_ACCOUNT_ID}}',
  }
);
gilded idol
#

I'm not seeing the answers to my follow questions on that page. Am I missing something?

Sepcifically what I need clarity on is where products should live.
1a. Do we need to create the products under the connected accounts profile?
1b. Can we (the platform) create products for connected accounts via API/SDKs? (Didn't see that in the docs)

thin latch
#

you can't use Direct Charges

#

1a. Do we need to create the products under the connected accounts profile?
no since you're going to use either Destination Charges or Separate Charges and Transfers meaning that the prices/products should be on your platform account

#

Can we (the platform) create products for connected accounts via API/SDKs? (Didn't see that in the docs)
this is possible but not for your use-case

gilded idol
#

Just to clarify, we can't use direct charges because we want to be able to create the products programmatically for our connected accounts? They would have to create their own products within the Dashboard or with their own API keys?

thin latch
#

no because you can't do cross-border payouts with Direct Charges or Destination Charges with on_behalf_of

umbral auroraBOT
gilded idol
#

I think i've got it.

So if we do destination charges, then the products and customers can live under the platform and we specify the connected acount is via

    application_fee_amount: 123,
    transfer_data: {
      destination: '{{CONNECTED_ACCOUNT_ID}}',
    },
  },

when we create the checkout session?

Doing it this way... then cross-border payouts are supported as specified in: https://docs.stripe.com/connect/cross-border-payouts#fund-flow-restrictions

vapid igloo
#

Hey! Taking over for my colleague. Let me catch up.