ach_client 3.1.0 → 5.0.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d140b0751adee4c2f924f737d9533bf084656ff330e6ebd2f764cede1cac4bf7
4
- data.tar.gz: 91340a5b05226ad8e2f1eeeeac110415187a7bb7341c45d155720e143e93b165
3
+ metadata.gz: 3448884b23a8ca502b1506b354632c449c3f1436aa80398dccc280887abd1f49
4
+ data.tar.gz: ac997cdf2dc1a57e0c65e603e0f337a1e5c85ade85fdd4cf6915fad7ea31e729
5
5
  SHA512:
6
- metadata.gz: 4affcfdf1085e60c06bf45916cea073f02b83e70bcae42e6e0f4ba9b774aa7695c82676344a2de91a4e0b294663aad91af3cbd055a34b9012f009e2775fcaecf
7
- data.tar.gz: 2d9dc7b4c4f4ec66665e8cb74b646d8f21606adab21058c44a74b5451926f1e98cf4a8bf40f905167bfa8f9e388ce7aec2e18d163ee8cffd26e00c3227e3c259
6
+ metadata.gz: e7c7c0ca64f40107ab389e5fcb92bdcd841054a32f29b636a71f9b4e3db47ea291899664d4c102afd6ff7bae2e31850a3353e875022232e98c6e838deb30a551
7
+ data.tar.gz: 9c1f70ab5fa6691e8ec6f998dd5bf38f023ac880648a9cc5ee2169d870f75af82fe8d5103ee2104605e7dfef6f76464526c6512c84761b09787d0a37a5a25682
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.6.8
1
+ 3.1.3
data/.tool-versions CHANGED
@@ -1 +1 @@
1
- ruby 2.6.8
1
+ ruby 3.1.3
data/README.md CHANGED
@@ -70,7 +70,7 @@ AchClient::Provider::AchTransaction.new(
70
70
  # The merchant's account type (see account types note above)
71
71
  account_type: AchClient::AccountTypes::BusinessChecking,
72
72
  # The amount of the ACH transaction, should be positive
73
- amount: BigDecimal.new('575.45'),
73
+ amount: BigDecimal('575.45'),
74
74
  # The date on which you would like the transaction to take effect.
75
75
  # Beware that some providers may use this field to charge you extra for
76
76
  # same-day ACH ( a recent feature for ACH providers )
data/ach_client.gemspec CHANGED
@@ -28,20 +28,22 @@ Gem::Specification.new do |spec|
28
28
  'config'
29
29
  ]
30
30
 
31
+ #spec.required_ruby_version = '>= 2.7.0'
32
+
31
33
  # NACHA library
32
34
  spec.add_dependency 'ach', '~> 0'
33
35
 
34
36
  # Handy ruby behavior from rails
35
- spec.add_dependency 'activesupport', '< 6' # Need to rename .parent to .module_parent before upgrade
37
+ spec.add_dependency 'activesupport', '>= 6.0'
36
38
 
37
39
  # SFTP client (for Bank providers)
38
40
  spec.add_dependency 'net-sftp'
39
41
 
40
42
  # SOAP client (for AchWorks and ICheckGateway clients)
41
- spec.add_dependency 'savon', '~> 2'
43
+ spec.add_dependency 'savon', '~> 2.12.0'
42
44
 
43
45
  # Asynchronocity w/out extra infrastucture dependency (database/redis)
44
- spec.add_dependency 'sucker_punch', '~> 2'
46
+ spec.add_dependency 'sucker_punch', '~> 3'
45
47
 
46
48
  spec.add_development_dependency 'codeclimate-test-reporter'
47
49
  spec.add_development_dependency 'minitest-reporters'
@@ -11,7 +11,14 @@ module AchClient
11
11
  # @param globals [Savon::GlobalOptions] Savon's global options
12
12
  # @param locals [Savon::LocalOptions] Savon's global options
13
13
  # @return [NilClass] returns nothing so the request is not mutated
14
- def notify(operation_name, builder, _globals, _locals)
14
+ def notify(operation_name, builder, globals, _locals)
15
+ # Since Savon only lets us register observers globally this method is called by any other Savon clients outside
16
+ # this library. We don't want to log for those other clients so we check to see that the request came from
17
+ # AchClient by comparing the wsdl to our known wsdls
18
+ return unless [
19
+ AchClient::ICheckGateway.wsdl,
20
+ AchClient::AchWorks.wsdl
21
+ ].include?(globals.instance_variable_get(:@options)[:wsdl])
15
22
  # Send the xml body to the logger job
16
23
  AchClient::Logging::LogProviderJob.perform_async(
17
24
  body: builder.to_s,
@@ -17,11 +17,10 @@ module AchClient
17
17
  end
18
18
 
19
19
  private_class_method def self.build_from_config(args)
20
- self.new(
21
- args.map do |arg|
20
+ args_hash = args.map do |arg|
22
21
  {arg => self.to_s.deconstantize.constantize.send(arg)}
23
22
  end.reduce(&:merge)
24
- )
23
+ self.new(**args_hash)
25
24
  end
26
25
  end
27
26
  end
@@ -12,15 +12,15 @@ module AchClient
12
12
  # The filename used for the batch
13
13
  # @return [String] filename to use
14
14
  def batch_file_name
15
- self.class.parent.file_naming_strategy.(@batch_number)
15
+ self.class.module_parent.file_naming_strategy.(@batch_number)
16
16
  end
17
17
 
18
18
  # Sends the batch to SFTP provider
19
19
  # @return [Array<String>]
20
20
  def do_send_batch
21
- self.class.parent.write_remote_file(
21
+ self.class.module_parent.write_remote_file(
22
22
  file_path: File.join(
23
- self.class.parent.outgoing_path,
23
+ self.class.module_parent.outgoing_path,
24
24
  batch_file_name
25
25
  ),
26
26
  file_body: cook_some_nachas.to_s
@@ -65,7 +65,7 @@ module AchClient
65
65
  :immediate_origin_name,
66
66
  :transmission_datetime
67
67
  ].each do |attribute|
68
- file_header.send("#{attribute}=", self.class.parent.send(attribute))
68
+ file_header.send("#{attribute}=", self.class.module_parent.send(attribute))
69
69
  end
70
70
  file_header
71
71
  end
@@ -80,14 +80,14 @@ module AchClient
80
80
  batch_header = batch.header
81
81
  batch_header.company_name = originator_name
82
82
  batch_header.company_identification =
83
- self.class.parent.company_identification
83
+ self.class.module_parent.company_identification
84
84
  batch_header.standard_entry_class_code = sec_code
85
85
  batch_header.company_entry_description =
86
- self.class.parent.company_entry_description
86
+ self.class.module_parent.company_entry_description
87
87
  batch_header.company_descriptive_date = effective_entry_date
88
88
  batch_header.effective_entry_date = effective_entry_date
89
89
  batch_header.originating_dfi_identification =
90
- self.class.parent.originating_dfi_identification
90
+ self.class.module_parent.originating_dfi_identification
91
91
  transactions.each do |transaction|
92
92
  batch.entries << transaction.to_entry_detail
93
93
  end
@@ -22,7 +22,7 @@ module AchClient
22
22
  # values
23
23
  def self.in_range(start_date:, end_date:)
24
24
  in_range = {}
25
- self.parent.with_sftp_connection do |connection|
25
+ self.module_parent.with_sftp_connection do |connection|
26
26
  in_range = process_files(
27
27
  files_in_range(
28
28
  connection: connection,
@@ -92,7 +92,7 @@ module AchClient
92
92
  end
93
93
 
94
94
  private_class_method def self.inbox_path_to(filename)
95
- "#{self.parent.incoming_path}/#{filename}"
95
+ "#{self.module_parent.incoming_path}/#{filename}"
96
96
  end
97
97
 
98
98
  private_class_method def self.files_in_range(
@@ -101,7 +101,7 @@ module AchClient
101
101
  end_date: nil
102
102
  )
103
103
  # Get info on all files - equivalent to `ls`
104
- connection.dir.entries(self.parent.incoming_path)
104
+ connection.dir.entries(self.module_parent.incoming_path)
105
105
  .select do |file|
106
106
  last_modified_time = Time.at(file.attributes.mtime) - 1.minute
107
107
  # Filter to files modified in date range
@@ -148,7 +148,7 @@ module AchClient
148
148
 
149
149
  private_class_method def self.most_recent_files
150
150
  files = []
151
- self.parent.with_sftp_connection do |connection|
151
+ self.module_parent.with_sftp_connection do |connection|
152
152
  files = files_in_range(
153
153
  connection: connection,
154
154
  start_date: last_most_recent_check_date(connection: connection)
@@ -20,7 +20,7 @@ module AchClient
20
20
  entry.individual_id_number = remove_newlines(external_ach_id) # Doesn't need to be a number
21
21
  entry.individual_name = remove_newlines(merchant_name)
22
22
  entry.originating_dfi_identification = remove_newlines(
23
- self.class.parent.originating_dfi_identification
23
+ self.class.module_parent.originating_dfi_identification
24
24
  )
25
25
  entry.trace_number = remove_non_digits(external_ach_id).to_i # Must be number
26
26
  entry
@@ -30,7 +30,7 @@ module AchClient
30
30
  # @return [AchClient::ProcessingAchResponse] processing response
31
31
  def self.process_1SNT(record)
32
32
  AchClient::ProcessingAchResponse.new(
33
- amount: BigDecimal.new(record[:trans_amount]),
33
+ amount: BigDecimal(record[:trans_amount]),
34
34
  date: record[:action_date]
35
35
  )
36
36
  end
@@ -40,7 +40,7 @@ module AchClient
40
40
  # @return [AchClient::SettledAchResponse] settled response
41
41
  def self.process_2STL(record)
42
42
  AchClient::SettledAchResponse.new(
43
- amount: BigDecimal.new(record[:trans_amount]),
43
+ amount: BigDecimal(record[:trans_amount]),
44
44
  date: record[:action_date]
45
45
  )
46
46
  end
@@ -51,7 +51,7 @@ module AchClient
51
51
  # @return [AchClient::ReturnedAchResponse] returned response
52
52
  def self.process_3RET(record)
53
53
  AchClient::ReturnedAchResponse.new(
54
- amount: BigDecimal.new(record[:trans_amount]),
54
+ amount: BigDecimal(record[:trans_amount]),
55
55
  date: record[:action_date],
56
56
  return_code: AchClient::ReturnCodes.find_by(
57
57
  code: record[:action_detail][0..2]
@@ -75,7 +75,7 @@ module AchClient
75
75
  # @return [AchClient::CorrectedAchResponse] corrected response
76
76
  def self.process_5COR(record)
77
77
  AchClient::CorrectedAchResponse.new(
78
- amount: BigDecimal.new(record[:trans_amount]),
78
+ amount: BigDecimal(record[:trans_amount]),
79
79
  date: record[:action_date],
80
80
  return_code: AchClient::ReturnCodes.find_by(
81
81
  code: record[:action_detail][0..2]
@@ -1,4 +1,4 @@
1
1
  module AchClient
2
2
  # Increment this when changes are published
3
- VERSION = '3.1.0'
3
+ VERSION = '5.0.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: 3.1.0
4
+ version: 5.0.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: 2022-11-14 00:00:00.000000000 Z
11
+ date: 2023-05-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ach
@@ -28,16 +28,16 @@ dependencies:
28
28
  name: activesupport
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "<"
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: '6'
33
+ version: '6.0'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "<"
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: '6'
40
+ version: '6.0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: net-sftp
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -58,28 +58,28 @@ dependencies:
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '2'
61
+ version: 2.12.0
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '2'
68
+ version: 2.12.0
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: sucker_punch
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: '2'
75
+ version: '3'
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: '2'
82
+ version: '3'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: codeclimate-test-reporter
85
85
  requirement: !ruby/object:Gem::Requirement
@@ -258,7 +258,6 @@ files:
258
258
  - ".codeclimate.yml"
259
259
  - ".github/CODEOWNERS"
260
260
  - ".gitignore"
261
- - ".rubocop.yml"
262
261
  - ".ruby-version"
263
262
  - ".tool-versions"
264
263
  - ".tool-versions-e"
@@ -349,7 +348,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
349
348
  - !ruby/object:Gem::Version
350
349
  version: '0'
351
350
  requirements: []
352
- rubygems_version: 3.0.3.1
351
+ rubygems_version: 3.3.26
353
352
  signing_key:
354
353
  specification_version: 4
355
354
  summary: Adapter to interact with various ACH service providers