Class: Increase::Resources::AccountTransfers

Inherits:
Object
  • Object
show all
Defined in:
lib/increase/resources/account_transfers.rb,
sig/increase/resources/account_transfers.rbs

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ AccountTransfers

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of AccountTransfers.

Parameters:



145
146
147
# File 'lib/increase/resources/account_transfers.rb', line 145

def initialize(client:)
  @client = client
end

Instance Method Details

#approve(account_transfer_id, request_options: {}) ⇒ Increase::Models::AccountTransfer

Approves an Account Transfer in status pending_approval.

Parameters:

  • account_transfer_id (String)

    The identifier of the Account Transfer to approve.

  • request_options (Increase::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



113
114
115
116
117
118
119
120
# File 'lib/increase/resources/account_transfers.rb', line 113

def approve(, params = {})
  @client.request(
    method: :post,
    path: ["account_transfers/%1$s/approve", ],
    model: Increase::AccountTransfer,
    options: params[:request_options]
  )
end

#cancel(account_transfer_id, request_options: {}) ⇒ Increase::Models::AccountTransfer

Cancels an Account Transfer in status pending_approval.

Parameters:

  • account_transfer_id (String)

    The identifier of the pending Account Transfer to cancel.

  • request_options (Increase::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



133
134
135
136
137
138
139
140
# File 'lib/increase/resources/account_transfers.rb', line 133

def cancel(, params = {})
  @client.request(
    method: :post,
    path: ["account_transfers/%1$s/cancel", ],
    model: Increase::AccountTransfer,
    options: params[:request_options]
  )
end

#create(account_id:, amount:, description:, destination_account_id:, require_approval: nil, request_options: {}) ⇒ Increase::Models::AccountTransfer

Create an Account Transfer

Parameters:

  • account_id (String)

    The identifier for the originating Account that will send the transfer.

  • amount (Integer)

    The transfer amount in the minor unit of the account currency. For dollars, for example, this is cents.

  • description (String)

    An internal-facing description for the transfer for display in the API and dashboard. This will also show in the description of the created Transactions.

  • destination_account_id (String)

    The identifier for the destination Account that will receive the transfer.

  • require_approval (Boolean)

    Whether the transfer should require explicit approval via the dashboard or API. For more information, see Transfer Approvals.

  • request_options (Increase::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



33
34
35
36
37
38
39
40
41
42
# File 'lib/increase/resources/account_transfers.rb', line 33

def create(params)
  parsed, options = Increase::AccountTransferCreateParams.dump_request(params)
  @client.request(
    method: :post,
    path: "account_transfers",
    body: parsed,
    model: Increase::AccountTransfer,
    options: options
  )
end

#list(account_id: nil, created_at: nil, cursor: nil, idempotency_key: nil, limit: nil, request_options: {}) ⇒ Increase::Internal::Page<Increase::Models::AccountTransfer>

List Account Transfers

Parameters:

  • account_id (String)

    Filter Account Transfers to those that originated from the specified Account.

  • created_at (Increase::Models::AccountTransferListParams::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.

  • request_options (Increase::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



89
90
91
92
93
94
95
96
97
98
99
100
# File 'lib/increase/resources/account_transfers.rb', line 89

def list(params = {})
  parsed, options = Increase::AccountTransferListParams.dump_request(params)
  query = Increase::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: "account_transfers",
    query: query,
    page: Increase::Internal::Page,
    model: Increase::AccountTransfer,
    options: options
  )
end

#retrieve(account_transfer_id, request_options: {}) ⇒ Increase::Models::AccountTransfer

Retrieve an Account Transfer

Parameters:

  • account_transfer_id (String)

    The identifier of the Account Transfer.

  • request_options (Increase::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



55
56
57
58
59
60
61
62
# File 'lib/increase/resources/account_transfers.rb', line 55

def retrieve(, params = {})
  @client.request(
    method: :get,
    path: ["account_transfers/%1$s", ],
    model: Increase::AccountTransfer,
    options: params[:request_options]
  )
end