Class: Increase::Resources::SwiftTransfers

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

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ SwiftTransfers

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

Parameters:



167
168
169
# File 'lib/increase/resources/swift_transfers.rb', line 167

def initialize(client:)
  @client = client
end

Instance Method Details

#approve(swift_transfer_id, request_options: {}) ⇒ Increase::Models::SwiftTransfer

Approve a Swift Transfer

Parameters:

  • swift_transfer_id (String)

    The identifier of the Swift Transfer to approve.

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

Returns:

See Also:



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

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

#cancel(swift_transfer_id, request_options: {}) ⇒ Increase::Models::SwiftTransfer

Cancel a pending Swift Transfer

Parameters:

  • swift_transfer_id (String)

    The identifier of the pending Swift Transfer to cancel.

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

Returns:

See Also:



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

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

#create(account_id:, account_number:, bank_identification_code:, creditor_address:, creditor_name:, debtor_address:, debtor_name:, instructed_amount:, instructed_currency:, source_account_number_id:, unstructured_remittance_information:, require_approval: nil, routing_number: nil, request_options: {}) ⇒ Increase::Models::SwiftTransfer

Create a Swift Transfer

Parameters:

  • account_id (String)

    The identifier for the account that will send the transfer.

  • account_number (String)

    The creditor's account number.

  • bank_identification_code (String)

    The bank identification code (BIC) of the creditor. If it ends with the three-character branch code, this must be 11 characters long. Otherwise this must be 8 characters and the branch code will be assumed to be XXX.

  • creditor_address (Increase::Models::SwiftTransferCreateParams::CreditorAddress)

    The creditor's address.

  • creditor_name (String)

    The creditor's name.

  • debtor_address (Increase::Models::SwiftTransferCreateParams::DebtorAddress)

    The debtor's address.

  • debtor_name (String)

    The debtor's name.

  • instructed_amount (Integer)

    The amount, in minor units of instructed_currency, to send to the creditor.

  • instructed_currency (Symbol, Increase::Models::SwiftTransferCreateParams::InstructedCurrency)

    The ISO 4217 currency code of the instructed amount.

  • source_account_number_id (String)

    The Account Number to include in the transfer as the debtor's account number.

  • unstructured_remittance_information (String)

    Unstructured remittance information to include in the transfer.

  • require_approval (Boolean)

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

  • routing_number (String)

    The creditor's bank account routing or transit number. Required in certain countries.

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

Returns:

See Also:



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

def create(params)
  parsed, options = Increase::SwiftTransferCreateParams.dump_request(params)
  @client.request(
    method: :post,
    path: "swift_transfers",
    body: parsed,
    model: Increase::SwiftTransfer,
    options: options
  )
end

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

List Swift Transfers

Parameters:

  • account_id (String)

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

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

Returns:

See Also:



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

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

#retrieve(swift_transfer_id, request_options: {}) ⇒ Increase::Models::SwiftTransfer

Retrieve a Swift Transfer

Parameters:

  • swift_transfer_id (String)

    The identifier of the Swift Transfer.

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

Returns:

See Also:



75
76
77
78
79
80
81
82
# File 'lib/increase/resources/swift_transfers.rb', line 75

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