Class: Increase::Resources::WireTransfers

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

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ WireTransfers

Returns a new instance of WireTransfers.



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

def initialize(client:)
  @client = client
end

Instance Method Details

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

Approve a Wire Transfer

Parameters:

  • wire_transfer_id (String)

    The identifier of the Wire Transfer to approve.

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

    Options to specify HTTP behaviour for this request.

Returns:



94
95
96
97
98
99
100
# File 'lib/increase/resources/wire_transfers.rb', line 94

def approve(wire_transfer_id, opts = {})
  req = {}
  req[:method] = :post
  req[:path] = "/wire_transfers/#{wire_transfer_id}/approve"
  req[:model] = Increase::Models::WireTransfer
  @client.request(req, opts)
end

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

Cancel a pending Wire Transfer

Parameters:

  • wire_transfer_id (String)

    The identifier of the pending Wire Transfer to cancel.

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

    Options to specify HTTP behaviour for this request.

Returns:



108
109
110
111
112
113
114
# File 'lib/increase/resources/wire_transfers.rb', line 108

def cancel(wire_transfer_id, opts = {})
  req = {}
  req[:method] = :post
  req[:path] = "/wire_transfers/#{wire_transfer_id}/cancel"
  req[:model] = Increase::Models::WireTransfer
  @client.request(req, opts)
end

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

Create a Wire Transfer

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 identifier for the account that will send the transfer.

  • :amount (Integer)

    The transfer amount in cents.

  • :beneficiary_name (String)

    The beneficiary's name.

  • :message_to_recipient (String)

    The message that will show on the recipient's bank statement.

  • :account_number (String)

    The account number for the destination account.

  • :beneficiary_address_line1 (String)

    The beneficiary's address line 1.

  • :beneficiary_address_line2 (String)

    The beneficiary's address line 2.

  • :beneficiary_address_line3 (String)

    The beneficiary's address line 3.

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

  • :originator_address_line1 (String)

    The originator's address line 1. This is only necessary if you're transferring from a commingled account. Otherwise, we'll use the associated entity's details.

  • :originator_address_line2 (String)

    The originator's address line 2. This is only necessary if you're transferring from a commingled account. Otherwise, we'll use the associated entity's details.

  • :originator_address_line3 (String)

    The originator's address line 3. This is only necessary if you're transferring from a commingled account. Otherwise, we'll use the associated entity's details.

  • :originator_name (String)

    The originator's name. This is only necessary if you're transferring from a commingled account. Otherwise, we'll use the associated entity's details.

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

Returns:



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

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

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

List Wire Transfers

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 Wire Transfers to those belonging to the specified Account.

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

Returns:



78
79
80
81
82
83
84
85
86
# File 'lib/increase/resources/wire_transfers.rb', line 78

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

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

Retrieve a Wire Transfer

Parameters:

  • wire_transfer_id (String)

    The identifier of the Wire Transfer.

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

    Options to specify HTTP behaviour for this request.

Returns:



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

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