headache 0.1.0 → 0.1.1
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/README.md +5 -2
- data/lib/headache/batch.rb +1 -1
- data/lib/headache/definition/batch_control.rb +10 -10
- data/lib/headache/definition/batch_header.rb +12 -12
- data/lib/headache/definition/entry.rb +10 -10
- data/lib/headache/definition/file_control.rb +1 -1
- data/lib/headache/definition/file_header.rb +13 -13
- data/lib/headache/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 38197db347ba22937f9bd2ac2c4ec0f08a7b1912
|
4
|
+
data.tar.gz: 81698a7ed860a42987faaf609cef7fff299e3b67
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 724993f4ab4e3bd4421d83b59c7d467be8ea86161efb4c464ee35317959de419c9edd239a6634b436fb8cfa7b067a54fae32f17110ab5ee9148ebd7665e5a2f0
|
7
|
+
data.tar.gz: 7332c63174ef2162947174fd5455d6f2e2f3837a02d1989a22fd8507b24bd9cef312961649aadd9e5c1306f8f2790b9a83eca254cee0edda368199237bae821c
|
data/README.md
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
# HeadACHe
|
2
2
|
|
3
|
+
[](https://codeclimate.com/github/teampayoff/headache)
|
4
|
+
|
3
5
|
Headache takes a lot of the guesswork out of building [ACH (Automated Clearing House)](https://en.wikipedia.org/wiki/Automated_Clearing_House) files to move money around between banks.
|
4
6
|
|
5
7
|
Headache is built on top of the excellent [Fixy gem](https://github.com/Chetane/fixy) for handling fixed-width files.
|
@@ -49,7 +51,7 @@ Further, Headache abstracts an ACH record _definition_ from the record itself; s
|
|
49
51
|
Create a new ACH document (some optional fields are omitted in this example):
|
50
52
|
|
51
53
|
```ruby
|
52
|
-
|
54
|
+
ach_doc = Headache::Document.new.tap do |document|
|
53
55
|
document.header.tap do |file_header|
|
54
56
|
file_header.destination_name = '1ST INTERNET BANK'
|
55
57
|
file_header.destination = '111111111' # Originating DFI number
|
@@ -57,6 +59,7 @@ document = Headache::Document.new.tap do |document|
|
|
57
59
|
file_header.origin = '1111111111'
|
58
60
|
file_header.reference_code = '11111111'
|
59
61
|
end
|
62
|
+
|
60
63
|
document.batch.tap do |batch|
|
61
64
|
batch.type = :debit
|
62
65
|
batch.odfi_id = '11111111'
|
@@ -87,7 +90,7 @@ end
|
|
87
90
|
Finally, you can generate the file:
|
88
91
|
|
89
92
|
```ruby
|
90
|
-
|
93
|
+
ach_doc.generate_to_file 'ACH.txt'
|
91
94
|
```
|
92
95
|
|
93
96
|
## Development
|
data/lib/headache/batch.rb
CHANGED
@@ -64,7 +64,7 @@ module Headache
|
|
64
64
|
end
|
65
65
|
|
66
66
|
def <<(entry_or_entries)
|
67
|
-
(entries.is_a?(Array) ? entry_or_entries : [entry_or_entries]).each { |e| add_entry e }
|
67
|
+
[(entries.is_a?(Array) ? entry_or_entries : [entry_or_entries])].flatten.each { |e| add_entry e }
|
68
68
|
self
|
69
69
|
end
|
70
70
|
|
@@ -6,16 +6,16 @@ module Headache
|
|
6
6
|
included do
|
7
7
|
include Common
|
8
8
|
|
9
|
-
field :service_code, 3,
|
10
|
-
field :entry_count, 6,
|
11
|
-
field :entry_hash, 10, '11-20', :numeric
|
12
|
-
field :total_debit, 12, '21-32', :numeric
|
13
|
-
field :total_credit, 12, '33-44', :numeric
|
14
|
-
field :company_identification, 10, '45-54', :alphanumeric
|
15
|
-
field :message_authentication_code, 19, '55-73', :nothing
|
16
|
-
field :reserved, 6, '74-79', :nothing
|
17
|
-
field :odfi_id, 8, '80-87', :alphanumeric
|
18
|
-
field :batch_number, 7, '88-94', :numeric
|
9
|
+
field :service_code, 3, '2-4', :alphanumeric
|
10
|
+
field :entry_count, 6, '5-10', :numeric
|
11
|
+
field :entry_hash, 10, '11-20', :numeric
|
12
|
+
field :total_debit, 12, '21-32', :numeric
|
13
|
+
field :total_credit, 12, '33-44', :numeric
|
14
|
+
field :company_identification, 10, '45-54', :alphanumeric
|
15
|
+
field :message_authentication_code, 19, '55-73', :nothing
|
16
|
+
field :reserved, 6, '74-79', :nothing
|
17
|
+
field :odfi_id, 8, '80-87', :alphanumeric
|
18
|
+
field :batch_number, 7, '88-94', :numeric
|
19
19
|
|
20
20
|
field_value :message_authentication_code, ''
|
21
21
|
field_value :reserved, ''
|
@@ -6,18 +6,18 @@ module Headache
|
|
6
6
|
included do
|
7
7
|
include Common
|
8
8
|
|
9
|
-
field :service_code, 3, '2-4', :alphanumeric
|
10
|
-
field :company_name, 16, '5-20', :alphanumeric
|
11
|
-
field :discretionary, 20, '21-40', :alphanumeric
|
12
|
-
field :company_identification, 10, '41-50', :alphanumeric
|
13
|
-
field :entry_class_code, 3, '51-53', :alphanumeric
|
14
|
-
field :entry_description, 10, '54-63', :alphanumeric
|
15
|
-
field :descriptive_date, 6, '64-69', :nothing
|
16
|
-
field :effective_date, 6, '70-75', :date
|
17
|
-
field :settlement_date, 3, '76-78', :nothing
|
18
|
-
field :originator_status_code, 1, '79-79', :alphanumeric
|
19
|
-
field :odfi_id, 8, '80-87', :alphanumeric
|
20
|
-
field :batch_number, 7, '88-94', :alphanumeric
|
9
|
+
field :service_code, 3, '2-4', :alphanumeric
|
10
|
+
field :company_name, 16, '5-20', :alphanumeric
|
11
|
+
field :discretionary, 20, '21-40', :alphanumeric
|
12
|
+
field :company_identification, 10, '41-50', :alphanumeric
|
13
|
+
field :entry_class_code, 3, '51-53', :alphanumeric
|
14
|
+
field :entry_description, 10, '54-63', :alphanumeric
|
15
|
+
field :descriptive_date, 6, '64-69', :nothing
|
16
|
+
field :effective_date, 6, '70-75', :date
|
17
|
+
field :settlement_date, 3, '76-78', :nothing
|
18
|
+
field :originator_status_code, 1, '79-79', :alphanumeric
|
19
|
+
field :odfi_id, 8, '80-87', :alphanumeric
|
20
|
+
field :batch_number, 7, '88-94', :alphanumeric
|
21
21
|
|
22
22
|
field_value :descriptive_date, ''
|
23
23
|
field_value :settlement_date, ''
|
@@ -6,16 +6,16 @@ module Headache
|
|
6
6
|
included do
|
7
7
|
include Common
|
8
8
|
|
9
|
-
field :transaction_code, 2, '2-3', :alphanumeric
|
10
|
-
field :routing_identification, 8, '4-11', :numeric
|
11
|
-
field :check_digit, 1, '12-12', :numeric
|
12
|
-
field :account_number, 17, '13-29', :alphanumeric
|
13
|
-
field :amount, 10, '30-39', :numeric
|
14
|
-
field :internal_id, 15, '40-54', :alphanumeric
|
15
|
-
field :individual_name, 22, '55-76', :alphanumeric
|
16
|
-
field :discretionary, 2, '77-78', :alphanumeric
|
17
|
-
field :addenda_record, 1, '79-79', :alphanumeric
|
18
|
-
field :trace_number, 15, '80-94', :alphanumeric
|
9
|
+
field :transaction_code, 2, '2-3', :alphanumeric
|
10
|
+
field :routing_identification, 8, '4-11', :numeric
|
11
|
+
field :check_digit, 1, '12-12', :numeric
|
12
|
+
field :account_number, 17, '13-29', :alphanumeric
|
13
|
+
field :amount, 10, '30-39', :numeric
|
14
|
+
field :internal_id, 15, '40-54', :alphanumeric
|
15
|
+
field :individual_name, 22, '55-76', :alphanumeric
|
16
|
+
field :discretionary, 2, '77-78', :alphanumeric
|
17
|
+
field :addenda_record, 1, '79-79', :alphanumeric
|
18
|
+
field :trace_number, 15, '80-94', :alphanumeric
|
19
19
|
|
20
20
|
field_value :addenda_record, '0'
|
21
21
|
field_value :discretionary, ''
|
@@ -2,22 +2,22 @@ module Headache
|
|
2
2
|
module Definition
|
3
3
|
module FileHeader
|
4
4
|
extend ActiveSupport::Concern
|
5
|
-
|
5
|
+
|
6
6
|
included do
|
7
7
|
include Common
|
8
8
|
|
9
|
-
field :priority_code, 2, '2-3', :numeric
|
10
|
-
field :destination, 10, '4-13', :alphanumeric
|
11
|
-
field :origin, 10, '14-23', :alphanumeric
|
12
|
-
field :creation_date, 6, '24-29', :date
|
13
|
-
field :creation_time, 4, '30-33', :time
|
14
|
-
field :id_modifier, 1, '34-34', :alphanumeric
|
15
|
-
field :record_size, 3, '35-37', :alphanumeric
|
16
|
-
field :blocking_factor, 2, '38-39', :alphanumeric
|
17
|
-
field :format_code, 1, '40-40', :alphanumeric
|
18
|
-
field :destination_name, 23, '41-63', :alphanumeric
|
19
|
-
field :origin_name, 23, '64-86', :alphanumeric
|
20
|
-
field :reference_code, 8, '87-94', :alphanumeric
|
9
|
+
field :priority_code, 2, '2-3', :numeric
|
10
|
+
field :destination, 10, '4-13', :alphanumeric
|
11
|
+
field :origin, 10, '14-23', :alphanumeric
|
12
|
+
field :creation_date, 6, '24-29', :date
|
13
|
+
field :creation_time, 4, '30-33', :time
|
14
|
+
field :id_modifier, 1, '34-34', :alphanumeric
|
15
|
+
field :record_size, 3, '35-37', :alphanumeric
|
16
|
+
field :blocking_factor, 2, '38-39', :alphanumeric
|
17
|
+
field :format_code, 1, '40-40', :alphanumeric
|
18
|
+
field :destination_name, 23, '41-63', :alphanumeric
|
19
|
+
field :origin_name, 23, '64-86', :alphanumeric
|
20
|
+
field :reference_code, 8, '87-94', :alphanumeric
|
21
21
|
|
22
22
|
field_value :priority_code, '01'
|
23
23
|
field_value :record_size, '094'
|
data/lib/headache/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: headache
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Payoff, Inc.
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-
|
12
|
+
date: 2015-09-02 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: fixy
|
@@ -170,3 +170,4 @@ signing_key:
|
|
170
170
|
specification_version: 4
|
171
171
|
summary: Take the pain out of building ACH files.
|
172
172
|
test_files: []
|
173
|
+
has_rdoc:
|