ach_client 5.2.0 → 5.3.1

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: 40121de7140eb005aa1d705a2df4c32c4e0ddd9f1bf1fc47a5cfa3db4c4714a4
4
- data.tar.gz: 7668ac3bd707b921e6efa0870e0e385c35f49d67db457d2a17731df5ff9de354
3
+ metadata.gz: 740fd8fcf53c163bfcd58768478e30a1513f7cdcf693fc60d0862712ff2227b7
4
+ data.tar.gz: b25d5e4fe0967b9c6533e69f458692389d8596a781029e29e48c363728875e15
5
5
  SHA512:
6
- metadata.gz: e4e47bbf496b0730676d00352eedddf635ddf693d21dba7e0e099802bedd9c71e1da4e6696f5081cc7ce3f35bdc628ca255365e0e29731ef1c0bc7f1b79b5a9c
7
- data.tar.gz: 0bf340837047df6cd8816084258dfa1c6ae2cbaa16b9d0e82175ef8222a4490a184259564c77d6b16fdc5399a1098b7593d714b9e18f4e470c89fdf88a54f2eb
6
+ metadata.gz: 700bed0cce58c0dee3193db21e8eb90df591c59227f74fedccfe51f39a914680249d0effd267203ca660d6459b030df6060d8db502cf64799afaced16e607813
7
+ data.tar.gz: f70238be6107e48570ba6212547cbff5b24186eac2038f0b82427e0e83322f51b4620a2a5e642b75c637aedac1c2529bb56f984f91d61520e3dd525718448144
@@ -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
@@ -25,7 +25,7 @@ module AchClient
25
25
  self.transformer.find do |_, v|
26
26
  type <= v
27
27
  end.try(:first) or raise(
28
- "type must be one of #{self.transformer.values.join(', ')}"
28
+ "type must be one of #{self.transformer.values.uniq.join(', ')}"
29
29
  )
30
30
  end
31
31
 
@@ -9,7 +9,9 @@ module AchClient
9
9
  def self.transformer
10
10
  {
11
11
  'S' => AchClient::AccountTypes::Savings,
12
- 'C' => AchClient::AccountTypes::Checking
12
+ 'C' => AchClient::AccountTypes::Checking,
13
+ '3' => AchClient::AccountTypes::Savings,
14
+ '2' => AchClient::AccountTypes::Checking
13
15
  }
14
16
  end
15
17
  end
@@ -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.2.0'
3
+ VERSION = '5.3.1'
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.2.0
4
+ version: 5.3.1
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-06-05 00:00:00.000000000 Z
11
+ date: 2023-07-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ach