Class: Increase::Resources::CheckTransfers

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

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ CheckTransfers

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

Parameters:



194
195
196
# File 'lib/increase/resources/check_transfers.rb', line 194

def initialize(client:)
  @client = client
end

Instance Method Details

#approve(check_transfer_id, request_options: {}) ⇒ Increase::Models::CheckTransfer

Approve a Check Transfer

Parameters:

  • check_transfer_id (String)

    The identifier of the Check Transfer to approve.

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

Returns:

See Also:



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

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

#cancel(check_transfer_id, request_options: {}) ⇒ Increase::Models::CheckTransfer

Cancel a Check Transfer with the pending_approval status. See Transfer Approvals for more information.

Parameters:

  • check_transfer_id (String)

    The identifier of the pending Check Transfer to cancel.

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

Returns:

See Also:



157
158
159
160
161
162
163
164
# File 'lib/increase/resources/check_transfers.rb', line 157

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

#create(account_id:, amount:, fulfillment_method:, source_account_number_id:, balance_check: nil, check_number: nil, physical_check: nil, require_approval: nil, third_party: nil, valid_until_date: nil, request_options: {}) ⇒ Increase::Models::CheckTransfer

Create a Check Transfer

Parameters:

  • account_id (String)

    The identifier for the account that will send the transfer.

  • amount (Integer)

    The transfer amount in USD cents.

  • fulfillment_method (Symbol, Increase::Models::CheckTransferCreateParams::FulfillmentMethod)

    Whether Increase will print and mail the check or if you will do it yourself.

  • source_account_number_id (String)

    The identifier of the Account Number from which to send the transfer and print on the check.

  • balance_check (Symbol, Increase::Models::CheckTransferCreateParams::BalanceCheck)

    How the account's available balance should be checked. If omitted, the default behavior is balance_check: full.

  • check_number (String)

    The check number Increase should use for the check. This should not contain leading zeroes and must be unique across the source_account_number. If this is omitted, Increase will generate a check number for you.

  • physical_check (Increase::Models::CheckTransferCreateParams::PhysicalCheck)

    Details relating to the physical check that Increase will print and mail. This is required if fulfillment_method is equal to physical_check. It must not be included if any other fulfillment_method is provided.

  • require_approval (Boolean)

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

  • third_party (Increase::Models::CheckTransferCreateParams::ThirdParty)

    Details relating to the custom fulfillment you will perform. This is required if fulfillment_method is equal to third_party. It must not be included if any other fulfillment_method is provided.

  • valid_until_date (Date)

    If provided, the check will be valid on or before this date. After this date, the check transfer will be automatically stopped and deposits will not be accepted. For checks printed by Increase, this date is included on the check as its expiry.

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

Returns:

See Also:



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

def create(params)
  parsed, options = Increase::CheckTransferCreateParams.dump_request(params)
  @client.request(
    method: :post,
    path: "check_transfers",
    body: parsed,
    model: Increase::CheckTransfer,
    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::CheckTransfer>

List Check Transfers

Parameters:

  • account_id (String)

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

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

Returns:

See Also:



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

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

#retrieve(check_transfer_id, request_options: {}) ⇒ Increase::Models::CheckTransfer

Retrieve a Check Transfer

Parameters:

  • check_transfer_id (String)

    The identifier of the Check Transfer.

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

Returns:

See Also:



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

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

#stop_payment(check_transfer_id, reason: nil, request_options: {}) ⇒ Increase::Models::CheckTransfer

Stop payment on a Check Transfer

Parameters:

Returns:

See Also:



180
181
182
183
184
185
186
187
188
189
# File 'lib/increase/resources/check_transfers.rb', line 180

def stop_payment(check_transfer_id, params = {})
  parsed, options = Increase::CheckTransferStopPaymentParams.dump_request(params)
  @client.request(
    method: :post,
    path: ["check_transfers/%1$s/stop_payment", check_transfer_id],
    body: parsed,
    model: Increase::CheckTransfer,
    options: options
  )
end