#RGRTHAT - account representative

1 messages · Page 1 of 1 (latest)

narrow mist
sturdy oasis
#

As u can see, I cant find any prop for "representative". I use typescript

narrow mist
#

Which library is that?

#

That API version is different than the version of the client library that you are using

sturdy oasis
#

this is serverside node.js

#

I use just "stripe" library

#

My server crashes..because of typescript. I might have to ignore typescript for this library

#

this is stripe connect

#

Im able to create account, but suppose i need to "director, exectutive" to go forward

sturdy oasis
narrow mist
#

Thank you. Checking further in to this

sturdy oasis
#

From the stripe dashboard I ofcourse get questions about "director" and "executive" and "owner"

#

I try to add this ontop of file to avoid typescript crashing server

#
// @ts-ignore
// @ts-nocheck
narrow mist
#

Have you tried updating to the latest version of the index file?

yarn add stripe@latest```
sturdy oasis
#
 return new TSError(diagnosticText, diagnosticCodes);
           ^
TSError: ⨯ Unable to compile TypeScript:
server.ts:45:25 - error TS2769: No overload matches this call.
  Overload 1 of 2, '(params?: AccountCreateParams, options?: RequestOptions): Promise<Response<Account>>', gave the following error.
    Argument of type '{ country: string; type: "custom"; capabilities: { card_payments: { requested: true; }; transfers: { requested: true; }; }; default_currency: string; business_type: any; email: any; business_profile: { ...; }; representative: { ...; }; company: { ...; }; }' is not assignable to parameter of type 'AccountCreateParams'.
      Object literal may only specify known properties, and 'representative' does not exist in type 'AccountCreateParams'.
  Overload 2 of 2, '(options?: RequestOptions): Promise<Response<Account>>', gave the following error.
    Argument of type '{ country: string; type: string; capabilities: { card_payments: { requested: boolean; }; transfers: { requested: boolean; }; }; default_currency: string; business_type: any; email: any; business_profile: { ...; }; representative: { ...; }; company: { ...; }; }' is not assignable to parameter of type 'RequestOptions'.
      Object literal may only specify known properties, and 'country' does not exist in type 'RequestOptions'.
sturdy oasis
#

i just did "npm i stripe"

sturdy oasis
#

I tried now to uninstall and install latest again. Doesnt work

#

It seems to be typescript that cause server to crash? but that doesnt make sense, cuz i have "strict: none" on compiler config

#

I use ```js
const account = await stripe.accounts.create({})

#

I can confirm that its not typescript

#

I changed to just ```js
const stripe = require("stripe")(apikey)

#

it says that its no prop called any of these

#

@narrow mist There are no props that exist for "executives", "owners", etc

#

I have also tried to use "apiVersion: null"

tepid portal
#

Hello! Taking over and catching up, hang on...

sturdy oasis
#

im using connect "custom" onboarding

#

trying to make a account for new user

#

and as u can see from "requirements", i need to specify "owners", "representative" and "directors"

#

I use my own forms, so no "template" / redirect to stripe website

#

but wierd i cant find any prop for these? Cuz when i create the account, I get a response, and It says due ```js

"requirements": {
"alternatives": [],
"current_deadline": null,
"currently_due": [
"company.directors_provided",
"company.executives_provided",
"directors.dob.day",
"directors.dob.month",
"directors.dob.year",
"directors.email",
"directors.first_name",
"directors.last_name",
"directors.relationship.title",
"executives.address.city",
"executives.address.line1",
"executives.address.postal_code",
"executives.dob.day",
"executives.dob.month",
"executives.dob.year",
"executives.email",
"executives.first_name",
"executives.last_name",
"external_account",
"representative.address.city",
"representative.address.line1",
"representative.address.postal_code",
"representative.dob.day",
"representative.dob.month",
"representative.dob.year",
"representative.email",
"representative.first_name",
"representative.last_name",
"representative.phone",
"representative.relationship.executive",
"representative.relationship.title",
"tos_acceptance.date",
"tos_acceptance.ip"
],

tepid portal
#

Yep, I understand what you're trying to do, I just don't understand specifically what's failing. Can you provide all of the code for the API request that's failing?

sturdy oasis
#
const account = await stripe.accounts.create({
    country: "NO",
    type: "custom",
    capabilities: {
      card_payments: { requested: true },
      transfers: { requested: true },
    },
    business_type: business_type,
    email: email,
    business_profile: {
      url: business_profile_url.
      mcc: merchant_category_code,
    }
    executives: {
      first_name: first_name
      last_name: last_name
    },
    company: {
      address: {
        city: city.
        country: country.
        line1: company_address.
        postal_code: postal_code.
        state: state 
      },
      structure: company_structure,
      name: company_name,
      phone: company_phone,
      tax_id: company_tax_id.
      registration_number: registration_number
    },
  });
tepid portal
#

That's the code that doesn't work? I thought you said you were trying to use representative somewhere?

sturdy oasis
#

yes

#

i tried adding "representative", but then i get error saying

#

StripeInvalidRequestError: Received unknown parameter: representative

tepid portal
#

Where exactly where you trying to add that?

sturdy oasis
#

see edited code above

#
executives: {
      first_name: first_name
      last_name: last_name
    },
#
StripeInvalidRequestError: Received unknown parameter: executives
#

According to docs

#

"executives.first_name"

#

As u can see from docs here, the "company" prop is visible for me. But "executives", "owners" and "directors" is not visible or doesnt work

#

currently i use regular ```js
const stripe = require("stripe")(apiKey)

tepid portal
#

So you're trying to create an account for a company with multiple executives?

#

If you're trying to create an account for a company with more than one person associated with it you'll need to use the Persons API in addition to the Accounts API: https://stripe.com/docs/api/persons

sturdy oasis
#

Im simply trying to add a account to my connect. And I get "restricted" if I dont specify "directors" and all that crap like "first_name" etc

#

and when i press inside the newly created account i get this

#

from stripe dashboard

tepid portal
#

When you see something like executives.first_name in the requirements it means that one or more of the executives for the account in question need to provide their first name. It doesn't mean there's a single executives.first_name property on the Account itself.

sturdy oasis
#

I want to ofcourse be able to payout money to the connected account

tepid portal
#

Yeah, you need to provide all of the required information using the APIs I linked to above, but the requirements do not map 1:1 with properties on the Account object.

sturdy oasis
sturdy oasis
#

i have tried adding everything

tepid portal
#

To clarify, is this connected account for an individual or for a company?

sturdy oasis
#

company

tepid portal
sturdy oasis
#

u have to create the Person after the account?

#

as i see from docs u need to pass account id to the creation object

#
const person = await stripe.accounts.createPerson(
  'acct_1Ibqq9HkK6xmnAQC',
  {first_name: 'Jane', last_name: 'Diaz'}
);
tepid portal
#

Yep, that's correct. 🙂

sturdy oasis
#
tos_acceptance: {
      date: Date.now(),
      ip: "something here",
      user_agent: "agent here",
      service_agreement: "full",
    },
``` for "agent" and "ip", do u know any great way to get those values?
tepid portal
#

You get them from your system. The user_agent is typically from the web browser being used by the person onboarding, and the ip is their IP address.

sturdy oasis
#
raw: {
    message: 'ToS acceptance date is not valid. Dates are expected to be integers, measured in seconds, not in the future, and after 2009.',
    param: 'tos_acceptance[date]',
    type: 'invalid_request_error'
#

I try to do ```js
new Date().getTime()

#

which output something like so ```js
1647901085112

#

shouldnt that be valid?

tepid portal
#

That's in milliseconds, not seconds.

#

You need to divide by 1,000 to get seconds.

sturdy oasis
#
new Date().getTime() / 1000
``` ```js
        return new StripeInvalidRequestError(rawStripeError);
               ^
StripeInvalidRequestError: Invalid integer: 1647901361.144
grizzled gorge
#

you need an integer, it's a unix timestamp not a float

tepid portal
#

Ah, sorry, divide by zero to an integer.

#

Yeah. 😄

sturdy oasis
#

I wonder why "Payouts are disabled until a representative is added." pops up, when I have added this

grizzled gorge
sturdy oasis
#

yeh looks like i need some sort of document

#

@grizzled gorge damn this process is insane

#

this means that i have to request pass port, driver license, id card or permit id to customers?

#

isnt that really heavy duty

#

would be much better with just the persons´s personal id number.

#

not everyone knows how to add for example a image file of their passport online

#

@tepid portal When I registered for stripe, i cant remember having to upload like a freaking png file of pass port or something. I might recall adding personal id number.

#

I would much perfer to ask for personal id number, then forcing user to take image of their passport, upload to computer, upload to my website, etc

#

isnt it possible to just use personal id number?

grizzled gorge
#

I mean you're accepting payments on behalf of another company

#

Every country have different requirements and some re heavier than other. Nothing is "insane" here, you can't just get money and send it to whomever you want sadly, there are strict rules and regulations worldwide for this

#

And not it's not possible to "just use personal id number". Many countries don't even have one of those

sturdy oasis
#

@grizzled gorge I see. I just cant recall simple sites like take for example ebay or amazon asking u for pass port, driver license or something similar? im not customer of those though, so might be wrong

#

I have this step left, which means I need to create a external account?

#
const bankAccount = await stripe.accounts.createExternalAccount(
  'acct_1Ibqq9HkK6xmnAQC',
  {
    external_account: 'btok_1KftDZHkK6xmnAQC1mLuC1VU',
  }
);
``` seems like i need a token "btok"
grizzled gorge
#

Rules and regulations evolve every year too. What happened a year ago is different. For example we're required to collect more information in Europe today than we were 5 months ago

sturdy oasis
#

damn making ur own forms & onboarding flow was harder then i thought

#

its not hard, but time consuming really. And not the onboarding flow i was looking for

grizzled gorge
#

it's exactly why we built Connect onboarding, so you don't have to

#

it's hard to do but also know that you will have to change this over the years as new requirements and regulations pop up

sturdy oasis
#

yeh thats the thing, having to change crap l8r is pain. But I hate these "templates" / redirect to other websites crap. I just dont like that "flow"

#

but im strongly considering it tbh

#

it will remove alot of pain

grizzled gorge
#

Yeah I feel you. We started with the API version too for that reasons. But you should see how often this changes, and how hard it is to do more than one country

#

like do you know how to localize this for Japan? I work at Stripe and I've used those APIs for years and I can tell you if I ever built this myself I'd use Connect Onboarding without even thinking

#

I agree the redirect can appear painful, but it's focused on the end user, and we constantly improve it too

sturdy oasis
grizzled gorge
#

Of course 🙂

sturdy oasis
#

@grizzled gorge from connect demo website, stripe allow u to use social security number instead of uploading document

grizzled gorge
#

sure, that's for the US

#

half the screenshots you shared earlier are not for the US

#

And you still need to provide more information after that step if there's a mismatch