#stan_connect-flow

1 messages ¡ Page 1 of 1 (latest)

calm thicketBOT
prisma martenBOT
#

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.

calm thicketBOT
#

👋 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/1240426009115758734

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

zinc palm
#

essentially i want to create a middleman system where i can take in the payments and then seller gives item to buyer, and then the seller can run a command to claim the money but im not sure how to be able to make it so that when the seller runs the command, it properly pays out to them

#

also im not sure what data i should be saving to a database, like ids and stuff

versed river
#

This is all really well documented. What have you tried so far?

zinc palm
#

i have this to store the buyer checkout


app.post('/webhook', bodyParser.raw({ type: 'application/json' }), async (request, response) => {
    const payload = request.body;
    const sig = request.headers['stripe-signature'];
    let stripe = client.stripe

    let event;

    try {
        event = stripe.webhooks.constructEvent(payload, sig, endpointSecret);
    } catch (err) {
        console.log(err.message)
        return response.status(400).send(`Webhook Error: ${err.message}`);
    }

    if (event.type === 'checkout.session.completed') {
        const sessionWithLineItems = await stripe.checkout.sessions.retrieve(
            event.data.object.id,
            {
                expand: ['line_items', 'payment_intent'],
            }
        );
        const lineItems = sessionWithLineItems;
        fulfillOrder(lineItems.payment_intent);
    }

    response.status(200).end();
});```
#

im a little bit confused at the connected accounts idea, what exactly are they? is it an account created buy the "seller" in this case

versed river
zinc palm
#

i was just looking at that

#

does that mean i have to send a link for the seller to create his account?

#

also are connected accounts like the seller or is it connected to your account

versed river
#

Yes, to all 3

zinc palm
#

are connected accounts like the seller or is it connected to your account
? wdym yes

zinc palm
#

or would i have to add an option for seller to input connected id

versed river
#

That depends on how you onboard them. There are a ton of docs covering different methods for doing this. They all branch off from the doc I already sent, so I would recommend getting a bit more familiar with those first.

Hate to give that answer, but these are well-documented and nuanced topics that don't have just 1 answer

zinc palm
prisma martenBOT
versed river
#

Connect accounts are accounts. The differences will be based on the type of Connect Account (express, custom, or standard)

zinc palm
#

ohh i see

frigid frost
#

stan_connect-flow

zinc palm
#

would i have to enable the connected accounts thing on my dashboard?

frigid frost
#

@zinc palm kind of, but integrating Connect is a lot of work. The first step would be to carefully read the docs end to end and pick the right integration path for your business model. Definitely not something you can do with a few Dashboard clicks!

zinc palm
#

hm alright, but that is something i'd have to do right

#

like a way for me to have the onboarding process without designing frontend/ hosting domain etc

frigid frost
#

There's a lot we offer yes. We have a hosted onboarding flow, we have embedded components for it, etc.

zinc palm
#

ah nevermind, found it

#
// 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_51P3KZvJEoFgb8rxd8KFh7yOyLdtQP3TmZBDuxNJt4rhLboDbHoZc4DGWjeA38x2nquwC5UlbLGSEdEBsNHibjc9v00ewPO1Tqp');

const accountLink = await stripe.accountLinks.create({
  account: '{{CONNECTED_ACCOUNT_ID}}',
  refresh_url: 'https://example.com/refresh',
  return_url: 'https://example.com/return',
  type: 'account_onboarding',
  collection_options: {
    fields: 'eventually_due',
  },
});``` why does the option to create an account require an account id?
#

wouldnt u get the id after onboaridng

frigid frost
#

It doesn't, you're going way too fast and not reading the docs honestly. That is an AccountLink, that is what you create to get a URL for onboarding an account you created before.

#

I'm sorry but it is important that you take a few hours and carefully read through those docs first end to end!

zinc palm
#

sorry im a bit confused, is onboarding not the process of creating an account?

frigid frost
#

You create an account first, and then you send the person through our onboarding flow to provide the information we need. So no they are 2 separate operations

zinc palm