ach_client 0.6.8 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.ruby-version +1 -1
- data/.tool-versions +1 -0
- data/ach_client.gemspec +1 -0
- data/lib/ach_client/abstract/invalid_ach_transaction_error.rb +3 -0
- data/lib/ach_client/providers/abstract/ach_batch.rb +12 -0
- data/lib/ach_client/providers/abstract/ach_transaction.rb +18 -0
- data/lib/ach_client/providers/sftp/ach_batch.rb +1 -1
- data/lib/ach_client/providers/sftp/ach_transaction.rb +1 -1
- data/lib/ach_client/providers/soap/ach_works/ach_batch.rb +1 -1
- data/lib/ach_client/providers/soap/ach_works/ach_transaction.rb +1 -1
- data/lib/ach_client/providers/soap/i_check_gateway/ach_batch.rb +1 -1
- data/lib/ach_client/providers/soap/i_check_gateway/ach_status_checker.rb +1 -1
- data/lib/ach_client/providers/soap/i_check_gateway/ach_transaction.rb +1 -1
- data/lib/ach_client/version.rb +1 -1
- metadata +19 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a4f5db8a27b5ba348d4a2b98c3219350528ba763
|
4
|
+
data.tar.gz: e067d4721f6225444a0c9d740cabe5b7bc4c2c8f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3936c72ff9eff2330f3b06d8ead56d03d5c858cbe7ab783d9840f9c4da79751bb7c8c94658551e22da0cfa7a53d2cee7449505c2ea7da52d022f5f046a8b288f
|
7
|
+
data.tar.gz: b207d8ac87d006dcb3c3aebc81107db555583ee88eab300e0c2277a7c8531d613a76316c22ee3d157202ec73f1a9b5155dfb9ee2cbf127f7b335b2b929566074
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.
|
1
|
+
2.4.2
|
data/.tool-versions
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
ruby 2.4.2
|
data/ach_client.gemspec
CHANGED
@@ -16,6 +16,18 @@ module AchClient
|
|
16
16
|
# @return [Array<String>] Identifiers to use to poll for result of batch
|
17
17
|
# processing later on.
|
18
18
|
def send_batch
|
19
|
+
if @ach_transactions.all?(&:sendable?)
|
20
|
+
do_send_batch
|
21
|
+
else
|
22
|
+
raise InvalidAchTransactionError
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
# Implementation of sending the ACH batch to the provider, to be
|
27
|
+
# implemented by the subclass
|
28
|
+
# @return [Array<String>] Identifiers to use to poll for result of batch
|
29
|
+
# processing later on.
|
30
|
+
def do_send_batch
|
19
31
|
raise AbstractMethodError
|
20
32
|
end
|
21
33
|
end
|
@@ -62,9 +62,27 @@ module AchClient
|
|
62
62
|
transaction_type == AchClient::TransactionTypes::Credit
|
63
63
|
end
|
64
64
|
|
65
|
+
# Check if the transaction is sendable, and if so, send it according
|
66
|
+
# to the subclass implementation
|
65
67
|
def send
|
68
|
+
if sendable?
|
69
|
+
do_send
|
70
|
+
else
|
71
|
+
raise InvalidAchTransactionError
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
# The implementation of sending the transaction, as implemented by the
|
76
|
+
# subclass
|
77
|
+
def do_send
|
66
78
|
raise AbstractMethodError
|
67
79
|
end
|
80
|
+
|
81
|
+
# Prevent sending of invalid transactions, such as those where the
|
82
|
+
# effective entry date is in the past
|
83
|
+
def sendable?
|
84
|
+
effective_entry_date&.future? || effective_entry_date&.today?
|
85
|
+
end
|
68
86
|
end
|
69
87
|
end
|
70
88
|
end
|
@@ -10,7 +10,7 @@ module AchClient
|
|
10
10
|
# gives us. We can use that to track the batch processing later on.
|
11
11
|
# If it fails, an exception will be thrown.
|
12
12
|
# @return [Array<String>] the external_ach_id's for each transaction
|
13
|
-
def
|
13
|
+
def do_send_batch
|
14
14
|
AchClient::AchWorks.wrap_request(
|
15
15
|
method: :send_ach_trans_batch,
|
16
16
|
message: self.to_hash,
|
@@ -18,7 +18,7 @@ module AchClient
|
|
18
18
|
|
19
19
|
# Send this transaction individually to AchWorks
|
20
20
|
# @return [String] the front end trace
|
21
|
-
def
|
21
|
+
def do_send
|
22
22
|
AchClient::AchWorks.wrap_request(
|
23
23
|
method: :send_ach_trans,
|
24
24
|
message: AchClient::AchWorks::CompanyInfo.build.to_hash.merge({
|
@@ -9,7 +9,7 @@ module AchClient
|
|
9
9
|
# Raises an exception with as much info as possible if something goes
|
10
10
|
# wrong
|
11
11
|
# @return [String] a string returned by ICheckGateway - external_ach_id
|
12
|
-
def
|
12
|
+
def do_send
|
13
13
|
# The response comes back as a | separated list of field values with
|
14
14
|
# no header field/keys. It seems that the first column will contain
|
15
15
|
# 'APPROVED' if the request was successful. The 8th column is the
|
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: 0.
|
4
|
+
version: 0.7.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: 2017-07
|
11
|
+
date: 2017-12-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ach
|
@@ -248,6 +248,20 @@ dependencies:
|
|
248
248
|
- - ">="
|
249
249
|
- !ruby/object:Gem::Version
|
250
250
|
version: '0'
|
251
|
+
- !ruby/object:Gem::Dependency
|
252
|
+
name: bundler-audit
|
253
|
+
requirement: !ruby/object:Gem::Requirement
|
254
|
+
requirements:
|
255
|
+
- - ">="
|
256
|
+
- !ruby/object:Gem::Version
|
257
|
+
version: '0'
|
258
|
+
type: :development
|
259
|
+
prerelease: false
|
260
|
+
version_requirements: !ruby/object:Gem::Requirement
|
261
|
+
requirements:
|
262
|
+
- - ">="
|
263
|
+
- !ruby/object:Gem::Version
|
264
|
+
version: '0'
|
251
265
|
description:
|
252
266
|
email:
|
253
267
|
- zach@zachcotter.com
|
@@ -259,6 +273,7 @@ files:
|
|
259
273
|
- ".gitignore"
|
260
274
|
- ".rubocop.yml"
|
261
275
|
- ".ruby-version"
|
276
|
+
- ".tool-versions"
|
262
277
|
- ".travis.yml"
|
263
278
|
- Gemfile
|
264
279
|
- README.md
|
@@ -269,6 +284,7 @@ files:
|
|
269
284
|
- config/return_codes.yml
|
270
285
|
- lib/ach_client.rb
|
271
286
|
- lib/ach_client/abstract/abstract_method_error.rb
|
287
|
+
- lib/ach_client/abstract/invalid_ach_transaction_error.rb
|
272
288
|
- lib/ach_client/helpers/dollars_to_cents.rb
|
273
289
|
- lib/ach_client/logging/log_provider_job.rb
|
274
290
|
- lib/ach_client/logging/log_providers/log_provider.rb
|
@@ -339,7 +355,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
339
355
|
version: '0'
|
340
356
|
requirements: []
|
341
357
|
rubyforge_project:
|
342
|
-
rubygems_version: 2.6.
|
358
|
+
rubygems_version: 2.6.14
|
343
359
|
signing_key:
|
344
360
|
specification_version: 4
|
345
361
|
summary: Adapter to interact with various ACH service providers
|