Class: Increase::Resources::ACHTransfers

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

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ ACHTransfers

Returns a new instance of ACHTransfers.



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

def initialize(client:)
  @client = client
end

Instance Method Details

#approve(ach_transfer_id, opts = {}) ⇒ Increase::Models::ACHTransfer

Approves an ACH Transfer in a pending_approval state.

Parameters:

  • ach_transfer_id (String)

    The identifier of the ACH Transfer to approve.

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

    Options to specify HTTP behaviour for this request.

Returns:



112
113
114
115
116
117
118
# File 'lib/increase/resources/ach_transfers.rb', line 112

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

#cancel(ach_transfer_id, opts = {}) ⇒ Increase::Models::ACHTransfer

Cancels an ACH Transfer in a pending_approval state.

Parameters:

  • ach_transfer_id (String)

    The identifier of the pending ACH Transfer to cancel.

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

    Options to specify HTTP behaviour for this request.

Returns:



126
127
128
129
130
131
132
# File 'lib/increase/resources/ach_transfers.rb', line 126

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

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

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

  • :amount (Integer)

    The transfer amount in cents. A positive amount originates a credit transfer pushing funds to the receiving account. A negative amount originates a debit transfer pulling funds from the receiving account.

  • :statement_descriptor (String)

    A description you choose to give the transfer. This will be saved with the transfer details, displayed in the dashboard, and returned by the API. If individual_name and company_name are not explicitly set by this API, the statement_descriptor will be sent in those fields to the receiving bank to help the customer recognize the transfer. You are highly encouraged to pass individual_name and company_name instead of relying on this fallback.

  • :account_number (String)

    The account number for the destination account.

  • :addenda (Addenda)

    Additional information that will be sent to the recipient. This is included in the transfer data sent to the receiving bank.

  • :company_descriptive_date (String)

    The description of the date of the transfer, usually in the format YYMMDD. This is included in the transfer data sent to the receiving bank.

  • :company_discretionary_data (String)

    The data you choose to associate with the transfer. This is included in the transfer data sent to the receiving bank.

  • :company_entry_description (String)

    A description of the transfer. This is included in the transfer data sent to the receiving bank.

  • :company_name (String)

    The name by which the recipient knows you. This is included in the transfer data sent to the receiving bank.

  • :destination_account_holder (Symbol)

    The type of entity that owns the account to which the ACH Transfer is being sent.

  • :effective_date (String)

    The transfer effective date in ISO 8601 format.

  • :external_account_id (String)

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

  • :funding (Symbol)

    The type of the account to which the transfer will be sent.

  • :individual_id (String)

    Your identifier for the transfer recipient.

  • :individual_name (String)

    The name of the transfer recipient. This value is informational and not verified by the recipient's bank.

  • :preferred_effective_date (PreferredEffectiveDate)

    Configuration for how the effective date of the transfer will be set. This determines same-day vs future-dated settlement timing. If not set, defaults to a settlement_schedule of same_day. If set, exactly one of the child atributes must be set.

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

  • :standard_entry_class_code (Symbol)

    The Standard Entry Class (SEC) code to use for the transfer.

Returns:



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

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

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

List ACH 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 ACH Transfers to those that originated from the specified Account.

  • :created_at (CreatedAt)
  • :cursor (String)

    Return the page of entries after this one.

  • :external_account_id (String)

    Filter ACH 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:



96
97
98
99
100
101
102
103
104
# File 'lib/increase/resources/ach_transfers.rb', line 96

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

#retrieve(ach_transfer_id, opts = {}) ⇒ Increase::Models::ACHTransfer

Retrieve an ACH Transfer

Parameters:

  • ach_transfer_id (String)

    The identifier of the ACH Transfer.

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

    Options to specify HTTP behaviour for this request.

Returns:



71
72
73
74
75
76
77
# File 'lib/increase/resources/ach_transfers.rb', line 71

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