Class: Stripe::ExternalAccountService

Inherits:
StripeService show all
Defined in:
lib/stripe/services/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(params = {}, opts = {}) ⇒ Object

Create an external account for a given connected account.



145
146
147
148
149
150
151
152
153
# File 'lib/stripe/services/external_account_service.rb', line 145

def create(params = {}, opts = {})
  request(
    method: :post,
    path: "/v1/external_accounts",
    params: params,
    opts: opts,
    base_address: :api
  )
end

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

Delete a specified external account for a given account.



156
157
158
159
160
161
162
163
164
# File 'lib/stripe/services/external_account_service.rb', line 156

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

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

List external accounts for an account.



167
168
169
170
171
172
173
174
175
# File 'lib/stripe/services/external_account_service.rb', line 167

def list(params = {}, opts = {})
  request(
    method: :get,
    path: "/v1/external_accounts",
    params: params,
    opts: opts,
    base_address: :api
  )
end

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

Retrieve a specified external account for a given account.



178
179
180
181
182
183
184
185
186
# File 'lib/stripe/services/external_account_service.rb', line 178

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

#update(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.



196
197
198
199
200
201
202
203
204
# File 'lib/stripe/services/external_account_service.rb', line 196

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