Class: Increase::Resources::WireTransfers

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

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ WireTransfers

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

Parameters:



166
167
168
# File 'lib/increase/resources/wire_transfers.rb', line 166

def initialize(client:)
  @client = client
end

Instance Method Details

#approve(wire_transfer_id, request_options: {}) ⇒ Increase::Models::WireTransfer

Approve a Wire Transfer

Parameters:

  • wire_transfer_id (String)

    The identifier of the Wire Transfer to approve.

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

Returns:

See Also:



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

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

#cancel(wire_transfer_id, request_options: {}) ⇒ Increase::Models::WireTransfer

Cancel a pending Wire Transfer

Parameters:

  • wire_transfer_id (String)

    The identifier of the pending Wire Transfer to cancel.

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

Returns:

See Also:



154
155
156
157
158
159
160
161
# File 'lib/increase/resources/wire_transfers.rb', line 154

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

#create(account_id:, amount:, creditor:, remittance:, account_number: nil, debtor: nil, external_account_id: nil, inbound_wire_drawdown_request_id: nil, require_approval: nil, routing_number: nil, source_account_number_id: nil, request_options: {}) ⇒ Increase::Models::WireTransfer

Create a Wire Transfer

Parameters:

  • account_id (String)

    The identifier for the account that will send the transfer.

  • amount (Integer)

    The transfer amount in USD cents.

  • creditor (Increase::Models::WireTransferCreateParams::Creditor)

    The person or business that is receiving the funds from the transfer.

  • remittance (Increase::Models::WireTransferCreateParams::Remittance)

    Additional remittance information related to the wire transfer.

  • account_number (String)

    The account number for the destination account.

  • debtor (Increase::Models::WireTransferCreateParams::Debtor)

    The person or business whose funds are being transferred. This is only necessary if you're transferring from a commingled account. Otherwise, we'll use the associated entity's details.

  • external_account_id (String)

    The ID of an External Account to initiate a transfer to. If this parameter is provided, account_number and routing_number must be absent.

  • inbound_wire_drawdown_request_id (String)

    The ID of an Inbound Wire Drawdown Request in response to which this transfer is being sent.

  • require_approval (Boolean)

    Whether the transfer requires explicit approval via the dashboard or API.

  • routing_number (String)

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

  • source_account_number_id (String)

    The ID of an Account Number that will be passed to the wire's recipient

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

Returns:

See Also:



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

def create(params)
  parsed, options = Increase::WireTransferCreateParams.dump_request(params)
  @client.request(
    method: :post,
    path: "wire_transfers",
    body: parsed,
    model: Increase::WireTransfer,
    options: options
  )
end

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

List Wire Transfers

Parameters:

  • account_id (String)

    Filter Wire Transfers to those belonging to the specified Account.

  • created_at (Increase::Models::WireTransferListParams::CreatedAt)
  • cursor (String)

    Return the page of entries after this one.

  • external_account_id (String)

    Filter Wire Transfers to those made to the specified External Account.

  • 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 (Increase::Models::WireTransferListParams::Status)
  • request_options (Increase::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



110
111
112
113
114
115
116
117
118
119
120
121
# File 'lib/increase/resources/wire_transfers.rb', line 110

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

#retrieve(wire_transfer_id, request_options: {}) ⇒ Increase::Models::WireTransfer

Retrieve a Wire Transfer

Parameters:

  • wire_transfer_id (String)

    The identifier of the Wire Transfer.

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

Returns:

See Also:



72
73
74
75
76
77
78
79
# File 'lib/increase/resources/wire_transfers.rb', line 72

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