#mark_prefill-connect
1 messages ยท Page 1 of 1 (latest)
๐ 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/1271204177531637850
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hi ๐ yes, you can do that when first creating the Account object. When you create the Account objects for your connnected accounts, are you using the controller hash or the type field?
mark_prefill-connect
This is what I'm currently prefilling:
def build_local_params
params = {}
params[:type] = 'standard'
params[:business_type] = owner.stripe_business_type
params[:email] = admin.default_email_address&.email_address
params[:country] = 'US'
params[:business_profile] = {
:mcc => '8641', # Fraternal MCC
:name => owner.display_name,
:product_description => 'Local fraternal organization that collects dues and incidental payments for events, and donations.',
:support_email => admin.default_email_address.email_address,
:support_url => owner.tenant.url,
:url => owner.tenant.url
}
params[:company] = {
:address => {
:line1 => owner.address1,
:line2 => owner.address2,
:city => owner.city,
:state => owner.state&.postal_code,
:postal_code => owner.zip
},
:name => owner.legal_name,
:phone => admin.default_phone_number&.number,
:tax_id => owner.clean_tax_id
}
params[:default_currency] = 'usd'
params[:metadata] = {
:type => 'Local',
:local_id => owner.id,
:name => owner.display_name,
:group => owner.group.display_name
}
params
end
Gotcha, so type = standard, perfect, one second
Oh, wait, it looks like you already have the gist of prefilling information. Is there something specific you're trying to prefill but aren't able to?
Yes, I have the admin's information in my system and I'd like to prefill that so all they need to enter is the SSN. (I don't have SSNs in my system.)
Currently all of my accounts are for non_profits FYI.
Gotcha, I can't remember exactly if you can do that for Standard Connected Accounts (I'll try to test on the side, but you may be able to test faster than I am), but if so you'd do that by creating a Person object for the Account and provide the details you have in the Person object:
https://docs.stripe.com/api/persons/create
I stepped through a test and confirmed you are able to create a Person object for your Standard Connected Accounts, as long as you do so before creating their Account Link for onboarding.
yep I can confirm that's how you pre-fill for Standard accounts!
If I create the person before generating the link will that person be listed as the admin when they get to the onboarding screen?
yes
Thank you.
In Ruby is this ::Stripe::Account.create_person('acct_293843987', { :person_attributes => 'foo', :etc => 'llll'})
https://docs.stripe.com/api/persons/create has an example for all languages.
That's very incomplete. It shows passing the account_id, but doesn't show how to pass the person attributes.
Stripe.api_key = 'sk_test_4eC39HqLyjWDarjtT1zdp7dc'
Stripe::Account.create_person('acct_1032D82eZvKYlo2C')
ah yeah you're right. It's supposed to show you a real example, this is wrong.
really it's no different from any of our other API, you pass a hash with all the parameters like you do on Account creation or Customer creation
'acct_1032D82eZvKYlo2C',
{
first_name: 'john',
last_name: 'doe',
}
)```
Thanks. I'm about three days into Stripe at this point.
all good, our API Reference should absolutely show a real example. I didn't load it when I shared the URL because it used to show the example. I'm sorry it doesn't (and I flagged internally so that we fix it)
stripe_account = StripeAccount.create! do |a|
a.owner = owner
a.status = StripeAccount::STATUS_NEW
a.stripe_identifier = stripe_account_object.id
a.stripe_object_json = stripe_account_object.to_json
a.charges_enabled = false
a.payouts_enabled = false
end
::Stripe::Account.create_person(stripe_account_object.id, {
:first_name => admin.first_name,
:last_name => admin.last_name,
:dob => admin.birth_date&.to_date&.to_fs(:db),
:email => admin.default_email_address&.email_address,
:metadata => {
:party_id => admin.id,
:tenant => admin.tenant.hostname
},
:phone => admin.default_phone_number&.number,
:relationship => {
:representative => true,
:title => 'Secretary/Assistant Secretary'
}
})
stripe_account
This is failing with:
(Status 400) (Request req_GWLgxpNFjihEPJ) Invalid object excluded from capture: DSN not set
that error message is your own, not Stripe.
I recommend reading https://docs.stripe.com/error-handling which explains how to catch errors that our API returns so you can log them cleanly.
You can see the request log straight in the Dashboard too to look at the exact API request you send.
dob is a hash with three 3 sub-properties day, month and year. You sent a string