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 +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +6 -0
- data/lib/ach_client/providers/soap/fake/ach_status_checker.rb +42 -0
- data/lib/ach_client/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8e40c40c7ee42a6264c64f512772b254fac48b70cb7bb323ba238594c3d2d50c
|
4
|
+
data.tar.gz: a6d925e6f0a9682e085de0f1d12240c827cf769d521ee66fabe7001ade43fd64
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 86303a731c6e1c4de5f4a82fa8a12f2f9f955e3ef70601c423d907282b50e2e5992a762f4736223bab87672b28a86b566fa112c55c0e9a0f7fd2c9c819dbc6c3
|
7
|
+
data.tar.gz: 71299fac7355cd6b0a48e0245e8aa19e01f809f4acdcc00f97afda028c0f18dc0bb8792fabd5b242c6e590317f83385cef7e434fac395d3ad3ac8371897a1cc4
|
data/CHANGELOG.md
CHANGED
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
|
data/lib/ach_client/version.rb
CHANGED
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.
|
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-
|
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
|