ach_client 2.0.0 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bdcfddb63a2f873af45df29f8fcf6765ec99aff800eb04e8ec2b7500f0827e3c
4
- data.tar.gz: 3bfa32675ec76f4e31b830b3616cc913b13f865c2c789394d49cc07758e93b89
3
+ metadata.gz: 8e40c40c7ee42a6264c64f512772b254fac48b70cb7bb323ba238594c3d2d50c
4
+ data.tar.gz: a6d925e6f0a9682e085de0f1d12240c827cf769d521ee66fabe7001ade43fd64
5
5
  SHA512:
6
- metadata.gz: 25670e16c050eb8248d80f22ffeea4a649cef6f624828118e32c866b7b7e0b0e19f0735150b7b636e5cb88dafc7d57fe7a2ac3225b8c507100b42a3a9fba668e
7
- data.tar.gz: ed197b466da4182a732f463b7c51f4a0bd24fdfbfa58755bd058d2f830790719e5f6d6c600abf480e045430e186c962f331ee0a7e17534546d93f7ed44cc8819
6
+ metadata.gz: 86303a731c6e1c4de5f4a82fa8a12f2f9f955e3ef70601c423d907282b50e2e5992a762f4736223bab87672b28a86b566fa112c55c0e9a0f7fd2c9c819dbc6c3
7
+ data.tar.gz: 71299fac7355cd6b0a48e0245e8aa19e01f809f4acdcc00f97afda028c0f18dc0bb8792fabd5b242c6e590317f83385cef7e434fac395d3ad3ac8371897a1cc4
@@ -1,3 +1,7 @@
1
+ ### 2.1.0
2
+
3
+ * Add AchClient::Fake::AchStatusChecker to facilitate response poller testing
4
+
1
5
  ### 2.0.0
2
6
 
3
7
  * Add new AchClient::ICheckGateway::InstantRejectionError to handle API errors raised by ICheckGateway in situations
data/README.md CHANGED
@@ -197,6 +197,12 @@ information has changed. Check the return code on the response object for
197
197
  details on what happened. Check the corrections hash on the response object for
198
198
  the new attributes
199
199
 
200
+ ### Testing
201
+
202
+ The fake ACH provider namespace provides a status checker `AchClient::Fake::AchStatusChecker` that always returns the
203
+ same responses. The external_ach_id for each response will be one of
204
+ `['processing', 'settled', 'returned', 'corrected', 'late_returned']`
205
+
200
206
  ## Logging
201
207
 
202
208
  For record keeping purposes, there is a log provider that allows you to hook
@@ -0,0 +1,42 @@
1
+ module AchClient
2
+ class Fake
3
+ # Fake ACH polling that always returns the same set of results.
4
+ class AchStatusChecker < Abstract::AchStatusChecker
5
+
6
+ def self.most_recent
7
+ in_range(start_date: Date.today - 3.days, end_date: Date.today)
8
+ end
9
+
10
+ def self.in_range(start_date:, end_date:)
11
+ {
12
+ 'processing' => [AchClient::ProcessingAchResponse.new(amount: 100.0, date: start_date)],
13
+ 'settled' => [AchClient::SettledAchResponse.new(amount: 100.0, date: start_date)],
14
+ 'returned' => [
15
+ AchClient::ReturnedAchResponse.new(
16
+ amount: 100.0,
17
+ date: start_date,
18
+ return_code: AchClient::ReturnCodes.find_by(code: 'R01')
19
+ )
20
+ ],
21
+ 'corrected' => [
22
+ AchClient::CorrectedAchResponse.new(
23
+ amount: 100.0,
24
+ date: start_date,
25
+ return_code: AchClient::ReturnCodes.find_by(code: 'XZ2'),
26
+ corrections: '123456789'
27
+ )
28
+ ],
29
+ 'late_returned' => [
30
+ AchClient::SettledAchResponse.new(amount: 100.0, date: start_date),
31
+ AchClient::ReturnedAchResponse.new(
32
+ amount: 100.0,
33
+ date: end_date,
34
+ return_code: AchClient::ReturnCodes.find_by(code: 'R08')
35
+ )
36
+ ]
37
+ }
38
+ end
39
+
40
+ end
41
+ end
42
+ end
@@ -1,4 +1,4 @@
1
1
  module AchClient
2
2
  # Increment this when changes are published
3
- VERSION = '2.0.0'
3
+ VERSION = '2.1.0'
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ach_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Zach Cotter
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-05-12 00:00:00.000000000 Z
11
+ date: 2020-06-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ach
@@ -314,6 +314,7 @@ files:
314
314
  - lib/ach_client/providers/soap/ach_works/response_record_processor.rb
315
315
  - lib/ach_client/providers/soap/ach_works/transaction_type_transformer.rb
316
316
  - lib/ach_client/providers/soap/fake/ach_batch.rb
317
+ - lib/ach_client/providers/soap/fake/ach_status_checker.rb
317
318
  - lib/ach_client/providers/soap/fake/ach_transaction.rb
318
319
  - lib/ach_client/providers/soap/fake/fake.rb
319
320
  - lib/ach_client/providers/soap/i_check_gateway/account_type_transformer.rb