#beardman-account
1 messages · Page 1 of 1 (latest)
sure, thanks. Tested on a valid US address too, seems to be the same result with tos_acceptance and service_agreement set to full.
Using version: 2020-08-27
For context
let individual: Stripe.TokenCreateParams.Account.Individual = {
email: userPrivate.email,
last_name: userPrivate.personal.surname,
first_name: userPrivate.personal.name,
phone: userPrivate.mobile,
dob: {
day: dob.getDate(),
month: dob.getMonth() + 1,
year: dob.getFullYear(),
},
address: {
line1: addressLine1,
line2: addressLine2,
city: city,
state: state,
country: countryCode,
postal_code: postalCode,
},
};
if(userPrivate.personal.address.countryCode.toLowerCase() === "us") {
individual.ssn_last_4 = userPrivate.personal.ssn.slice(-4);
}
Create token (convinience method for {account: params})
const token = await createConnectAccountToken({
tos_shown_and_accepted: true,
business_type: "individual",
individual: individual,
});
Finally, create that actual account with:
return createConnectedAccount({
metadata: {
uid: userPrivate.uid,
},
account_token: token.id,
business_profile: {
mcc: mcc,
url: "https://my.app.io",
},
type: "custom",
tos_acceptance: {
service_agreement: countryCode.toLowerCase() === "us" ? "full" : "recipient",
},
// business_type: "individual",
// individual: individual,
email: userPrivate.email,
country: countryCode,
default_currency: "usd",
capabilities: {
transfers: {
requested: true,
},
},
settings: {
payouts: {
schedule: {
interval: "manual",
},
},
},
})
createConnectedAccount fails with error(s) provided.
thanks for the details! taking a look now
can you share the request id which failed with that error message?
sure, sec
Message: A recipient service agreement is required for accounts in ZA
Request Id: req_uwuztdPYXSRQPm
Message: Parameter 'tos_acceptance' cannot be used in conjunction with an account token
Request Id: req_n0IeOpEOeaIR0M
the way i went about it was
stripe
.createToken('account', {
business_type : 'individual',
individual: {
first_name: 'Jane',
last_name: 'Doe',
},
tos_shown_and_accepted: true,
})
.then(function(result) {
console.log(result);
});
then created the account with
...
tos_acceptance[service_agreement]=recipient
...
^ worked for me
I have exactly the same, let me just restructure quick
/// get stripe instance and create token from above
getStripeInstance().tokens.create({
account: {
tos_shown_and_accepted: true,
business_type: "individual",
individual: individual,
},
}).then((e) => {
/// get stripe instance and create account
getStripeInstance().accounts.create({
metadata: {
uid: userPrivate.uid,
},
account_token: token.id,
business_profile: {
...
})
})
Same code, just a little more easier to read
i.e. same structure what you have, but gives these errors
where are you passing the tos_acceptance[service_agreement] -> in accounts.create?
copied from above:
tos_acceptance: {
service_agreement: countryCode.toLowerCase() === "us" ? "full" : "recipient",
}
for anything outside US, it is recipient
aha! so if you take a look at this : https://dashboard.stripe.com/test/logs/iar_n0IeOpEOeaIR0M
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
you're passing in tos_acceptance[date]
if you remove that it should work
oh, did it still fail?
let me confirm the issue is actually resolved
I think so, but let me confirm
give me 2min
I'll be testing this in my account create params:
{
...
type: "custom",
tos_acceptance: {
service_agreement: userPrivate.personal.address.countryCode.toLowerCase() === "us" ? "full" : "recipient",
},
// business_type: "individual",
// individual: individual,
email: userPrivate.email,
...
}
well... its working now, just getting a currency error for using usd in ZA
yay!
thanks for the assistance, not quite sure what caused the problem but glad it is resolved.
(well, teh date in the tos part, but think there was something else too)
welp, happy that we figured things out, feel free to reach out again if you have any other issues 😄
will do, thanks a ton