Class: Stripe::AccountService
- Inherits:
-
StripeService
- Object
- StripeService
- Stripe::AccountService
- Defined in:
- lib/stripe/services/account_service.rb
Defined Under Namespace
Classes: CreateParams, DeleteParams, ListParams, RejectParams, RetrieveCurrentParams, RetrieveParams, UpdateParams
Instance Attribute Summary collapse
-
#capabilities ⇒ Object
readonly
Returns the value of attribute capabilities.
-
#external_accounts ⇒ Object
readonly
Returns the value of attribute external_accounts.
-
#login_links ⇒ Object
readonly
Returns the value of attribute login_links.
-
#persons ⇒ Object
readonly
Returns the value of attribute persons.
Instance Method Summary collapse
-
#create(params = {}, opts = {}) ⇒ Object
With [Connect](docs.stripe.com/docs/connect), you can create Stripe accounts for your users.
-
#delete(account, params = {}, opts = {}) ⇒ Object
With [Connect](docs.stripe.com/connect), you can delete accounts you manage.
-
#initialize(requestor) ⇒ AccountService
constructor
A new instance of AccountService.
-
#list(params = {}, opts = {}) ⇒ Object
Returns a list of accounts connected to your platform via [Connect](docs.stripe.com/docs/connect).
-
#reject(account, params = {}, opts = {}) ⇒ Object
With [Connect](docs.stripe.com/connect), you can reject accounts that you have flagged as suspicious.
-
#retrieve(account, params = {}, opts = {}) ⇒ Object
Retrieves the details of an account.
-
#retrieve_current(params = {}, opts = {}) ⇒ Object
Retrieves the details of an account.
-
#update(account, params = {}, opts = {}) ⇒ Object
Updates a [connected account](docs.stripe.com/connect/accounts) by setting the values of the parameters passed.
Methods inherited from StripeService
Constructor Details
#initialize(requestor) ⇒ AccountService
Returns a new instance of AccountService.
8 9 10 11 12 13 14 |
# File 'lib/stripe/services/account_service.rb', line 8 def initialize(requestor) super @capabilities = Stripe::AccountCapabilityService.new(@requestor) @external_accounts = Stripe::AccountExternalAccountService.new(@requestor) @login_links = Stripe::AccountLoginLinkService.new(@requestor) @persons = Stripe::AccountPersonService.new(@requestor) end |
Instance Attribute Details
#capabilities ⇒ Object (readonly)
Returns the value of attribute capabilities.
6 7 8 |
# File 'lib/stripe/services/account_service.rb', line 6 def capabilities @capabilities end |
#external_accounts ⇒ Object (readonly)
Returns the value of attribute external_accounts.
6 7 8 |
# File 'lib/stripe/services/account_service.rb', line 6 def external_accounts @external_accounts end |
#login_links ⇒ Object (readonly)
Returns the value of attribute login_links.
6 7 8 |
# File 'lib/stripe/services/account_service.rb', line 6 def login_links @login_links end |
#persons ⇒ Object (readonly)
Returns the value of attribute persons.
6 7 8 |
# File 'lib/stripe/services/account_service.rb', line 6 def persons @persons end |
Instance Method Details
#create(params = {}, opts = {}) ⇒ Object
With [Connect](docs.stripe.com/docs/connect), you can create Stripe accounts for your users. To do this, you’ll first need to [register your platform](dashboard.stripe.com/account/applications/settings).
If you’ve already collected information for your connected accounts, you [can prefill that information](docs.stripe.com/docs/connect/best-practices#onboarding) when creating the account. Connect Onboarding won’t ask for the prefilled information during account onboarding. You can prefill any information on the account.
4093 4094 4095 |
# File 'lib/stripe/services/account_service.rb', line 4093 def create(params = {}, opts = {}) request(method: :post, path: "/v1/accounts", params: params, opts: opts, base_address: :api) end |
#delete(account, params = {}, opts = {}) ⇒ Object
With [Connect](docs.stripe.com/connect), you can delete accounts you manage.
Test-mode accounts can be deleted at any time.
Live-mode accounts where Stripe is responsible for negative account balances cannot be deleted, which includes Standard accounts. Live-mode accounts where your platform is liable for negative account balances, which includes Custom and Express accounts, can be deleted when all [balances](docs.stripe.com/api/balance/balance_object) are zero.
If you want to delete your own account, use the [account information tab in your account settings](dashboard.stripe.com/settings/account) instead.
4104 4105 4106 4107 4108 4109 4110 4111 4112 |
# File 'lib/stripe/services/account_service.rb', line 4104 def delete(account, params = {}, opts = {}) request( method: :delete, path: format("/v1/accounts/%<account>s", { account: CGI.escape(account) }), params: params, opts: opts, base_address: :api ) end |
#list(params = {}, opts = {}) ⇒ Object
Returns a list of accounts connected to your platform via [Connect](docs.stripe.com/docs/connect). If you’re not a platform, the list is empty.
4115 4116 4117 |
# File 'lib/stripe/services/account_service.rb', line 4115 def list(params = {}, opts = {}) request(method: :get, path: "/v1/accounts", params: params, opts: opts, base_address: :api) end |
#reject(account, params = {}, opts = {}) ⇒ Object
With [Connect](docs.stripe.com/connect), you can reject accounts that you have flagged as suspicious.
Only accounts where your platform is liable for negative account balances, which includes Custom and Express accounts, can be rejected. Test-mode accounts can be rejected at any time. Live-mode accounts can only be rejected after all balances are zero.
4122 4123 4124 4125 4126 4127 4128 4129 4130 |
# File 'lib/stripe/services/account_service.rb', line 4122 def reject(account, params = {}, opts = {}) request( method: :post, path: format("/v1/accounts/%<account>s/reject", { account: CGI.escape(account) }), params: params, opts: opts, base_address: :api ) end |
#retrieve(account, params = {}, opts = {}) ⇒ Object
Retrieves the details of an account.
4133 4134 4135 4136 4137 4138 4139 4140 4141 |
# File 'lib/stripe/services/account_service.rb', line 4133 def retrieve(account, params = {}, opts = {}) request( method: :get, path: format("/v1/accounts/%<account>s", { account: CGI.escape(account) }), params: params, opts: opts, base_address: :api ) end |
#retrieve_current(params = {}, opts = {}) ⇒ Object
Retrieves the details of an account.
4144 4145 4146 |
# File 'lib/stripe/services/account_service.rb', line 4144 def retrieve_current(params = {}, opts = {}) request(method: :get, path: "/v1/account", params: params, opts: opts, base_address: :api) end |
#update(account, params = {}, opts = {}) ⇒ Object
Updates a [connected account](docs.stripe.com/connect/accounts) by setting the values of the parameters passed. Any parameters not provided are left unchanged.
For accounts where [controller.requirement_collection](docs.stripe.com/api/accounts/object#account_object-controller-requirement_collection) is application, which includes Custom accounts, you can update any information on the account.
For accounts where [controller.requirement_collection](docs.stripe.com/api/accounts/object#account_object-controller-requirement_collection) is stripe, which includes Standard and Express accounts, you can update all information until you create an [Account Link or <a href=“/api/account_sessions”>Account Session](docs.stripe.com/api/account_links) to start Connect onboarding, after which some properties can no longer be updated.
To update your own account, use the [Dashboard](dashboard.stripe.com/settings/account). Refer to our [Connect](docs.stripe.com/docs/connect/updating-accounts) documentation to learn more about updating accounts.
4161 4162 4163 4164 4165 4166 4167 4168 4169 |
# File 'lib/stripe/services/account_service.rb', line 4161 def update(account, params = {}, opts = {}) request( method: :post, path: format("/v1/accounts/%<account>s", { account: CGI.escape(account) }), params: params, opts: opts, base_address: :api ) end |