absa-h2h 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -4,7 +4,11 @@ module Absa
4
4
  class Reply < Set
5
5
 
6
6
  class TransmissionStatus < Record; end
7
- class TransmissionRejectedReason < Record; end
7
+ class TransmissionRejectedReason < Record
8
+
9
+ set_allowed_characters ('A'..'Z').to_a + ('a'..'z').to_a + (0..9).to_a.map(&:to_s) + ['.','/','-','&','*',',','(',')','<','+','$',';','>','=',"'",' ', "\""] # move to config file
10
+
11
+ end
8
12
  class EftStatus < Record; end
9
13
  class AhvStatus < Record; end
10
14
  class AcceptedReportReply < Record; end
@@ -1,5 +1,5 @@
1
1
  module Absa
2
2
  module H2h
3
- VERSION = "0.1.4"
3
+ VERSION = "0.1.5"
4
4
  end
5
5
  end
data/lib/config/reply.yml CHANGED
@@ -67,7 +67,7 @@ transmission_rejected_reason:
67
67
  data_type: A
68
68
  offset: 8
69
69
  length: 1
70
- fixed_val: '-'
70
+ fixed_val: ' '
71
71
  expose: false
72
72
  error_code:
73
73
  data_type: N
@@ -107,35 +107,31 @@ ahv_status:
107
107
  length: 14
108
108
  fixed_val: ' AHV USER SET '
109
109
  expose: false
110
- user_code:
111
- data_type: A
112
- offset: 22
113
- length: 4
114
110
  filler_2:
115
111
  data_type: A
116
- offset: 26
117
- length: 1
118
- fixed_val: ' '
112
+ offset: 22
113
+ length: 5
114
+ fixed_val: ' '
119
115
  expose: false
120
116
  user_code_generation_number:
121
- data_type: N
117
+ data_type: A
122
118
  offset: 27
123
- length: 7
119
+ length: 6
124
120
  filler_3:
125
121
  data_type: A
126
- offset: 34
122
+ offset: 33
127
123
  length: 1
128
124
  fixed_val: '-'
129
125
  expose: false
130
126
  last_sequence_number:
131
127
  data_type: N
132
- offset: 35
133
- length: 6
128
+ offset: 34
129
+ length: 7
134
130
  filler_4:
135
131
  data_type: A
136
132
  offset: 41
137
133
  length: 1
138
- fixed_val: ' '
134
+ fixed_val: '-'
139
135
  expose: false
140
136
  user_set_status:
141
137
  data_type: A
@@ -0,0 +1,6 @@
1
+ 000T2012062000000RENTAL CONNECT PTY LTD TEST 04144
2
+ 900T000 TRANSMISSION 04144-0000001 ACCEPTED
3
+ 901T000 00006-*** TRANS. NUMBER NOT "TEST" - CHECK BYPASSED ***
4
+ 900T030 AHV USER SET AHVEXT-0000001-ACCEPTED
5
+ 901T000 00014-*** NO LIVE DATA WAS TRANSMITTED ***
6
+ 999T000000006
@@ -149,4 +149,15 @@ describe Absa::H2h::Transmission::Document do
149
149
 
150
150
  end
151
151
 
152
+ context "when parsing an ahv reply file" do
153
+
154
+ it "should build a valid document" do
155
+ input_string = File.open("./spec/examples/ahv_reply_file.txt", "rb").read
156
+ document = Absa::H2h::Transmission::Document.from_s(input_string, "reply")
157
+ # output_string = document.to_s
158
+ # output_string.should == input_string
159
+ end
160
+
161
+ end
162
+
152
163
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: absa-h2h
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-06-21 00:00:00.000000000Z
12
+ date: 2012-06-25 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
16
- requirement: &70191602034820 !ruby/object:Gem::Requirement
16
+ requirement: &70270396145080 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70191602034820
24
+ version_requirements: *70270396145080
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: i18n
27
- requirement: &70191602034400 !ruby/object:Gem::Requirement
27
+ requirement: &70270396144660 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70191602034400
35
+ version_requirements: *70270396144660
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: strata
38
- requirement: &70191602033900 !ruby/object:Gem::Requirement
38
+ requirement: &70270396144160 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -43,7 +43,7 @@ dependencies:
43
43
  version: 0.0.1
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *70191602033900
46
+ version_requirements: *70270396144160
47
47
  description: The interface supports Account holder verifications, EFT payments, Debit
48
48
  orders, collecting statements.
49
49
  email:
@@ -85,6 +85,7 @@ files:
85
85
  - lib/tmp/test.txt
86
86
  - spec/examples/ahv_input_file.txt
87
87
  - spec/examples/ahv_output_file.txt
88
+ - spec/examples/ahv_reply_file.txt
88
89
  - spec/examples/eft_input_credit_file.txt
89
90
  - spec/examples/eft_input_credit_file2.txt
90
91
  - spec/examples/eft_input_file.txt
@@ -129,6 +130,7 @@ summary: A ruby interface to commumicate with the ABSA Host 2 Host platform
129
130
  test_files:
130
131
  - spec/examples/ahv_input_file.txt
131
132
  - spec/examples/ahv_output_file.txt
133
+ - spec/examples/ahv_reply_file.txt
132
134
  - spec/examples/eft_input_credit_file.txt
133
135
  - spec/examples/eft_input_credit_file2.txt
134
136
  - spec/examples/eft_input_file.txt