global_collect 0.1.5 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/HISTORY +7 -0
- data/Rakefile +2 -1
- data/VERSION +1 -1
- data/examples/parse_collection_report.rb +13 -0
- data/examples/parse_financial_statement.rb +8 -0
- data/examples/parse_payment_report.rb +8 -0
- data/examples/set_payment.rb +1 -1
- data/global_collect.gemspec +38 -2
- data/lib/global_collect.rb +12 -0
- data/lib/global_collect/log_parsing/collection_report/appendix_report_file.rb +72 -0
- data/lib/global_collect/log_parsing/collection_report/fields.rb +161 -0
- data/lib/global_collect/log_parsing/collection_report/parser.rb +68 -0
- data/lib/global_collect/log_parsing/collection_report/report_file.rb +32 -0
- data/lib/global_collect/log_parsing/financial_statement/report_file.rb +96 -0
- data/lib/global_collect/log_parsing/payment_report/fields.rb +709 -0
- data/lib/global_collect/log_parsing/payment_report/parser.rb +105 -0
- data/lib/global_collect/log_parsing/payment_report/report_file.rb +31 -0
- data/lib/global_collect/responses/base.rb +0 -2
- data/lib/global_collect/test_helper.rb +8 -4
- data/spec/log_parsing/collection_report/appendix_report_file_spec.rb +96 -0
- data/spec/log_parsing/collection_report/parser_spec.rb +42 -0
- data/spec/log_parsing/collection_report/report_file_spec.rb +17 -0
- data/spec/log_parsing/financial_statement/report_file_spec.rb +51 -0
- data/spec/log_parsing/payment_report/parser_spec.rb +37 -0
- data/spec/log_parsing/payment_report/report_file_spec.rb +23 -0
- data/spec/support/55550141.wr1 +7 -0
- data/spec/support/555520100602.csv +4 -0
- data/spec/support/555555550145.mt1 +3 -0
- data/spec/support/FS55550148COMPANY.asc +12 -0
- metadata +64 -6
@@ -0,0 +1,32 @@
|
|
1
|
+
module GlobalCollect::LogParsing::CollectionReport
|
2
|
+
class ReportFile
|
3
|
+
attr_reader :path, :account_id, :master_account_id, :date, :environment, :data
|
4
|
+
|
5
|
+
# RG - Ch8 => Technical aspects => File name
|
6
|
+
# 4 chars numeric account id, 4 chars numeric master account id,
|
7
|
+
# 1 char numeric year, 3 char numeric day-of-year,
|
8
|
+
# extension /mt\d+/ if production, and no test equivalent.
|
9
|
+
FILENAME_FORMAT = /^(\d{4})(\d{4})(\d{1})(\d{3})\.mt\d+$/
|
10
|
+
YEAR_BASE_ADJUSTED = ( Date.today.year * 10 ) / 10
|
11
|
+
def initialize(path)
|
12
|
+
@path = path
|
13
|
+
if File.basename(path) =~ FILENAME_FORMAT
|
14
|
+
@account_id = $1
|
15
|
+
@master_account_id = $2
|
16
|
+
@date = Date.ordinal(YEAR_BASE_ADJUSTED + $3.to_i, $4.to_i)
|
17
|
+
@environment = :production
|
18
|
+
else
|
19
|
+
raise ArgumentError.new("Unparseable path '#{path}'!")
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
def parse
|
24
|
+
begin
|
25
|
+
file = File.open(@path, "r")
|
26
|
+
@data = GlobalCollect::LogParsing::CollectionReport::Parser.parse(file)
|
27
|
+
ensure
|
28
|
+
file.close
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,96 @@
|
|
1
|
+
module GlobalCollect::LogParsing::FinancialStatement
|
2
|
+
class ReportFile
|
3
|
+
attr_reader :path, :account_id, :date, :environment, :data
|
4
|
+
|
5
|
+
# This file's documentation in RG turns out to be a bit of a red-herring,
|
6
|
+
# at least when it comes to v6.4.3. It's actually a tab-separated file with
|
7
|
+
# the column order and file structure represented in the docs.
|
8
|
+
|
9
|
+
# It also has a BOM sometimes, even though the contents are supposed to be
|
10
|
+
# only ASCII.
|
11
|
+
|
12
|
+
# RG - Ch10 => Technical aspects => File name
|
13
|
+
# 4 chars numeric account id, 1 char numeric year, 3 char numeric day-of-year,
|
14
|
+
# extension is .asc
|
15
|
+
#
|
16
|
+
# However, in practice it looks something like: FS55550127COMPANY.asc
|
17
|
+
#
|
18
|
+
FILENAME_FORMAT = /^FS(\d{4})(\d{1})(\d{3})[A-Z]+\.asc/
|
19
|
+
YEAR_BASE_ADJUSTED = ( Date.today.year * 10 ) / 10
|
20
|
+
def initialize(path)
|
21
|
+
@path = path
|
22
|
+
if File.basename(path) =~ FILENAME_FORMAT
|
23
|
+
@account_id = $1
|
24
|
+
@date = Date.ordinal(YEAR_BASE_ADJUSTED + $2.to_i, $3.to_i)
|
25
|
+
@environment = :production
|
26
|
+
else
|
27
|
+
raise ArgumentError.new("Unparseable path '#{path}'!")
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
def parse
|
32
|
+
begin
|
33
|
+
file = File.open(@path, "r")
|
34
|
+
# Skip the BOM if it appears
|
35
|
+
if (1..3).map{|i| file.getc.chr }.join != "\357\273\277"
|
36
|
+
file.rewind
|
37
|
+
end
|
38
|
+
csv = FasterCSV.new(file, :col_sep => "\t")
|
39
|
+
hashes = csv.map{|l| convert_line(l) }
|
40
|
+
@data = {
|
41
|
+
:header => hashes.first,
|
42
|
+
:trailer => hashes.last ,
|
43
|
+
:data => hashes[1..-2]
|
44
|
+
}
|
45
|
+
ensure
|
46
|
+
file.close
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
private
|
51
|
+
RECORD_TYPE = {
|
52
|
+
"HDR" => :file_header ,
|
53
|
+
"TRL" => :file_trailer,
|
54
|
+
"FS" => :data_record
|
55
|
+
}
|
56
|
+
CLASS = {
|
57
|
+
1 => :collection_reports ,
|
58
|
+
2 => :settlement_deposits,
|
59
|
+
3 => :settlement_invoices,
|
60
|
+
4 => :settlement_others
|
61
|
+
}
|
62
|
+
STRIP_LAMBDA = lambda {|x| x.strip }
|
63
|
+
TO_I_LAMBDA = lambda{|x| x.to_i }
|
64
|
+
HEADER_FIELDS = [
|
65
|
+
[:record_type , lambda{|x| RECORD_TYPE[x] } ],
|
66
|
+
[:relation_number , STRIP_LAMBDA ],
|
67
|
+
[:filename , STRIP_LAMBDA ],
|
68
|
+
[:filename_extension, STRIP_LAMBDA ],
|
69
|
+
[:date_production , lambda {|x| Date.strptime(x, "%Y%m%d") }]
|
70
|
+
]
|
71
|
+
TRAILER_FIELDS = (HEADER_FIELDS + [[:number_of_records, TO_I_LAMBDA]])
|
72
|
+
DATA_FIELDS = [
|
73
|
+
[:record_type , lambda{|x| RECORD_TYPE[x] }],
|
74
|
+
[:reference_number_week, STRIP_LAMBDA ],
|
75
|
+
[:reference_number_year, TO_I_LAMBDA ],
|
76
|
+
[:class , lambda{|x| CLASS[x.to_i] } ],
|
77
|
+
[:account_id , TO_I_LAMBDA ],
|
78
|
+
[:description , STRIP_LAMBDA ],
|
79
|
+
[:currency , STRIP_LAMBDA ],
|
80
|
+
[:amount , TO_I_LAMBDA ],
|
81
|
+
[:amount_sign , STRIP_LAMBDA ]
|
82
|
+
]
|
83
|
+
|
84
|
+
def convert_line(line)
|
85
|
+
out = {}
|
86
|
+
case RECORD_TYPE[line.first]
|
87
|
+
when :file_header then HEADER_FIELDS
|
88
|
+
when :file_trailer then TRAILER_FIELDS
|
89
|
+
when :data_record then DATA_FIELDS
|
90
|
+
end.each_with_index do |pair,i|
|
91
|
+
out[pair.first] = pair.last.call(line[i])
|
92
|
+
end
|
93
|
+
out
|
94
|
+
end
|
95
|
+
end
|
96
|
+
end
|
@@ -0,0 +1,709 @@
|
|
1
|
+
module GlobalCollect::LogParsing::PaymentReport
|
2
|
+
HEADER_TRAILER_FIELDS = [
|
3
|
+
{
|
4
|
+
:type =>"N",
|
5
|
+
:length =>"4",
|
6
|
+
:position =>"0004-0007",
|
7
|
+
:name =>"account_id",
|
8
|
+
:field =>"021"
|
9
|
+
},
|
10
|
+
{
|
11
|
+
:type =>"AN",
|
12
|
+
:length =>"8",
|
13
|
+
:position =>"0008-0015",
|
14
|
+
:name =>"filename",
|
15
|
+
:field =>"022"
|
16
|
+
},
|
17
|
+
{
|
18
|
+
:type =>"AN",
|
19
|
+
:length =>"3",
|
20
|
+
:position =>"0016-0018",
|
21
|
+
:name =>"filename_extension",
|
22
|
+
:field =>"023"
|
23
|
+
},
|
24
|
+
{
|
25
|
+
:type =>"D",
|
26
|
+
:length =>"8",
|
27
|
+
:position =>"0019-0026",
|
28
|
+
:name =>"date_production",
|
29
|
+
:field =>"024"
|
30
|
+
},
|
31
|
+
{
|
32
|
+
:type =>"N",
|
33
|
+
:length =>"8",
|
34
|
+
:position =>"0027-0034",
|
35
|
+
:name =>"serial_number",
|
36
|
+
:field =>"025"
|
37
|
+
},
|
38
|
+
{
|
39
|
+
:type =>"D",
|
40
|
+
:length =>"8",
|
41
|
+
:position =>"0035-0042",
|
42
|
+
:name =>"period_from",
|
43
|
+
:field =>"026"
|
44
|
+
},
|
45
|
+
{
|
46
|
+
:type =>"D",
|
47
|
+
:length =>"8",
|
48
|
+
:position =>"0043-0050",
|
49
|
+
:name =>"period_to",
|
50
|
+
:field =>"027"
|
51
|
+
},
|
52
|
+
{
|
53
|
+
:type =>"AN",
|
54
|
+
:length =>"350",
|
55
|
+
:position =>"0051-0400",
|
56
|
+
:name =>"filler",
|
57
|
+
:field =>"999"
|
58
|
+
}
|
59
|
+
]
|
60
|
+
|
61
|
+
DATA_FIELDS = [
|
62
|
+
{
|
63
|
+
:type =>"AN",
|
64
|
+
:length =>"12",
|
65
|
+
:position =>"0004-0015",
|
66
|
+
:name =>"reserved",
|
67
|
+
:field =>"099"
|
68
|
+
},
|
69
|
+
{
|
70
|
+
:type =>"AN",
|
71
|
+
:length =>"30",
|
72
|
+
:position =>"0016-0045",
|
73
|
+
:name =>"order_number",
|
74
|
+
:field =>"602"
|
75
|
+
},
|
76
|
+
{
|
77
|
+
:type =>"AN",
|
78
|
+
:length =>"15",
|
79
|
+
:position =>"0046-0060",
|
80
|
+
:name =>"customer_id",
|
81
|
+
:field =>"603"
|
82
|
+
},
|
83
|
+
{
|
84
|
+
:type =>"AN",
|
85
|
+
:length =>"1",
|
86
|
+
:position =>"0061-0061",
|
87
|
+
:name =>"reserved",
|
88
|
+
:field =>"099"
|
89
|
+
},
|
90
|
+
{
|
91
|
+
:type =>"AN",
|
92
|
+
:length =>"30",
|
93
|
+
:position =>"0062-0091",
|
94
|
+
:name =>"reference_original_payment",
|
95
|
+
:field =>"704"
|
96
|
+
},
|
97
|
+
{
|
98
|
+
:type =>"AN",
|
99
|
+
:length =>"4",
|
100
|
+
:position =>"0092-0095",
|
101
|
+
:name =>"transaction_currency",
|
102
|
+
:field =>"606"
|
103
|
+
},
|
104
|
+
{
|
105
|
+
:type =>"AN",
|
106
|
+
:length =>"6",
|
107
|
+
:position =>"0096-0101",
|
108
|
+
:name =>"reserved",
|
109
|
+
:field =>"099"
|
110
|
+
},
|
111
|
+
{
|
112
|
+
:type =>"N",
|
113
|
+
:length =>"12",
|
114
|
+
:position =>"0102-0113",
|
115
|
+
:name =>"transaction_amount",
|
116
|
+
:field =>"607"
|
117
|
+
},
|
118
|
+
{
|
119
|
+
:type =>"AN",
|
120
|
+
:length =>"1",
|
121
|
+
:position =>"0114-0114",
|
122
|
+
:name =>"transaction_amount_sign",
|
123
|
+
:field =>"910"
|
124
|
+
},
|
125
|
+
{
|
126
|
+
:type =>"AN",
|
127
|
+
:length =>"17",
|
128
|
+
:position =>"0115-0131",
|
129
|
+
:name =>"reserved",
|
130
|
+
:field =>"099"
|
131
|
+
},
|
132
|
+
{
|
133
|
+
:type =>"D",
|
134
|
+
:length =>"8",
|
135
|
+
:position =>"0132-0139",
|
136
|
+
:name =>"date_authorised",
|
137
|
+
:field =>"621"
|
138
|
+
},
|
139
|
+
{
|
140
|
+
:type =>"AN",
|
141
|
+
:length =>"3",
|
142
|
+
:position =>"0140-0142",
|
143
|
+
:name =>"declined_reason_code",
|
144
|
+
:field =>"622"
|
145
|
+
},
|
146
|
+
{
|
147
|
+
:type =>"AN",
|
148
|
+
:length =>"25",
|
149
|
+
:position =>"0143-0167",
|
150
|
+
:name =>"declined_reason_description",
|
151
|
+
:field =>"623"
|
152
|
+
},
|
153
|
+
{
|
154
|
+
:type =>"AN",
|
155
|
+
:length =>"19",
|
156
|
+
:position =>"0168-0186",
|
157
|
+
:name =>"card_number",
|
158
|
+
:field =>"631"
|
159
|
+
},
|
160
|
+
{
|
161
|
+
:type =>"AN",
|
162
|
+
:length =>"4",
|
163
|
+
:position =>"0187-0190",
|
164
|
+
:name =>"reserved",
|
165
|
+
:field =>"099"
|
166
|
+
},
|
167
|
+
{
|
168
|
+
:type =>"N",
|
169
|
+
:length =>"4",
|
170
|
+
:position =>"0191-0194",
|
171
|
+
:name =>"expiry_date",
|
172
|
+
:field =>"632"
|
173
|
+
},
|
174
|
+
{
|
175
|
+
:type =>"N",
|
176
|
+
:length =>"2",
|
177
|
+
:position =>"0195-0196",
|
178
|
+
:name =>"issue_number",
|
179
|
+
:field =>"633"
|
180
|
+
},
|
181
|
+
{
|
182
|
+
:type =>"AN",
|
183
|
+
:length =>"4",
|
184
|
+
:position =>"0197-0200",
|
185
|
+
:name =>"source_id",
|
186
|
+
:field =>"641"
|
187
|
+
},
|
188
|
+
{
|
189
|
+
:type =>"AN",
|
190
|
+
:length =>"8",
|
191
|
+
:position =>"0201-0208",
|
192
|
+
:name =>"authorisation_code",
|
193
|
+
:field =>"661"
|
194
|
+
},
|
195
|
+
{
|
196
|
+
:type =>"N",
|
197
|
+
:length =>"2",
|
198
|
+
:position =>"0209-0210",
|
199
|
+
:name =>"payment_method_id",
|
200
|
+
:field =>"801"
|
201
|
+
},
|
202
|
+
{
|
203
|
+
:type =>"N",
|
204
|
+
:length =>"4",
|
205
|
+
:position =>"0211-0214",
|
206
|
+
:name =>"payment_product_id",
|
207
|
+
:field =>"802"
|
208
|
+
},
|
209
|
+
{
|
210
|
+
:type =>"AN",
|
211
|
+
:length =>"6",
|
212
|
+
:position =>"0215-0220",
|
213
|
+
:name =>"reserved",
|
214
|
+
:field =>"099"
|
215
|
+
},
|
216
|
+
{
|
217
|
+
:type =>"AN",
|
218
|
+
:length =>"2",
|
219
|
+
:position =>"0221-0222",
|
220
|
+
:name =>"payment_method",
|
221
|
+
:field =>"255"
|
222
|
+
},
|
223
|
+
{
|
224
|
+
:type =>"AN",
|
225
|
+
:length =>"4",
|
226
|
+
:position =>"0223-0226",
|
227
|
+
:name =>"credit_card_company",
|
228
|
+
:field =>"257"
|
229
|
+
},
|
230
|
+
{
|
231
|
+
:type =>"AN",
|
232
|
+
:length =>"1",
|
233
|
+
:position =>"0227-0227",
|
234
|
+
:name =>"unclean_indicator",
|
235
|
+
:field =>"258"
|
236
|
+
},
|
237
|
+
{
|
238
|
+
:type =>"AN",
|
239
|
+
:length =>"4",
|
240
|
+
:position =>"0228-0231",
|
241
|
+
:name =>"payment_currency",
|
242
|
+
:field =>"608"
|
243
|
+
},
|
244
|
+
{
|
245
|
+
:type =>"N",
|
246
|
+
:length =>"12",
|
247
|
+
:position =>"0232-0243",
|
248
|
+
:name =>"payment_amount",
|
249
|
+
:field =>"609"
|
250
|
+
},
|
251
|
+
{
|
252
|
+
:type =>"AN",
|
253
|
+
:length =>"1",
|
254
|
+
:position =>"0244-0244",
|
255
|
+
:name =>"payment_amount_sign",
|
256
|
+
:field =>"910"
|
257
|
+
},
|
258
|
+
{
|
259
|
+
:type =>"AN",
|
260
|
+
:length =>"4",
|
261
|
+
:position =>"0245-0248",
|
262
|
+
:name =>"currency_due",
|
263
|
+
:field =>"267"
|
264
|
+
},
|
265
|
+
{
|
266
|
+
:type =>"N",
|
267
|
+
:length =>"12",
|
268
|
+
:position =>"0249-0260",
|
269
|
+
:name =>"amount_due",
|
270
|
+
:field =>"268"
|
271
|
+
},
|
272
|
+
{
|
273
|
+
:type =>"AN",
|
274
|
+
:length =>"1",
|
275
|
+
:position =>"0261-0261",
|
276
|
+
:name =>"amount_due_sign",
|
277
|
+
:field =>"910"
|
278
|
+
},
|
279
|
+
{
|
280
|
+
:type =>"D",
|
281
|
+
:length =>"8",
|
282
|
+
:position =>"0262-0269",
|
283
|
+
:name =>"date_due",
|
284
|
+
:field =>"663"
|
285
|
+
},
|
286
|
+
{
|
287
|
+
:type =>"AN",
|
288
|
+
:length =>"1",
|
289
|
+
:position =>"0270-0270",
|
290
|
+
:name =>"authorisation_indicator",
|
291
|
+
:field =>"659"
|
292
|
+
},
|
293
|
+
{
|
294
|
+
:type =>"AN",
|
295
|
+
:length =>"8",
|
296
|
+
:position =>"0271-0278",
|
297
|
+
:name =>"authorisation_code",
|
298
|
+
:field =>"661"
|
299
|
+
},
|
300
|
+
{
|
301
|
+
:type =>"AN",
|
302
|
+
:length =>"42",
|
303
|
+
:position =>"0279-0320",
|
304
|
+
:name =>"filler",
|
305
|
+
:field =>"999"
|
306
|
+
},
|
307
|
+
{
|
308
|
+
:type =>"AN",
|
309
|
+
:length =>"4",
|
310
|
+
:position =>"0321-0324",
|
311
|
+
:name =>"currency_original_payment",
|
312
|
+
:field =>"701"
|
313
|
+
},
|
314
|
+
{
|
315
|
+
:type =>"N",
|
316
|
+
:length =>"12",
|
317
|
+
:position =>"0325-0336",
|
318
|
+
:name =>"amount_original_payment",
|
319
|
+
:field =>"702"
|
320
|
+
},
|
321
|
+
{
|
322
|
+
:type =>"AN",
|
323
|
+
:length =>"1",
|
324
|
+
:position =>"0337-0337",
|
325
|
+
:name =>"amount_original_payment_sign",
|
326
|
+
:field =>"910"
|
327
|
+
},
|
328
|
+
{
|
329
|
+
:type =>"AN",
|
330
|
+
:length =>"12",
|
331
|
+
:position =>"0338-0349",
|
332
|
+
:name =>"reserved",
|
333
|
+
:field =>"099"
|
334
|
+
},
|
335
|
+
{
|
336
|
+
:type =>"AN",
|
337
|
+
:length =>"20",
|
338
|
+
:position =>"0350-0369",
|
339
|
+
:name =>"order_number_original_payment",
|
340
|
+
:field =>"707"
|
341
|
+
},
|
342
|
+
{
|
343
|
+
:type =>"AN",
|
344
|
+
:length =>"15",
|
345
|
+
:position =>"0370-0384",
|
346
|
+
:name =>"customer_id_original_payment",
|
347
|
+
:field =>"708"
|
348
|
+
},
|
349
|
+
{
|
350
|
+
:type =>"AN",
|
351
|
+
:length =>"2",
|
352
|
+
:position =>"0385-0386",
|
353
|
+
:name =>"charge_back_reason_id",
|
354
|
+
:field =>"767"
|
355
|
+
},
|
356
|
+
{
|
357
|
+
:type =>"AN",
|
358
|
+
:length =>"25",
|
359
|
+
:position =>"0387-0411",
|
360
|
+
:name =>"charge_back_reason_desc",
|
361
|
+
:field =>"768"
|
362
|
+
},
|
363
|
+
{
|
364
|
+
:type =>"D",
|
365
|
+
:length =>"8",
|
366
|
+
:position =>"0412-0419",
|
367
|
+
:name =>"date_collected_original_payment",
|
368
|
+
:field =>"756"
|
369
|
+
},
|
370
|
+
{
|
371
|
+
:type =>"AN",
|
372
|
+
:length =>"1",
|
373
|
+
:position =>"0420-0420",
|
374
|
+
:name =>"filler",
|
375
|
+
:field =>"999"
|
376
|
+
},
|
377
|
+
{
|
378
|
+
:type =>"AN",
|
379
|
+
:length =>"4",
|
380
|
+
:position =>"0321-0324",
|
381
|
+
:name =>"currency_original_payment",
|
382
|
+
:field =>"701"
|
383
|
+
},
|
384
|
+
{
|
385
|
+
:type =>"N",
|
386
|
+
:length =>"12",
|
387
|
+
:position =>"0325-0336",
|
388
|
+
:name =>"amount_original_payment",
|
389
|
+
:field =>"702"
|
390
|
+
},
|
391
|
+
{
|
392
|
+
:type =>"AN",
|
393
|
+
:length =>"1",
|
394
|
+
:position =>"0337-0337",
|
395
|
+
:name =>"amount_original_payment_sign",
|
396
|
+
:field =>"910"
|
397
|
+
},
|
398
|
+
{
|
399
|
+
:type =>"AN",
|
400
|
+
:length =>"12",
|
401
|
+
:position =>"0338-0349",
|
402
|
+
:name =>"reserved",
|
403
|
+
:field =>"099"
|
404
|
+
},
|
405
|
+
{
|
406
|
+
:type =>"AN",
|
407
|
+
:length =>"20",
|
408
|
+
:position =>"0350-0369",
|
409
|
+
:name =>"order_number_original_payment",
|
410
|
+
:field =>"707"
|
411
|
+
},
|
412
|
+
{
|
413
|
+
:type =>"AN",
|
414
|
+
:length =>"15",
|
415
|
+
:position =>"0370-0384",
|
416
|
+
:name =>"customer_id_original_payment",
|
417
|
+
:field =>"706"
|
418
|
+
},
|
419
|
+
{
|
420
|
+
:type =>"AN",
|
421
|
+
:length =>"36",
|
422
|
+
:position =>"0385-0420",
|
423
|
+
:name =>"filler",
|
424
|
+
:field =>"999"
|
425
|
+
}
|
426
|
+
]
|
427
|
+
|
428
|
+
BATCH_HEADER_FIELDS = [
|
429
|
+
{
|
430
|
+
:type =>"N",
|
431
|
+
:length =>"4",
|
432
|
+
:position =>"0004-0007",
|
433
|
+
:name =>"merchant_id",
|
434
|
+
:field =>"050"
|
435
|
+
},
|
436
|
+
{
|
437
|
+
:type =>"AN",
|
438
|
+
:length =>"27",
|
439
|
+
:position =>"0008-0034",
|
440
|
+
:name =>"reserved",
|
441
|
+
:field =>"099"
|
442
|
+
},
|
443
|
+
{
|
444
|
+
:type =>"D",
|
445
|
+
:length =>"8",
|
446
|
+
:position =>"0035-0042",
|
447
|
+
:name =>"period_from",
|
448
|
+
:field =>"826"
|
449
|
+
},
|
450
|
+
{
|
451
|
+
:type =>"D",
|
452
|
+
:length =>"8",
|
453
|
+
:position =>"0043-0050",
|
454
|
+
:name =>"period_to",
|
455
|
+
:field =>"827"
|
456
|
+
},
|
457
|
+
{
|
458
|
+
:type =>"AN",
|
459
|
+
:length =>"350",
|
460
|
+
:position =>"0051-0400",
|
461
|
+
:name =>"filler",
|
462
|
+
:field =>"999"
|
463
|
+
}
|
464
|
+
]
|
465
|
+
|
466
|
+
BATCH_TRAILER_FIELDS = [
|
467
|
+
{
|
468
|
+
:type =>"N",
|
469
|
+
:length =>"4",
|
470
|
+
:position =>"0004-0007",
|
471
|
+
:name =>"merchant_id",
|
472
|
+
:field =>"050"
|
473
|
+
},
|
474
|
+
{
|
475
|
+
:type =>"AN",
|
476
|
+
:length =>"27",
|
477
|
+
:position =>"0008-0034",
|
478
|
+
:name =>"reserved",
|
479
|
+
:field =>"099"
|
480
|
+
},
|
481
|
+
{
|
482
|
+
:type =>"D",
|
483
|
+
:length =>"8",
|
484
|
+
:position =>"0035-0042",
|
485
|
+
:name =>"period_from",
|
486
|
+
:field =>"826"
|
487
|
+
},
|
488
|
+
{
|
489
|
+
:type =>"D",
|
490
|
+
:length =>"8",
|
491
|
+
:position =>"0043-0050",
|
492
|
+
:name =>"period_to",
|
493
|
+
:field =>"827"
|
494
|
+
},
|
495
|
+
{
|
496
|
+
:type =>"N",
|
497
|
+
:length =>"8",
|
498
|
+
:position =>"0051-0058",
|
499
|
+
:name =>"number_of_records",
|
500
|
+
:field =>"828"
|
501
|
+
},
|
502
|
+
{
|
503
|
+
:type =>"N",
|
504
|
+
:length =>"8",
|
505
|
+
:position =>"0059-0066",
|
506
|
+
:name =>"number_of_sent_invoices",
|
507
|
+
:field =>"829"
|
508
|
+
},
|
509
|
+
{
|
510
|
+
:type =>"N",
|
511
|
+
:length =>"8",
|
512
|
+
:position =>"0067-0074",
|
513
|
+
:name =>"number_of_rejected_invoices",
|
514
|
+
:field =>"830"
|
515
|
+
},
|
516
|
+
{
|
517
|
+
:type =>"N",
|
518
|
+
:length =>"8",
|
519
|
+
:position =>"0075-0082",
|
520
|
+
:name =>"number_of_invoice_payments",
|
521
|
+
:field =>"831"
|
522
|
+
},
|
523
|
+
{
|
524
|
+
:type =>"N",
|
525
|
+
:length =>"8",
|
526
|
+
:position =>"0083-0090",
|
527
|
+
:name =>"number_of_conv_invoice_payment",
|
528
|
+
:field =>"832"
|
529
|
+
},
|
530
|
+
{
|
531
|
+
:type =>"N",
|
532
|
+
:length =>"8",
|
533
|
+
:position =>"0091-0098",
|
534
|
+
:name =>"number_of_corrections_on_payments",
|
535
|
+
:field =>"833"
|
536
|
+
},
|
537
|
+
{
|
538
|
+
:type =>"N",
|
539
|
+
:length =>"8",
|
540
|
+
:position =>"0099-0106",
|
541
|
+
:name =>"number_of_reversals",
|
542
|
+
:field =>"834"
|
543
|
+
},
|
544
|
+
{
|
545
|
+
:type =>"N",
|
546
|
+
:length =>"8",
|
547
|
+
:position =>"0107-0114",
|
548
|
+
:name =>"number_of_corrections_on_reversals",
|
549
|
+
:field =>"835"
|
550
|
+
},
|
551
|
+
{
|
552
|
+
:type =>"N",
|
553
|
+
:length =>"8",
|
554
|
+
:position =>"0115-0122",
|
555
|
+
:name =>"number_of_rejected_card_payments",
|
556
|
+
:field =>"836"
|
557
|
+
},
|
558
|
+
{
|
559
|
+
:type =>"N",
|
560
|
+
:length =>"8",
|
561
|
+
:position =>"0123-0130",
|
562
|
+
:name =>"number_of_card_refunds",
|
563
|
+
:field =>"837"
|
564
|
+
},
|
565
|
+
{
|
566
|
+
:type =>"N",
|
567
|
+
:length =>"8",
|
568
|
+
:position =>"0131-0138",
|
569
|
+
:name =>"number_of_corrections_card_refunds",
|
570
|
+
:field =>"838"
|
571
|
+
},
|
572
|
+
{
|
573
|
+
:type =>"N",
|
574
|
+
:length =>"8",
|
575
|
+
:position =>"0139-0146",
|
576
|
+
:name =>"number_of_collected_card_on_line",
|
577
|
+
:field =>"839"
|
578
|
+
},
|
579
|
+
{
|
580
|
+
:type =>"N",
|
581
|
+
:length =>"8",
|
582
|
+
:position =>"0147-0154",
|
583
|
+
:name =>"number_of_collected_card_off_line",
|
584
|
+
:field =>"840"
|
585
|
+
},
|
586
|
+
{
|
587
|
+
:type =>"N",
|
588
|
+
:length =>"8",
|
589
|
+
:position =>"0155-0162",
|
590
|
+
:name =>"number_of_collected_card_refunds",
|
591
|
+
:field =>"841"
|
592
|
+
},
|
593
|
+
{
|
594
|
+
:type =>"N",
|
595
|
+
:length =>"8",
|
596
|
+
:position =>"0163-0170",
|
597
|
+
:name =>"number_of_collected_card_charge_backs",
|
598
|
+
:field =>"842"
|
599
|
+
},
|
600
|
+
{
|
601
|
+
:type =>"N",
|
602
|
+
:length =>"8",
|
603
|
+
:position =>"0171-0178",
|
604
|
+
:name =>"number_of_rejected_card_on_line",
|
605
|
+
:field =>"843"
|
606
|
+
},
|
607
|
+
{
|
608
|
+
:type =>"N",
|
609
|
+
:length =>"8",
|
610
|
+
:position =>"0179-0186",
|
611
|
+
:name =>"number_of_rejected_card_off_line",
|
612
|
+
:field =>"844"
|
613
|
+
},
|
614
|
+
{
|
615
|
+
:type =>"N",
|
616
|
+
:length =>"8",
|
617
|
+
:position =>"0187-0194",
|
618
|
+
:name =>"number_of_direct_debit_orders_rejected",
|
619
|
+
:field =>"845"
|
620
|
+
},
|
621
|
+
{
|
622
|
+
:type =>"N",
|
623
|
+
:length =>"8",
|
624
|
+
:position =>"0195-0202",
|
625
|
+
:name =>"number_of_direct_debit_orders_rejected_by_bank",
|
626
|
+
:field =>"846"
|
627
|
+
},
|
628
|
+
{
|
629
|
+
:type =>"N",
|
630
|
+
:length =>"8",
|
631
|
+
:position =>"0203-0210",
|
632
|
+
:name =>"number_of_collected_direct_debit_payments",
|
633
|
+
:field =>"847"
|
634
|
+
},
|
635
|
+
{
|
636
|
+
:type =>"N",
|
637
|
+
:length =>"8",
|
638
|
+
:position =>"0211-0218",
|
639
|
+
:name =>"number_of_reversed_direct_debit_payments",
|
640
|
+
:field =>"848"
|
641
|
+
},
|
642
|
+
{
|
643
|
+
:type =>"N",
|
644
|
+
:length =>"8",
|
645
|
+
:position =>"0219-0226",
|
646
|
+
:name =>"filler",
|
647
|
+
:field =>"849"
|
648
|
+
},
|
649
|
+
{
|
650
|
+
:type =>"N",
|
651
|
+
:length =>"8",
|
652
|
+
:position =>"0227-0234",
|
653
|
+
:name =>"number_of_withdrawn_chargebacks",
|
654
|
+
:field =>"850"
|
655
|
+
},
|
656
|
+
{
|
657
|
+
:type =>"AN",
|
658
|
+
:length =>"166",
|
659
|
+
:position =>"0235-0400",
|
660
|
+
:name =>"filler",
|
661
|
+
:field =>"999"
|
662
|
+
}
|
663
|
+
]
|
664
|
+
|
665
|
+
INFORMATION_FIELDS = [
|
666
|
+
{
|
667
|
+
:type=>"N",
|
668
|
+
:length=>"4",
|
669
|
+
:position=>"0004-0007",
|
670
|
+
:name=>"merchant_id",
|
671
|
+
:field=>"050"
|
672
|
+
},
|
673
|
+
{
|
674
|
+
:type=>"AN",
|
675
|
+
:length=>"217",
|
676
|
+
:position=>"0008-0224",
|
677
|
+
:name=>"reserved",
|
678
|
+
:field=>"099"
|
679
|
+
},
|
680
|
+
{
|
681
|
+
:type=>"AN",
|
682
|
+
:length=>"4",
|
683
|
+
:position=>"0225-0228",
|
684
|
+
:name=>"currency_due",
|
685
|
+
:field=>"267"
|
686
|
+
},
|
687
|
+
{
|
688
|
+
:type=>"N",
|
689
|
+
:length=>"12",
|
690
|
+
:position=>"0229-0240",
|
691
|
+
:name=>"total_amount_due",
|
692
|
+
:field=>"868"
|
693
|
+
},
|
694
|
+
{
|
695
|
+
:type=>"AN",
|
696
|
+
:length=>"1",
|
697
|
+
:position=>"0241-0241",
|
698
|
+
:name=>"total_amount_due_sign",
|
699
|
+
:field=>"910"
|
700
|
+
},
|
701
|
+
{
|
702
|
+
:type=>"AN",
|
703
|
+
:length=>"159",
|
704
|
+
:position=>"0242-0400",
|
705
|
+
:name=>"filler",
|
706
|
+
:field=>"999"
|
707
|
+
}
|
708
|
+
]
|
709
|
+
end
|