Class: Increase::Resources::AccountTransfers

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

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:



136
137
138
# File 'lib/increase/resources/account_transfers.rb', line 136

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:



104
105
106
107
108
109
110
111
# File 'lib/increase/resources/account_transfers.rb', line 104

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:



124
125
126
127
128
129
130
131
# File 'lib/increase/resources/account_transfers.rb', line 124

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

Some parameter documentations has been truncated, see Models::AccountTransferCreateParams for more details.

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

  • description (String)

    An internal-facing description for the transfer for display in the API and dashb

  • 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.

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

Returns:

See Also:



28
29
30
31
32
33
34
35
36
37
# File 'lib/increase/resources/account_transfers.rb', line 28

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>

Some parameter documentations has been truncated, see Models::AccountTransferListParams for more details.

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 tha

  • limit (Integer)

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

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

Returns:

See Also:



81
82
83
84
85
86
87
88
89
90
91
# File 'lib/increase/resources/account_transfers.rb', line 81

def list(params = {})
  parsed, options = Increase::AccountTransferListParams.dump_request(params)
  @client.request(
    method: :get,
    path: "account_transfers",
    query: parsed,
    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:



50
51
52
53
54
55
56
57
# File 'lib/increase/resources/account_transfers.rb', line 50

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