Class: Stripe::AccountExternalAccountService

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

Defined Under Namespace

Classes: CreateParams, DeleteParams, ListParams, RetrieveParams, UpdateParams

Instance Method Summary collapse

Methods inherited from StripeService

#initialize, #request, #request_stream

Constructor Details

This class inherits a constructor from Stripe::StripeService

Instance Method Details

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

Create an external account for a given account.



300
301
302
303
304
305
306
307
308
# File 'lib/stripe/services/account_external_account_service.rb', line 300

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

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

Delete a specified external account for a given account.



311
312
313
314
315
316
317
318
319
# File 'lib/stripe/services/account_external_account_service.rb', line 311

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

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

List external accounts for an account.



322
323
324
325
326
327
328
329
330
# File 'lib/stripe/services/account_external_account_service.rb', line 322

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

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

Retrieve a specified external account for a given account.



333
334
335
336
337
338
339
340
341
# File 'lib/stripe/services/account_external_account_service.rb', line 333

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

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

Updates the metadata, account holder name, account holder type of a bank account belonging to a connected account and optionally sets it as the default for its currency. Other bank account details are not editable by design.

You can only update bank accounts when [account.controller.requirement_collection is application, which includes <a href=“/connect/custom-accounts”>Custom accounts](stripe.com/api/accounts/object#account_object-controller-requirement_collection).

You can re-enable a disabled bank account by performing an update call without providing any arguments or changes.



351
352
353
354
355
356
357
358
359
# File 'lib/stripe/services/account_external_account_service.rb', line 351

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