#multi-thread
1 messages · Page 1 of 1 (latest)
How are you creating the Connect account right now? What API call are you making?
This is my full API for that instance. ```js
// Stripe account setup
app.post("/stripe_setup", async function(req, res) {
const StripeID = ValidateSessionIDStripeAccount(req);
if (typeof(StripeID) === "string" || StripeID === false) {
res.send({Success: false});
return;
}
const account = await stripe.accounts.create({
type: 'custom',
email: req.body.Email,
tos_acceptance: {
date: Math.floor(Date.now() / 1000),
ip: req.connection.remoteAddress,
},
capabilities: {
card_payments: {requested: true},
transfers: {requested: true},
},
});
await db.query("INSERT INTO stripe (StripeAccount, AID) VALUES (?, ?)", [account.id, Users[req.body.ServerID].DID], (Error, _) => {
if (Error) {
return
};
Users[req.body.ServerID].StripeID = account.id;
});
const accountLink = await stripe.accountLinks.create({
account: account.id,
refresh_url: process.env.ENDPOINT + '/profile?category=seller',
return_url: process.env.ENDPOINT + '/profile?category=seller',
type: 'account_onboarding',
collect: "eventually_due"
});
res.send({Success: true, Link: accountLink.url});
});```
And as, my sellers could be located anywhere in the world, I am not sure what the best approach is.
Oh, see now that I might need to put in country argument. But can this somehow be automated?
Can you try adding country in your api call?
Yes will do that, but is there any good way to automate it?
Or does the API/docs provide any good list of what all the country codes are?