Skip to content

Instantly share code, notes, and snippets.

@adamjstevenson
Created October 21, 2017 16:55
Show Gist options
  • Save adamjstevenson/0204ee5a1b0151d2aabb41ff48d11f35 to your computer and use it in GitHub Desktop.
Save adamjstevenson/0204ee5a1b0151d2aabb41ff48d11f35 to your computer and use it in GitHub Desktop.
Retrieve fields needed for a Stripe account
# Retrieve the account
account = Stripe::Account.retrieve("acct_1BF8VRBAxruRdpTq")
# Grab the fields needed
fields_needed = account.verification.fields_needed
# ...later in your form, display an account update form based on the fields needed for verification
<% if fields_needed.include?('legal_entity.business_name') %>
<div class="form-group">
<%= f.label :business_name, "Business name (as it appears to the IRS)" %>
<%= f.text_field :business_name, class: "form-control input-lg", placeholder: "My Business LLC" %>
</div>
<% end %>
<% if fields_needed.include?('legal_entity.business_tax_id') %>
<div class="form-group">
<%= f.label :business_tax_id, "Business tax ID/EIN" %>
<%= f.text_field :business_tax_id, class: "form-control input-lg", placeholder: "27-0000000" %>
</div>
<% end %>
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment