#_desa
1 messages · Page 1 of 1 (latest)
I asked a similar question yesterday, but am just now getting around to solving it, synthwave was who i was talking ot
Hello, I think this usually happens if you specify capabilities when creating the account
If you create the account without requesting capabilities and then create the account links, does that work?
admin_user = current_admin_user
if admin_user.stripe_account_id.nil?
account = Stripe::Account.create(
type: 'custom',
email: admin_user.authentication.email,
requested_capabilities: ['card_payments', 'transfers']
)
Rails.logger.info("Created stripe account: #{account}")
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```
is my current code - let me check by removing requested_capabilities
You must request one or more of the following capabilities: transfers. Please visit https://stripe.com/docs/connect/account-capabilities to learn more.```
Apologies that I was mistaken. Looking in to that error and double checking what I said about the country being locked in when you specify capabilities
making it only transfers seems to no longer have it ask for address or ssn.. which is interesting, idk if there is a difference between my test env and prod, because it seems like if they get sent right to adding a bank that'll work, but in the dashboard they do still have the US flag
req_LOB6CSjliXnJIV if this is helpful is the original account link request
Thank you, was just about to ask for that ID
Can you send the ID for the time you got the error about needing to request transfers
Ah, so my advice applied to Express accounts. For Connect accounts you need to specify the capabilities and country upfront. So it would be best to collect the user's country code before creating their account
hmmmmmm
what countries are supported
i'll just make dropdown on the front end that passes it to the endpoint which is fine, i also just need the country codes/abbreviations
if there is a handy dandy doc for that somewhere
Looking for the doc on that and will get back to you
ty
here's what i'm about to test - let me know if this seems like we're on the same page:
admin_user = current_admin_user
if admin_user.stripe_account_id.nil?
account = Stripe::Account.create(
type: 'custom',
country: params[:country],
email: admin_user.authentication.email,
requested_capabilities: ['card_payments', 'transfers']
)
Rails.logger.info("Created stripe account: #{account}")
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```
Apologies for the delay, according to the API reference, you can create a custom connect account in any country listed on these two pages
https://stripe.com/global
https://stripe.com/docs/connect/cross-border-payouts
do you have the abbreviations for the countries anywhere?
ie - united states = US
philippines = ?
Stripe doesn't list them but we do use ISO standard ones https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2
ISO 3166-1 alpha-2 codes are two-letter country codes defined in ISO 3166-1, part of the ISO 3166 standard published by the International Organization for Standardization (ISO), to represent countries, dependent territories, and special areas of geographical interest. They are the most widely used of the country codes published by ISO (the other...
oh sweet, that's exactly what i was hoping for
did you take a sec to read the code i sent over to see if we're on the same page there? i'd just pass in the country code as a param on the front end
Apologies, misread that message. Yep that code looks like what I was saying, if you test with that it should work as long as a proper country code is passed to your backend