#_desa

1 messages · Page 1 of 1 (latest)

severe plazaBOT
errant swan
#

Can you share an example account id, or a request to create an account?

celest panther
#

sure - sec

errant swan
#

This "locked country" behaviour is typically when you try to override the capabilities for an express account without specifying a country

#

In which case the acount is created using your platform country

errant swan
#

So to fix this, you should either change the default capabilities in your express settings for the relevant countries, or if you do need to override capabilities then you should also specify the country

celest panther
#

they're toggled on already- us and philippines

#

am i missing something specific here

errant swan
#

That it not an account creation request, but an onboarding account link

#

For the account creation request id like req_123

celest panther
#

req_xQ7QILuobnmphC

#

thats link i guess

#

req_FNTAVPzE8PMNoT

#

there is the initial account request

errant swan
#

So I would expect this to be locked to US, right?

celest panther
#

fair enough lol

#

can i pass an array of supported countries?

#

you're totally right

#
    admin_user = current_admin_user

    if admin_user.stripe_account_id.nil?
      account = Stripe::Account.create(
        type: 'custom',
        country: 'US',
        email: admin_user.authentication.email,
        requested_capabilities: ['card_payments', 'transfers']
      )
      admin_user.update(stripe_account_id: account.id)
    else
      account = Stripe::Account.retrieve(admin_user.stripe_account_id)
    end

    account_link = Stripe::AccountLink.create(
      account: account.id,
      refresh_url: "#{ENV.fetch('ADMIN_HOST_DOMAIN')}/account/edit",
      return_url: "#{ENV.fetch('ADMIN_HOST_DOMAIN')}/account/edit",
      type: 'account_onboarding'
    )

    render json: account_link, status: :ok
  end```
#

here is our code here

errant swan
#

No, you either specify the country or omit it, but this is custom so the case i mentioned about express accounts doesnt apply

celest panther
#

if i omit it can they then self specify?

errant swan
#

You can specify the request_capabilities in the creation request as needed for your business

celest panther
#

yeah, i have that here: requested_capabilities: ['card_payments', 'transfers']

errant swan
#

Sure, then you can omit the country and let the user select this during onboarding