Class: Increase::Resources::ExternalAccounts

Inherits:
Object
  • Object
show all
Defined in:
lib/increase/resources/external_accounts.rb

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ ExternalAccounts

Returns a new instance of ExternalAccounts.



6
7
8
# File 'lib/increase/resources/external_accounts.rb', line 6

def initialize(client:)
  @client = client
end

Instance Method Details

#create(params = {}, opts = {}) ⇒ Increase::Models::ExternalAccount

Create an External Account

Parameters:

  • params (Hash) (defaults to: {})

    Attributes to send in this request.

  • opts (Hash|RequestOptions) (defaults to: {})

    Options to specify HTTP behaviour for this request.

Options Hash (params):

  • :account_number (String)

    The account number for the destination account.

  • :description (String)

    The name you choose for the Account.

  • :routing_number (String)

    The American Bankers' Association (ABA) Routing Transit Number (RTN) for the destination account.

  • :account_holder (Symbol)

    The type of entity that owns the External Account.

  • :funding (Symbol)

    The type of the destination account. Defaults to checking.

Returns:



23
24
25
26
27
28
29
30
# File 'lib/increase/resources/external_accounts.rb', line 23

def create(params = {}, opts = {})
  req = {}
  req[:method] = :post
  req[:path] = "/external_accounts"
  req[:body] = params
  req[:model] = Increase::Models::ExternalAccount
  @client.request(req, opts)
end

#list(params = {}, opts = {}) ⇒ Increase::Page<Increase::Models::ExternalAccount>

List External Accounts

Parameters:

  • params (Hash) (defaults to: {})

    Attributes to send in this request.

  • opts (Hash|RequestOptions) (defaults to: {})

    Options to specify HTTP behaviour for this request.

Options Hash (params):

  • :cursor (String)

    Return the page of entries after this one.

  • :idempotency_key (String)

    Filter records to the one with the specified idempotency_key you chose for that object. This value is unique across Increase and is used to ensure that a request is only processed once. Learn more about idempotency.

  • :limit (Integer)

    Limit the size of the list that is returned. The default (and maximum) is 100 objects.

  • :routing_number (String)

    Filter External Accounts to those with the specified Routing Number.

  • :status (Status)

Returns:



84
85
86
87
88
89
90
91
92
# File 'lib/increase/resources/external_accounts.rb', line 84

def list(params = {}, opts = {})
  req = {}
  req[:method] = :get
  req[:path] = "/external_accounts"
  req[:query] = params
  req[:page] = Increase::Page
  req[:model] = Increase::Models::ExternalAccount
  @client.request(req, opts)
end

#retrieve(external_account_id, opts = {}) ⇒ Increase::Models::ExternalAccount

Retrieve an External Account

Parameters:

  • external_account_id (String)

    The identifier of the External Account.

  • opts (Hash|RequestOptions) (defaults to: {})

    Options to specify HTTP behaviour for this request.

Returns:



38
39
40
41
42
43
44
# File 'lib/increase/resources/external_accounts.rb', line 38

def retrieve(, opts = {})
  req = {}
  req[:method] = :get
  req[:path] = "/external_accounts/#{}"
  req[:model] = Increase::Models::ExternalAccount
  @client.request(req, opts)
end

#update(external_account_id, params = {}, opts = {}) ⇒ Increase::Models::ExternalAccount

Update an External Account

Parameters:

  • external_account_id (String)

    The external account identifier.

  • params (Hash) (defaults to: {})

    Attributes to send in this request.

  • opts (Hash|RequestOptions) (defaults to: {})

    Options to specify HTTP behaviour for this request.

Options Hash (params):

  • :account_holder (Symbol)

    The type of entity that owns the External Account.

  • :description (String)

    The description you choose to give the external account.

  • :funding (Symbol)

    The funding type of the External Account.

  • :status (Symbol)

    The status of the External Account.

Returns:



59
60
61
62
63
64
65
66
# File 'lib/increase/resources/external_accounts.rb', line 59

def update(, params = {}, opts = {})
  req = {}
  req[:method] = :patch
  req[:path] = "/external_accounts/#{}"
  req[:body] = params
  req[:model] = Increase::Models::ExternalAccount
  @client.request(req, opts)
end