Class: AchClient::AchWorks::AchStatusChecker

Inherits:
AchClient::Abstract::AchStatusChecker show all
Defined in:
lib/ach_client/providers/soap/ach_works/ach_status_checker.rb

Overview

Poll AchWorks for status of processed or processing Ach transactions.

Class Method Summary collapse

Class Method Details

.in_range(start_date:, end_date:) ⇒ Hash{String => AchClient::AchResponse}

Gets the status of ach transactions between the given dates Sometimes AchWorks will modify the end date… Wraps: tstsvr.achworks.com/dnet/achws.asmx?op=GetACHReturnsHist BEWARE OF LARGE DATE RANGES: AchWorks doesn’t appear to cache or even paginate their responses, so if your range has too many responses, something will probably break.

Parameters:

  • start_date (String)

    lower bound of date ranged status query

  • end_date (String)

    upper bound of date ranged status query

Returns:

  • (Hash{String => AchClient::AchResponse})

    Hash with FrontEndTrace values as keys, AchResponse objects as values



31
32
33
34
35
36
# File 'lib/ach_client/providers/soap/ach_works/ach_status_checker.rb', line 31

def self.in_range(start_date:, end_date:)
  request_and_process_response(
    method: :get_ach_returns_hist,
    message: in_range_hash(start_date: start_date, end_date: end_date)
  )
end

.most_recentHash{String => AchClient::AchResponse}

Gets the most recent “unread” ach statuses from AchWorks. NOT IDEMPOTENT - Once this method is called (successfully or unsuccessfully), AchWorks will never return the same Ach transactions here again. Wraps: tstsvr.achworks.com/dnet/achws.asmx?op=GetACHReturns

Returns:

  • (Hash{String => AchClient::AchResponse})

    Hash with FrontEndTrace values as keys, AchResponse objects as values



13
14
15
16
17
18
# File 'lib/ach_client/providers/soap/ach_works/ach_status_checker.rb', line 13

def self.most_recent
  request_and_process_response(
    method: :get_ach_returns,
    message: most_recent_hash
  )
end