const accountResult = await stripe.tokens.create({
account: {
business_type: 'company',
company: {
name: 'Allexano',
tax_id: '000000000',
address: {
line1: '22 Avenue Millies Lacroix',
city: 'ÉCHIROLLES',
state: 'Rhône-Alpes',
postal_code: '38130'
}
},
tos_shown_and_accepted: true
}
});
const account = await stripe.accounts.create({
country: 'FR',
type: 'custom',
external_account: {
account_number: 'FR1420041010050500013M02606',
object: 'bank_account',
country: 'FR',
currency: 'EUR'
},
account_token: `${accountResult.id}`
});
const owner = await stripe.tokens.create({
person: {
first_name: 'Gaetand',
last_name: 'Lavoied',
ssn_last_4: '1234',
address: {
line1: '64 rue Léon Dierx',
city: 'LISIEUX',
state: 'Basse-Normandie',
postal_code: '14100'
},
dob: {
day: 5,
month: 8,
year: 1974
},
relationship: {
account_opener: true,
owner: true,
percent_ownership: 100
}
}
});
const personOwner = await stripe.accounts.createPerson(`${account.id}`, {
person_token: `${owner.id}`
});
const director = await stripe.tokens.create({
person: {
first_name: 'Bruce',
last_name: 'Vertefeuille',
ssn_last_4: '1235',
address: {
line1: '46 rue Goya',
city: 'LE MANS',
state: 'Pays de la Loire',
postal_code: '72000'
},
dob: {
day: 7,
month: 6,
year: 1986
},
relationship: { director: true }
}
});
const personDirecteur = await stripe.accounts.createPerson(`${account.id}`, {
person_token: `${director.id}`
});