Class: Increase::Resources::AccountNumbers

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

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ AccountNumbers

Returns a new instance of AccountNumbers.



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

def initialize(client:)
  @client = client
end

Instance Method Details

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

Create an Account Number

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_id (String)

    The Account the Account Number should belong to.

  • :name (String)

    The name you choose for the Account Number.

  • :inbound_ach (InboundACH)

    Options related to how this Account Number should handle inbound ACH transfers.

  • :inbound_checks (InboundChecks)

    Options related to how this Account Number should handle inbound check withdrawals.

Returns:



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

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

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

List Account Numbers

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_id (String)

    Filter Account Numbers to those belonging to the specified Account.

  • :ach_debit_status (Symbol)

    The ACH Debit status to retrieve Account Numbers for.

  • :created_at (CreatedAt)
  • :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.

  • :status (Symbol)

    The status to retrieve Account Numbers for.

Returns:



86
87
88
89
90
91
92
93
94
# File 'lib/increase/resources/account_numbers.rb', line 86

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

#retrieve(account_number_id, opts = {}) ⇒ Increase::Models::AccountNumber

Retrieve an Account Number

Parameters:

  • account_number_id (String)

    The identifier of the Account Number to retrieve.

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

    Options to specify HTTP behaviour for this request.

Returns:



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

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

#update(account_number_id, params = {}, opts = {}) ⇒ Increase::Models::AccountNumber

Update an Account Number

Parameters:

  • account_number_id (String)

    The identifier of the Account Number.

  • 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):

  • :inbound_ach (InboundACH)

    Options related to how this Account Number handles inbound ACH transfers.

  • :inbound_checks (InboundChecks)

    Options related to how this Account Number should handle inbound check withdrawals.

  • :name (String)

    The name you choose for the Account Number.

  • :status (Symbol)

    This indicates if transfers can be made to the Account Number.

Returns:



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

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