#abricot_code
1 messages · Page 1 of 1 (latest)
👋 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/1415663279954591897
📝 Have more to share? Add more details, code, screenshots, videos, etc. below.
I provide a link to my users to create a connected account and to do the onboarding, on the next JS side, I've got an error asking me to request an account token on the client side, so I need to do the same on mobile side
yes but I need an Account token; and this type is not allowed, only Card or PII
I don't think this API call can be made from the frontend. This request should be done on the backend: https://docs.stripe.com/api/tokens/create_account
Ok, but in that case, why on next js I had a error message in production saying the account token should be requested on the client side ? is it only for browser ?
can you copy-past the full error message?
I don't have it anymore it was long time ago, but I needed to update the way I requested an account token to use stripe js sdk on the client side
if you don't have that error, then I can't really help with that specific error.
I thought at stripe you were aware of the way account and account token was working for client side
👋 taking over for my colleague. Let me know if there's any follow-up Qs I can answer!
yeah I try to understand how to create a connected account, it seems to be different between browser and mobile. On the browser I needed to create the account token on the client side using stripe sdk. On mobile there is no method to create account token, so it seems I need to create the account token on the backend
but now I did it, on the backend, but :
message: "You can only provide individual parameters for accounts with business_type of 'individual'.",
Here is what I send for the token :
async createAccountToken(email: string) {
const accountToken = await this.stripe.tokens.create({
account: {
individual: {
email: email,
},
tos_shown_and_accepted: true,
},
});
return accountToken;
}
and here it the createAccount :
const account = await this.stripe.accounts.create({
type: 'custom',
country,
email,
capabilities: {
card_payments: { requested: true },
transfers: { requested: true },
},
business_profile: {
product_description: 'Location de vêtements',
mcc: '7399',
url: 'https://rent-extended.com',
},
account_token: accountToken,
});
if you're planning on using mobile for collecting account information you might be better off with using embedded components https://docs.stripe.com/connect/get-started-connect-embedded-components
Right now I only want to create an onboarding link for my customers and redirect them to this URL
in a webview you mean?
or in safari for example, since expo provide a OpenLink method
in that case you need to use account links https://docs.stripe.com/connect/api-onboarding#proof-of-liveness