Class: Stripe::AccountService

Inherits:
StripeService show all
Defined in:
lib/stripe/services/account_service.rb

Defined Under Namespace

Classes: CreateParams, DeleteParams, ListParams, RejectParams, RetrieveCurrentParams, RetrieveParams, UpdateParams

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from StripeService

#request, #request_stream

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(requestor)
  @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

#capabilitiesObject (readonly)

Returns the value of attribute capabilities.



6
7
8
# File 'lib/stripe/services/account_service.rb', line 6

def capabilities
  @capabilities
end

#external_accountsObject (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

Returns the value of attribute login_links.



6
7
8
# File 'lib/stripe/services/account_service.rb', line 6

def 
  @login_links
end

#personsObject (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](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](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.



4373
4374
4375
# File 'lib/stripe/services/account_service.rb', line 4373

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](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](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.



4384
4385
4386
4387
4388
4389
4390
4391
4392
# File 'lib/stripe/services/account_service.rb', line 4384

def delete(, params = {}, opts = {})
  request(
    method: :delete,
    path: format("/v1/accounts/%<account>s", { account: CGI.escape() }),
    params: params,
    opts: opts,
    base_address: :api
  )
end

#list(params = {}, opts = {}) ⇒ Object

Returns a list of accounts connected to your platform via [Connect](stripe.com/docs/connect). If you’re not a platform, the list is empty.



4395
4396
4397
# File 'lib/stripe/services/account_service.rb', line 4395

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](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.



4402
4403
4404
4405
4406
4407
4408
4409
4410
# File 'lib/stripe/services/account_service.rb', line 4402

def reject(, params = {}, opts = {})
  request(
    method: :post,
    path: format("/v1/accounts/%<account>s/reject", { account: CGI.escape() }),
    params: params,
    opts: opts,
    base_address: :api
  )
end

#retrieve(account, params = {}, opts = {}) ⇒ Object

Retrieves the details of an account.



4413
4414
4415
4416
4417
4418
4419
4420
4421
# File 'lib/stripe/services/account_service.rb', line 4413

def retrieve(, params = {}, opts = {})
  request(
    method: :get,
    path: format("/v1/accounts/%<account>s", { account: CGI.escape() }),
    params: params,
    opts: opts,
    base_address: :api
  )
end

#retrieve_current(params = {}, opts = {}) ⇒ Object

Retrieves the details of an account.



4424
4425
4426
# File 'lib/stripe/services/account_service.rb', line 4424

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](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](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](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](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](stripe.com/docs/connect/updating-accounts) documentation to learn more about updating accounts.



4441
4442
4443
4444
4445
4446
4447
4448
4449
# File 'lib/stripe/services/account_service.rb', line 4441

def update(, params = {}, opts = {})
  request(
    method: :post,
    path: format("/v1/accounts/%<account>s", { account: CGI.escape() }),
    params: params,
    opts: opts,
    base_address: :api
  )
end