ach_client 5.1.0 → 5.3.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: 4ac231ba9ffc671271670a03605f2d384873d67dfaeec720c19a8722d59ffa7e
4
- data.tar.gz: 1c0ba97879f842990452c1c234ed7a18f177f410a0d44f9f4703fc1497dc8cc1
3
+ metadata.gz: f0c6e8de15bdf5d69e152454ab5d58fb30ca39e2e1a9e7aeacfdc7ec7af683cf
4
+ data.tar.gz: 617d7adefc31e9297963d191c0976fab619bcfcaa697abafe3062ca687b4f7a0
5
5
  SHA512:
6
- metadata.gz: d9001617eb7f7d21fa205f280cbc38818b697cebdef9d3870ebab2184cdde266c4778b9b928166cedecdfa631a7c0214032967cc656c73f4014b68e16fc9b611
7
- data.tar.gz: e6dc9cd8c136bf24393b1829556e312d73d829c586786a771726956d5eb65218eb8d9aae1e46790c947a72c34643389cd8514218a4b00ca519e884644fd00e2c
6
+ metadata.gz: 7f7ab91c3fcc6a7c19f741677768ca26fbdae0f727105ebb9dbecabc005e990c425bec9bda12777594397bc7745b0cb0a0e6c1f6c783c49a0c6c166c065695cc
7
+ data.tar.gz: 381f5b25afece2d14d6aff80757e4324bfe16139f8fb38ae30f61038e165ef0b92fdb695e7865e9031a7cab634161b0a81bf2a64ab912ad05f647624ec6082c4
@@ -12,6 +12,15 @@ module AchClient
12
12
  end
13
13
  end
14
14
  end
15
+
16
+ def self.icheck_date_format(date_string)
17
+ return unless date_string
18
+ begin
19
+ Date.strptime(date_string, "%m/%d/%Y")
20
+ rescue Date::Error
21
+ return date_string
22
+ end
23
+ end
15
24
  end
16
25
  end
17
- end
26
+ end
@@ -21,6 +21,14 @@ module AchClient
21
21
  end
22
22
  end
23
23
 
24
+ def self.unauthorized
25
+ self.all.select(&:unauthorized_return?)
26
+ end
27
+
28
+ def self.administrative
29
+ self.all.select(&:administrative_return?)
30
+ end
31
+
24
32
  # Finds the first ReturnCode with the given code, or raises an exception.
25
33
  # @param [String] 3 char code identifier for a return code
26
34
  # @param [AchClient::ReturnCode] The ReturnCode object with that code
@@ -28,13 +28,13 @@ module AchClient
28
28
  # N - no, it hasn't settled yet
29
29
  AchClient::ProcessingAchResponse.new(
30
30
  amount: record[AMOUNT_COLUMN],
31
- date: record[DATE_COLUMN]
31
+ date: Helpers::Utils.icheck_date_format(record[DATE_COLUMN])
32
32
  )
33
33
  when 'Y'
34
34
  # Y - yes, it has settled
35
35
  AchClient::SettledAchResponse.new(
36
36
  amount: record[AMOUNT_COLUMN],
37
- date: record[DATE_COLUMN]
37
+ date: Helpers::Utils.icheck_date_format(record[DATE_COLUMN])
38
38
  )
39
39
  else
40
40
  # If it starts with R, it is probably a return, in which case the
@@ -44,7 +44,7 @@ module AchClient
44
44
  if record[1].start_with?('R')
45
45
  AchClient::ReturnedAchResponse.new(
46
46
  amount: record[AMOUNT_COLUMN],
47
- date: record[DATE_COLUMN],
47
+ date: Helpers::Utils.icheck_date_format(record[DATE_COLUMN]),
48
48
  return_code: AchClient::ReturnCodes.find_by(
49
49
  code: record[STATUS_COLUMN][RETURN_CODE_INDEX]
50
50
  )
@@ -1,4 +1,4 @@
1
1
  module AchClient
2
2
  # Increment this when changes are published
3
- VERSION = '5.1.0'
3
+ VERSION = '5.3.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: 5.1.0
4
+ version: 5.3.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: 2023-05-18 00:00:00.000000000 Z
11
+ date: 2023-06-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ach