Class: Increase::Resources::SwiftTransfers

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

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:



155
156
157
# File 'lib/increase/resources/swift_transfers.rb', line 155

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:



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

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:



143
144
145
146
147
148
149
150
# File 'lib/increase/resources/swift_transfers.rb', line 143

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

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

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-ch

  • 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](en.wikipedia.org/wiki/ISO_4217) currency code of the inst

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

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

Returns:

See Also:



44
45
46
47
48
49
50
51
52
53
# File 'lib/increase/resources/swift_transfers.rb', line 44

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>

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

List Swift Transfers

Parameters:

Returns:

See Also:



99
100
101
102
103
104
105
106
107
108
109
110
# File 'lib/increase/resources/swift_transfers.rb', line 99

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:



66
67
68
69
70
71
72
73
# File 'lib/increase/resources/swift_transfers.rb', line 66

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