Class: Increase::Resources::Simulations::ACHTransfers

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

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ ACHTransfers

Returns a new instance of ACHTransfers.



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

def initialize(client:)
  @client = client
end

Instance Method Details

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

Simulates the acknowledgement of an ACH Transfer by the Federal Reserve. This transfer must first have a status of submitted . In production, the Federal Reserve generally acknowledges submitted ACH files within 30 minutes. Since sandbox ACH Transfers are not submitted to the Federal Reserve, this endpoint allows you to skip that delay and add the acknowledgment subresource to the ACH Transfer.

Parameters:

  • ach_transfer_id (String)

    The identifier of the ACH Transfer you wish to become acknowledged.

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

    Options to specify HTTP behaviour for this request.

Returns:



22
23
24
25
26
27
28
# File 'lib/increase/resources/simulations/ach_transfers.rb', line 22

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

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

Simulates receiving a Notification of Change for an ACH Transfer.

Parameters:

  • ach_transfer_id (String)

    The identifier of the ACH Transfer you wish to create a notification of change for.

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

  • :change_code (Symbol)

    The reason for the notification of change.

  • :corrected_data (String)

    The corrected data for the notification of change (e.g., a new routing number).

Returns:



43
44
45
46
47
48
49
50
# File 'lib/increase/resources/simulations/ach_transfers.rb', line 43

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

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

Simulates the return of an ACH Transfer by the Federal Reserve due to an error condition. This will also create a Transaction to account for the returned funds. This transfer must first have a status of submitted.

Parameters:

  • ach_transfer_id (String)

    The identifier of the ACH Transfer you wish to return.

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

  • :reason (Symbol)

    The reason why the Federal Reserve or destination bank returned this transfer. Defaults to no_account.

Returns:



65
66
67
68
69
70
71
72
# File 'lib/increase/resources/simulations/ach_transfers.rb', line 65

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

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

Simulates the submission of an ACH Transfer to the Federal Reserve. This transfer must first have a status of pending_approval or pending_submission. In production, Increase submits ACH Transfers to the Federal Reserve three times per day on weekdays. Since sandbox ACH Transfers are not submitted to the Federal Reserve, this endpoint allows you to skip that delay and transition the ACH Transfer to a status of submitted.

Parameters:

  • ach_transfer_id (String)

    The identifier of the ACH Transfer you wish to submit.

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

    Options to specify HTTP behaviour for this request.

Returns:



85
86
87
88
89
90
91
# File 'lib/increase/resources/simulations/ach_transfers.rb', line 85

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