#erwanndiagram_code

1 messages ยท Page 1 of 1 (latest)

raven gladeBOT
#

๐Ÿ‘‹ 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/1270289982434578555

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

keen rapids
#

Hello
if i can t inform verifiaction document on the token when i do this on client size and i can t inform document on the server size because of i created token on the client size that was needed due to security how can I manage this ?

raven gladeBOT
crude hamlet
#

๐Ÿ‘‹ happy to help

#

I will be with you shortly

keen rapids
#

okay no problem

crude hamlet
#

I'm terribly sorry, I totally missed getting back to your question

keen rapids
#

it s okay you have an idea to what can i do ?

crude hamlet
#

this is the new custom account onboarding recommendation

#

you can also use our embedded onboarding components to reduce the amount of programming that you have to do, especially if you don't want to use our hosted onboarding

keen rapids
#

okay i will check it

keen rapids
#

I read it, I already code it, all works except for company.verification.document , I retrieve the files sent by user and create Stripe instance Files, after I create token on stripe.js for account where I can't inform the files, and I don't where inform them

#

On js after retrieve form sent by user :

async function createTokenAccountStripe(data) {
const token = await stripe.createToken("account", {
business_type: "company",
company: {
name: data["businessName"],
address: {
line1: data["businessAddress"],
city: data["businessCity"],
state: data["businessState"],
postal_code: data["businessPostalCode"],
country: data["businessCountry"]
},
vat_id: data["companyVatId"] || undefined,
tax_id: data["companyRegistrationNumber"],
phone: data["businessPhone"],
},
tos_shown_and_accepted: true
});
if (token.error) {
throw new Error(token.error.message);
}
return token["token"]["id"];
}

#

on php with the data i get from js

$stripeAccount = Account::create(
[
'type' => 'custom',
"country" => $data['businessCountry'],
'capabilities' => [
'card_payments' => ['requested' => true],
'transfers' => ['requested' => true],
],
// don t work
// 'company' => [
// 'verification' => [
// 'document' => [
// 'front' => $arrayTokenFiles["tokenAdditionalFileFront"],
// 'back' => $arrayTokenFiles["tokenAdditionalFileBack"],
// ],
// ],
// ],
'business_profile' => [
'mcc' => 7230,
'url' => 'cowobo.com',
"support_email" => $data["representativeEmail"],
"support_phone" => $data["representativePhone"],
"support_address" => [
"line1" => $data['representativeAddress'],
"city" => $data['representativeCity'],
"state" => $data['representativeState'],
"postal_code" => $data['representativePostalCode'],
"country" => $data['businessCountry'],
],
],
'email' => $email,
'account_token' => $tokenAccount,
"settings" => [
"payouts" => [
"schedule" => [
"interval" => "manual",
],
],
],
]
);

crude hamlet
keen rapids
#

first line of token creation :
async function createTokenAccountStripe(data) {
const token = await stripe.createToken("account", {
business_type: "company",

#

do you prefer screen shots because ther is no color :/

crude hamlet
#

I'm not sure whether the accountToken, since it's holding a company hash, is overriding what you're passing in the account creation company hash

#

I need to verify that

keen rapids
#

yes i can but i dont know how can this be useful if you want i can send you the logs

#

oh okay

crude hamlet
#

can you try something for me please

#

can you create the account, and then update it with the documents?

#

this way we can be sure

keen rapids
#

yes i can try

#

5minutes i will send you screenshots and change my env for prod

#

i send without document verification (named premier document additionnel)
token of account : ct_1PkjNCP08JNx8Ptc9n4y7utr

#

my files token and account token

crude hamlet
#

please delete the screenshots

#

they contain PII

#

I mean the forms

keen rapids
#

okay so in production my code works but

#

but why do we have do send the additional files after

crude hamlet
keen rapids
#

that s what i did but for the first time when we create and don't update account it doesn't work

crude hamlet
#

no you passed it in the account creation request in the backend

#

not in the account token creation in the frontend

keen rapids
#

i can t do it because i inform the company information in the token and if i do this i get this error :
Une erreur s'est produite : Parameter 'company' cannot be used in conjunction with an account token. To set this field create a token with the desired changes. Pass the token with 'account_token' in a request without setting 'company'. See https://stripe.com/docs/connect/account-tokens#updating for more information.

Connect platforms can use Stripe.js, the API, or mobile client libraries to securely collect account details from their users.

crude hamlet
#

that's not what I meant

#

I meant in the first code

#
    const token = await stripe.createToken("account", {
        business_type: "company",
        company: {
            name: data["businessName"],
            address: {
                line1: data["businessAddress"],
                city: data["businessCity"],
                state: data["businessState"],
                postal_code: data["businessPostalCode"],
                country: data["businessCountry"]
            },
            vat_id: data["companyVatId"] || undefined,
            tax_id: data["companyRegistrationNumber"],
            phone: data["businessPhone"],
        },
        tos_shown_and_accepted: true
    });
    if (token.error) {
        throw new Error(token.error.message);
    }
    return token["token"]["id"];
} 
#

in this you can add the verification documents here

keen rapids
#

oh ok that s what i do for but idk why it won t add the files for a creation (that s the results I get yesterday) and only in production environment so i try again

#

i think i changed one thing between yesterday and today my files have the purpose account_requirement and before they have additional_verification

crude hamlet
#

did it work now?

keen rapids
#

Sorry but i have to wait for some reason i tell you when i do it

crude hamlet
#

sure let me know if you need any more help

keen rapids
#

it works

#

so it was just the name of the purpose of my files

#

thank you