问题
I use the following to create a new Stripe connect account:
account = Stripe::Account.create({
type: 'express',
requested_capabilities: ['card_payments', 'transfers']
})
When the user clicks 'Connect with Stripe', they start entering their details. They can enter an American phone number, but not an American address - the country is locked to Australia, and clicking on 'Australia' to try to change it doesn't do anything at all:
Also, the 'State' field only shows Australian states:
Why is stripe making this restriction? I'm quite sure I've configured stripe correctly when setting it up, I suspect it's a problem with my code (something I'm doing or failing to do during Stripe::Account.create()
)?
What I've tried
Attempt 1
I tried with requested_capabilities: ['card_payments']
, but:
Accounts do not currently support `card_payments` without `transfers`.
Please visit
https://stripe.com/docs/connect/account-capabilities#card-payments
for more details.
Attempt 2
I tried with requested_capabilities: ['transfers']
, there was no error, but I could still only enter an Australian address.
Attempt 3
I checked the settings in the platform dashboard, cannot spot anything unusual in settings, and confirmed that connect is configured to accept connected users from Australia + 35 other countries
回答1:
I think v1 of Stripe API, should allow you to specify country. From what I saw in the Documentation, I think you should specify what you want.
POST /v1/accounts of StripeAPI Docs looks like this
require 'stripe'
Stripe.api_key = 'sk_test_4eC39HqLyjWDarjtT1zdp7dc'
Stripe::Account.create({
type: 'custom',
country: 'US',
email: 'jenny.rosen@example.com',
capabilities: {
card_payments: {requested: true},
transfers: {requested: true},
},
})
You may want to configure further. Let me know if specifying country doesn't fixed the issue. Read up from here. By virtue of what is in the API, country
is optional. Since you didn't specify, it defaults to your location.
As of today, Stripe Express supports Australia, Austria, Belgium, Bulgaria, Canada, Cyprus, the Czech Republic, Denmark, Estonia, Finland, France, Germany, Greece, Hong Kong, Hungary, Ireland, Italy, Japan, Latvia, Lithuania, Luxembourg, Malta, Mexico, the Netherlands, New Zealand, Norway, Poland, Portugal, Romania, Singapore, Slovakia, Slovenia, Spain, Sweden, Switzerland, the United Kingdom, or the United States. So you may decide which country you want to specify and put the ISO 3166-1 alpha-2 country code.
回答2:
I heard back from Stripe support, but what they replied with contradicts @Afolabi's answer, and also contradicts what happens when the code is run in the rails console. So I have replied with extra info and will update this when I hear back.
Stripe say:
If you have a Standard and Express account then users will indicate the country their Stripe account is base from and for custom accounts, it is the platform who needs to indicate the country because custom accounts doesn't have a dashboard unlike Standard and Express Stripe accounts.
But all my attempts to generate an express
account without supplying a country result in the country defaulting to the 'US'
and the user cannot change it (so the best I can do at this stage is ensure the platform (i.e. my app) provides the country argument)
Minimal reproducible example
Here's a complete MRE of the problem:
require 'stripe'
Stripe.api_key = 'sk_test_4eC39HqLyjWDarjtT1zdp7dc'
new_account = Stripe::Account.create({
type: 'express',
email: 'jenny.rosen@example.com',
capabilities: {
card_payments: {requested: true},
transfers: {requested: true},
},
})
account_links = Stripe::AccountLink.create({
account: new_account.id,
refresh_url: 'http://localhost:3000/reauth',
return_url: 'http://localhost:3000/return',
type: 'account_onboarding',
})
# Visit url provided and see that country is locked to 'US',
# and it cannot be input by the user being onboarded like stripe
# support suggests should happen
来源:https://stackoverflow.com/questions/65063282/stripe-connect-onboarding-limiting-country-locked-to-australia