#d3levv_code

1 messages ยท Page 1 of 1 (latest)

grand sparrowBOT
#

๐Ÿ‘‹ 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. Thank you for your patience!

โฑ๏ธ We automatically close idle threads, which makes them read-only. Make sure you stick around to chat in realtime! If this thread is closed and you have another question you'll need to start a new thread.

๐Ÿ”— 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/1214896229885153312

๐Ÿ“ Have more to share? You can add more detail below, including code, screenshots, videos, etc.

ashen berry
#
import { stripeInstance } from "@/stripe";
import { NextApiHandler } from "next";

const handler: NextApiHandler = async (req, res) => {
    const { method } = req;
    const stripeId = req.query["stripe-connect"];
    if (method === "GET") {
        try {
            const account = await stripeInstance.accounts.create({
                type: "custom",
                country: "NL",
                business_type: "company",
                capabilities: {
                    card_payments: {
                        requested: true,
                    },
                    transfers: {
                        requested: true,
                    },
                },
            });
            const stripeLink = await stripeInstance.accountLinks.create({
                account: account.id,
                refresh_url: "https://example.com/reauth",
                return_url: "https://example.com/return",
                type: "account_onboarding",
            });
            res.redirect(stripeLink.url);
        } catch (e: any) {
            console.error(e);
            res.status(400).json({ error: e.message });
        }
    } else if (method === "POST") {
        res.status(200).json({ success: "true" });
    } else {
        res.status(200).json({ success: "true" });
    }
};
export default handler;

This is my nextjs api route

bleak flareBOT
vale arrow
#

๐Ÿ‘‹ happy to help

#

when you create an Account Link, you are asking your merchant to use the Stripe Hosted Onboarding flow, meaning you can decide which requirements (https://docs.stripe.com/api/account_links/create#create_account_link-collection_options) you want to collect (currently_due default, eventually_due, or both) but you can't decide what to show. The flow will try to collect all of the missing information from the KYC process

#

but that's the extent of the "customization" you can do

ashen berry
#

So how does the current platform achieves this? Hm

vale arrow
#

I'm not sure I understand the question

#

do you mean how can you update the info of a custom account using the API?

ashen berry
#

this is how it currently operates, when you fill the KVK number you have these options

#

So my question is is this done using accounts.create + accountLinks and if so, what settings should i add to them ?

vale arrow
#

I'm not sure I understand the question honestly

#

would you mind elaborating please?

ashen berry
#

So some user details are collected then accounts.create is triggered with type custom exc.. then account link is created. When redirected the only information that should be collected is the KVK number witch prefills the data like shown in the pictures above

#

I am having hard time trying to get the accountLinks to not include any other fields other thant the kvk field

vale arrow
#

this is because you haven't passed the KYC information to the Stripe API

#

you need to look at the doc I linked above

ashen berry
#

ah i see so when accounts.create i need to provide the required information, then the only field that will show is the kvk. But how to verify that kvk number is correct ?

ripe echo
#

Hi! I'm taking over from my colleague. Please, give me a moment to catch up.

ripe echo