clieop 0.2.2 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -0
- data/README.rdoc +2 -0
- data/clieop.gemspec +6 -6
- data/doc/VERWINFO_NL_4.1_11-2009.pdf +0 -0
- data/lib/clieop/payment/batch.rb +128 -0
- data/lib/clieop/payment/file.rb +45 -0
- data/lib/clieop/payment/record.rb +124 -0
- data/lib/clieop/process_info/batch.rb +27 -0
- data/lib/clieop/process_info/file.rb +51 -0
- data/lib/clieop/process_info/record.rb +221 -0
- data/lib/clieop/process_info/transaction.rb +24 -0
- data/lib/clieop.rb +13 -4
- data/lib/core_ext/hash.rb +13 -0
- data/lib/core_ext/string.rb +19 -0
- data/spec/clieop/{batch_spec.rb → payment/batch_spec.rb} +55 -12
- data/spec/clieop/{file_spec.rb → payment/file_spec.rb} +1 -1
- data/spec/clieop/{record_spec.rb → payment/record_spec.rb} +27 -13
- data/spec/clieop/process_info/batch_spec.rb +26 -0
- data/spec/clieop/process_info/file_spec.rb +35 -0
- data/spec/clieop/process_info/record_spec.rb +32 -0
- data/spec/clieop/process_info/transaction_spec.rb +22 -0
- data/spec/clieop_spec.rb +2 -2
- data/spec/files/VERWINFO.txt +97 -0
- metadata +57 -20
- data/lib/clieop/batch.rb +0 -112
- data/lib/clieop/file.rb +0 -43
- data/lib/clieop/record.rb +0 -110
data/lib/clieop.rb
CHANGED
@@ -1,9 +1,18 @@
|
|
1
1
|
require 'date'
|
2
2
|
|
3
3
|
module Clieop
|
4
|
-
VERSION = "0.
|
4
|
+
VERSION = "1.0.0"
|
5
5
|
end
|
6
6
|
|
7
|
-
|
8
|
-
require '
|
9
|
-
require '
|
7
|
+
unless defined?(ActiveSupport)
|
8
|
+
require 'core_ext/string'
|
9
|
+
require 'core_ext/hash'
|
10
|
+
end
|
11
|
+
|
12
|
+
require 'clieop/payment/record'
|
13
|
+
require 'clieop/payment/file'
|
14
|
+
require 'clieop/payment/batch'
|
15
|
+
require 'clieop/process_info/record'
|
16
|
+
require 'clieop/process_info/file'
|
17
|
+
require 'clieop/process_info/batch'
|
18
|
+
require 'clieop/process_info/transaction'
|
@@ -0,0 +1,13 @@
|
|
1
|
+
class Hash
|
2
|
+
# Return a hash that includes everything but the given keys. This is useful for
|
3
|
+
# limiting a set of parameters to everything but a few known toggles:
|
4
|
+
def except(*keys)
|
5
|
+
dup.except!(*keys)
|
6
|
+
end
|
7
|
+
|
8
|
+
# Replaces the hash without the given keys.
|
9
|
+
def except!(*keys)
|
10
|
+
keys.each { |key| delete(key) }
|
11
|
+
self
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
class String
|
2
|
+
# 0x3000: fullwidth whitespace
|
3
|
+
NON_WHITESPACE_REGEXP = %r![^\s#{[0x3000].pack("U")}]!
|
4
|
+
|
5
|
+
# A string is blank if it's empty or contains whitespaces only:
|
6
|
+
#
|
7
|
+
# "".blank? # => true
|
8
|
+
# " ".blank? # => true
|
9
|
+
# " ".blank? # => true
|
10
|
+
# " something here ".blank? # => false
|
11
|
+
#
|
12
|
+
def blank?
|
13
|
+
self !~ NON_WHITESPACE_REGEXP
|
14
|
+
end
|
15
|
+
|
16
|
+
def present?
|
17
|
+
!blank?
|
18
|
+
end
|
19
|
+
end
|
@@ -1,28 +1,35 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
|
-
describe Clieop::Batch do
|
3
|
+
describe Clieop::Payment::Batch do
|
4
4
|
|
5
5
|
before(:all) do
|
6
|
-
@
|
7
|
-
:description => "Batch",
|
6
|
+
@batch_info_without_description = {
|
8
7
|
:account_nr => 123456789,
|
9
8
|
:account_owner => "Reciever"
|
10
9
|
}
|
10
|
+
|
11
|
+
@batch_info = @batch_info_without_description.merge :description => 'Batch'
|
11
12
|
end
|
12
13
|
|
13
14
|
it "should generate valid object" do
|
14
|
-
Clieop::Batch.new(@batch_info.dup).class.should eql(Clieop::Batch)
|
15
|
+
Clieop::Payment::Batch.new(@batch_info.dup).class.should eql(Clieop::Payment::Batch)
|
15
16
|
end
|
16
17
|
|
17
18
|
it "should generate a invoice batch" do
|
18
|
-
batch = Clieop::Batch.invoice_batch(@batch_info.dup)
|
19
|
-
batch.class.should eql(Clieop::Batch)
|
19
|
+
batch = Clieop::Payment::Batch.invoice_batch(@batch_info.dup)
|
20
|
+
batch.class.should eql(Clieop::Payment::Batch)
|
20
21
|
batch.batch_info[:transaction_group].should eql(10)
|
21
22
|
end
|
22
23
|
|
24
|
+
it 'should allow omitting a description' do
|
25
|
+
expect {
|
26
|
+
Clieop::Payment::Batch.invoice_batch(@batch_info_without_description)
|
27
|
+
}.to_not raise_error
|
28
|
+
end
|
29
|
+
|
23
30
|
it "should generate a payment batch" do
|
24
|
-
batch = Clieop::Batch.payment_batch(@batch_info.dup)
|
25
|
-
batch.class.should eql(Clieop::Batch)
|
31
|
+
batch = Clieop::Payment::Batch.payment_batch(@batch_info.dup)
|
32
|
+
batch.class.should eql(Clieop::Payment::Batch)
|
26
33
|
batch.batch_info[:transaction_group].should eql(0)
|
27
34
|
end
|
28
35
|
|
@@ -31,15 +38,17 @@ describe Clieop::Batch do
|
|
31
38
|
describe "Invoice" do
|
32
39
|
|
33
40
|
before do
|
34
|
-
@batch = Clieop::Batch.invoice_batch(@batch_info.dup)
|
35
|
-
@
|
41
|
+
@batch = Clieop::Payment::Batch.invoice_batch(@batch_info.dup)
|
42
|
+
@transaction = {
|
36
43
|
:reference_number => "Factnr 100101",
|
37
44
|
:account_nr => 123456789,
|
38
45
|
:account_owner => 'Payee',
|
46
|
+
:account_city => 'Enschede',
|
39
47
|
:amount => 30102,
|
40
48
|
:description => "Testing a CLIEOP direct debt transaction\nCharging your bank account",
|
41
49
|
:transaction_type => 1001
|
42
50
|
}
|
51
|
+
@batch << @transaction
|
43
52
|
end
|
44
53
|
|
45
54
|
it "should add transactions to batch" do
|
@@ -49,12 +58,28 @@ describe Clieop::Batch do
|
|
49
58
|
@batch.to_clieop.should match(/0030B1000000Reciever P /)
|
50
59
|
@batch.to_clieop.should match(/0100A100100000301020001234567890123456789 /)
|
51
60
|
@batch.to_clieop.should match(/0110BPayee /)
|
61
|
+
@batch.to_clieop.should match(/0113BEnschede /)
|
52
62
|
@batch.to_clieop.should match(/0150AFactnr 100101 /)
|
53
63
|
@batch.to_clieop.should match(/0160ATesting a CLIEOP direct debt tra /)
|
54
64
|
@batch.to_clieop.should match(/0160ACharging your bank account /)
|
55
65
|
@batch.to_clieop.should match(/9990A00000000000301020002469135780000001 /)
|
56
66
|
end
|
57
67
|
|
68
|
+
it 'should omit 0020 record when there is no description' do
|
69
|
+
batch = Clieop::Payment::Batch.invoice_batch(@batch_info_without_description)
|
70
|
+
batch << @transaction
|
71
|
+
batch.to_clieop.should_not match(/^0020/)
|
72
|
+
end
|
73
|
+
|
74
|
+
it 'should allow multiline 0020 batch descriptions' do
|
75
|
+
batch = Clieop::Payment::Batch.invoice_batch(@batch_info.merge(:description => "Test\nbatch\nfor\nmultiline\ndescriptions"))
|
76
|
+
batch.to_clieop.should match(/0020ATest /)
|
77
|
+
batch.to_clieop.should match(/0020Abatch /)
|
78
|
+
batch.to_clieop.should match(/0020Afor /)
|
79
|
+
batch.to_clieop.should match(/0020Amultiline /)
|
80
|
+
batch.to_clieop.should_not match(/0020Adescriptions /) # Max 4 lines
|
81
|
+
end
|
82
|
+
|
58
83
|
it "should appear in proper order" do
|
59
84
|
last_record_code = 0
|
60
85
|
@batch.to_clieop.split("\n").each do |line|
|
@@ -69,15 +94,17 @@ describe Clieop::Batch do
|
|
69
94
|
describe "Payment" do
|
70
95
|
|
71
96
|
before do
|
72
|
-
@batch = Clieop::Batch.payment_batch(@batch_info.dup)
|
73
|
-
@
|
97
|
+
@batch = Clieop::Payment::Batch.payment_batch(@batch_info.dup)
|
98
|
+
@transaction = {
|
74
99
|
:reference_number => "Factnr 100101",
|
75
100
|
:account_nr => 123456789,
|
76
101
|
:account_owner => 'Payee',
|
102
|
+
:account_city => 'Enschede',
|
77
103
|
:amount => 30102,
|
78
104
|
:description => "Testing a CLIEOP direct credit transaction\nPaying your bank account",
|
79
105
|
:transaction_type => 1001
|
80
106
|
}
|
107
|
+
@batch << @transaction
|
81
108
|
end
|
82
109
|
|
83
110
|
it "should add transactions to batch" do
|
@@ -90,9 +117,25 @@ describe Clieop::Batch do
|
|
90
117
|
@batch.to_clieop.should match(/0160ATesting a CLIEOP direct credit t /)
|
91
118
|
@batch.to_clieop.should match(/0160APaying your bank account /)
|
92
119
|
@batch.to_clieop.should match(/0170BPayee /)
|
120
|
+
@batch.to_clieop.should match(/0173BEnschede /)
|
93
121
|
@batch.to_clieop.should match(/9990A00000000000301020002469135780000001 /)
|
94
122
|
end
|
95
123
|
|
124
|
+
it 'should omit the 0020 batch description record when there is no description' do
|
125
|
+
batch = Clieop::Payment::Batch.payment_batch(@batch_info_without_description)
|
126
|
+
batch << @transaction
|
127
|
+
batch.to_clieop.should_not match(/^0020/)
|
128
|
+
end
|
129
|
+
|
130
|
+
it 'should allow multiline 0020 batch descriptions' do
|
131
|
+
batch = Clieop::Payment::Batch.payment_batch(@batch_info.merge(:description => "Test\nbatch\nfor\nmultiline\ndescriptions"))
|
132
|
+
batch.to_clieop.should match(/0020ATest /)
|
133
|
+
batch.to_clieop.should match(/0020Abatch /)
|
134
|
+
batch.to_clieop.should match(/0020Afor /)
|
135
|
+
batch.to_clieop.should match(/0020Amultiline /)
|
136
|
+
batch.to_clieop.should_not match(/0020Adescriptions /) # Max 4 lines
|
137
|
+
end
|
138
|
+
|
96
139
|
it "should appear in proper order" do
|
97
140
|
last_record_code = 0
|
98
141
|
@batch.to_clieop.split("\n").each do |line|
|
@@ -1,22 +1,22 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
|
-
describe Clieop::Record do
|
3
|
+
describe Clieop::Payment::Record do
|
4
4
|
|
5
5
|
before(:all) do
|
6
6
|
end
|
7
7
|
|
8
8
|
it "should generate :file_header" do
|
9
|
-
record = Clieop::Record.new(:file_header, :date => '050410')
|
9
|
+
record = Clieop::Payment::Record.new(:file_header, :date => '050410')
|
10
10
|
record.to_clieop.should match(/0001A050410CLIEOP03 1 /)
|
11
11
|
end
|
12
12
|
|
13
13
|
it "should generate :file_footer" do
|
14
|
-
record = Clieop::Record.new(:file_footer)
|
14
|
+
record = Clieop::Payment::Record.new(:file_footer)
|
15
15
|
record.to_clieop.should match(/9999A /)
|
16
16
|
end
|
17
17
|
|
18
18
|
it "should generate :batch_header for direct debit" do
|
19
|
-
record = Clieop::Record.new(:batch_header,
|
19
|
+
record = Clieop::Payment::Record.new(:batch_header,
|
20
20
|
:transaction_group => 10,
|
21
21
|
:acount_nr => 1234567890,
|
22
22
|
:serial_nr => 1
|
@@ -25,7 +25,7 @@ describe Clieop::Record do
|
|
25
25
|
end
|
26
26
|
|
27
27
|
it "should generate :batch_header for payment" do
|
28
|
-
record = Clieop::Record.new(:batch_header,
|
28
|
+
record = Clieop::Payment::Record.new(:batch_header,
|
29
29
|
:transaction_group => 0,
|
30
30
|
:acount_nr => 1234567890,
|
31
31
|
:serial_nr => 1
|
@@ -35,7 +35,7 @@ describe Clieop::Record do
|
|
35
35
|
|
36
36
|
# TODO Also do calculations
|
37
37
|
it "should generate :batch_footer" do
|
38
|
-
record = Clieop::Record.new(:batch_footer,
|
38
|
+
record = Clieop::Payment::Record.new(:batch_footer,
|
39
39
|
:total_amount => 0,
|
40
40
|
:account_checksum => 1234567890,
|
41
41
|
:tranasction_count => 0
|
@@ -44,21 +44,21 @@ describe Clieop::Record do
|
|
44
44
|
end
|
45
45
|
|
46
46
|
it "should generate :batch_description" do
|
47
|
-
record = Clieop::Record.new(:batch_description,
|
47
|
+
record = Clieop::Payment::Record.new(:batch_description,
|
48
48
|
:description => 'Testing a CLIEOP direct debt transaction\nCharging your bank account'
|
49
49
|
)
|
50
50
|
record.to_clieop.should match(/0020ATesting a CLIEOP direct debt tra /)
|
51
51
|
end
|
52
52
|
|
53
53
|
it "should generate :batch_owner" do
|
54
|
-
record = Clieop::Record.new(:batch_owner,
|
54
|
+
record = Clieop::Payment::Record.new(:batch_owner,
|
55
55
|
:owner => 'Reciever'
|
56
56
|
)
|
57
57
|
record.to_clieop.should match(/0030B1000000Reciever P /)
|
58
58
|
end
|
59
59
|
|
60
60
|
it "should generate :transaction_info" do
|
61
|
-
record = Clieop::Record.new(:transaction_info,
|
61
|
+
record = Clieop::Payment::Record.new(:transaction_info,
|
62
62
|
:amount => 'Reciever',
|
63
63
|
:from_account => 1234567890,
|
64
64
|
:to_account => 1234567890
|
@@ -67,28 +67,42 @@ describe Clieop::Record do
|
|
67
67
|
end
|
68
68
|
|
69
69
|
it "should generate :invoice_name" do
|
70
|
-
record = Clieop::Record.new(:invoice_name,
|
70
|
+
record = Clieop::Payment::Record.new(:invoice_name,
|
71
71
|
:name => 'Payee'
|
72
72
|
)
|
73
73
|
record.to_clieop.should match(/0110BPayee /)
|
74
74
|
end
|
75
|
+
|
76
|
+
it "should generate :invoice_city" do
|
77
|
+
record = Clieop::Payment::Record.new(:invoice_city,
|
78
|
+
:city => 'Enschede'
|
79
|
+
)
|
80
|
+
record.to_clieop.should match(/0113BEnschede /)
|
81
|
+
end
|
75
82
|
|
76
83
|
it "should generate :payment_name" do
|
77
|
-
record = Clieop::Record.new(:payment_name,
|
84
|
+
record = Clieop::Payment::Record.new(:payment_name,
|
78
85
|
:name => 'Reciever'
|
79
86
|
)
|
80
87
|
record.to_clieop.should match(/0170BReciever /)
|
81
88
|
end
|
89
|
+
|
90
|
+
it "should generate :payment_city" do
|
91
|
+
record = Clieop::Payment::Record.new(:payment_city,
|
92
|
+
:city => 'Enschede'
|
93
|
+
)
|
94
|
+
record.to_clieop.should match(/0173BEnschede /)
|
95
|
+
end
|
82
96
|
|
83
97
|
it "should generate :transaction_reference" do
|
84
|
-
record = Clieop::Record.new(:transaction_reference,
|
98
|
+
record = Clieop::Payment::Record.new(:transaction_reference,
|
85
99
|
:reference_number => '201000505'
|
86
100
|
)
|
87
101
|
record.to_clieop.should match(/0150A201000505 /)
|
88
102
|
end
|
89
103
|
|
90
104
|
it "should generate :transaction_description" do
|
91
|
-
record = Clieop::Record.new(:transaction_description,
|
105
|
+
record = Clieop::Payment::Record.new(:transaction_description,
|
92
106
|
:description => 'Automatic Invoice Transaction'
|
93
107
|
)
|
94
108
|
record.to_clieop.should match(/0160AAutomatic Invoice Transaction /)
|
@@ -0,0 +1,26 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Clieop::ProcessInfo::Batch do
|
4
|
+
|
5
|
+
before :all do
|
6
|
+
@info_file = Clieop::ProcessInfo::File.from_file(File.open(File.join(File.dirname(__FILE__), '../../files/VERWINFO.txt')), true)
|
7
|
+
end
|
8
|
+
|
9
|
+
subject { @info_file.batches.first }
|
10
|
+
|
11
|
+
it "should add batch info to batches" do
|
12
|
+
subject.info.should == {:account_nr=>123456789, :total_amount=>nil, :transaction_count=>9, :test_code=>"T", :batch_type=>"A", :period_type=>nil, :period_length=>nil, :period_nr=>nil, :currency=>"EUR", :batch_identifier=>nil, :total_rejected=>9, :total_reversed=>0}
|
13
|
+
end
|
14
|
+
|
15
|
+
it "should have several transactions" do
|
16
|
+
subject.transactions.should have(9).things
|
17
|
+
end
|
18
|
+
|
19
|
+
it "should add records to the current transaction info" do
|
20
|
+
info_keys = subject.transactions.first.info.keys
|
21
|
+
[:euro_record, :reverse_info, :reject_info, :transaction_descriptions, :settle_info].each do |record_type|
|
22
|
+
info_keys.should include record_type
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Clieop::ProcessInfo::File do
|
4
|
+
|
5
|
+
before :each do
|
6
|
+
@verwinfo_file = File.open(File.join(File.dirname(__FILE__), '../../files/VERWINFO.txt'))
|
7
|
+
end
|
8
|
+
|
9
|
+
subject { Clieop::ProcessInfo::File.from_file(@verwinfo_file, true) }
|
10
|
+
|
11
|
+
it "should accept a VERWINFO file" do
|
12
|
+
subject.records.should_not be_empty
|
13
|
+
end
|
14
|
+
|
15
|
+
it "should accept a VERWINFO string" do
|
16
|
+
Clieop::ProcessInfo::File.from_string(@verwinfo_file.read).records.should_not be_empty
|
17
|
+
end
|
18
|
+
|
19
|
+
it "should parse file info" do
|
20
|
+
subject.info.should == {:filename=>"VERWINFO", :file_version=>"4.1", :date=> Time.parse('101015').send(:to_date), :run_number=>4432, :account_nr=>123456789, :serial_nr=>2, :file_nr=>1, :batches_count=>1, :next_file_nr=>0 }
|
21
|
+
end
|
22
|
+
|
23
|
+
it "should parse records" do
|
24
|
+
subject.records.should have(96).things # 96 lines + 1 EOS char
|
25
|
+
end
|
26
|
+
|
27
|
+
it "should parse batches" do
|
28
|
+
subject.batches.should have(2).things
|
29
|
+
end
|
30
|
+
|
31
|
+
it "should throw an error when no data can be parsed" do
|
32
|
+
lambda { Clieop::ProcessInfo::File.from_string('invalid data') }.should raise_error(RuntimeError, 'No valid records found in VERWINFO data')
|
33
|
+
end
|
34
|
+
|
35
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Clieop::ProcessInfo::Record do
|
4
|
+
|
5
|
+
subject { Clieop::ProcessInfo::Record.new('1000000000000000012307149201234567890123456789') }
|
6
|
+
|
7
|
+
it "should generate a hash of record codes to types" do
|
8
|
+
Clieop::ProcessInfo::Record::TYPE_FOR_RECORD_CODE.keys.should =~ [10, 990, 50, 51, 950, 100, 101, 105, 110, 115, 500, 503, 505, 510, 515, 600]
|
9
|
+
end
|
10
|
+
|
11
|
+
it "should parse alpha values" do
|
12
|
+
Clieop::ProcessInfo::Record.parse_alpha_value('test').should == 'test'
|
13
|
+
Clieop::ProcessInfo::Record.parse_alpha_value(' test ').should == 'test'
|
14
|
+
end
|
15
|
+
|
16
|
+
it "should parse numeric values" do
|
17
|
+
Clieop::ProcessInfo::Record.parse_numeric_value('000100').should == 100
|
18
|
+
end
|
19
|
+
|
20
|
+
it "should parse date values" do
|
21
|
+
Clieop::ProcessInfo::Record.parse_date_value('120304').should == Time.parse('120304').send(:to_date)
|
22
|
+
end
|
23
|
+
|
24
|
+
it "should properly parse the record line and set record attributes" do
|
25
|
+
subject.raw_line.should == '1000000000000000012307149201234567890123456789'
|
26
|
+
subject.type.should == :transaction_info
|
27
|
+
subject.definition.should == Clieop::ProcessInfo::Record::TYPE_DEFINITIONS[:transaction_info]
|
28
|
+
subject.data == {:record_code=>100, :amount=>0, :from_account=>123071492, :to_account=>123456789, :entry_account=>123456789, :from_account_verification_nr=>0, :transaction_reference_ok=>nil}
|
29
|
+
end
|
30
|
+
|
31
|
+
|
32
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Clieop::ProcessInfo::Transaction do
|
4
|
+
|
5
|
+
before :all do
|
6
|
+
@info_file = Clieop::ProcessInfo::File.from_file(File.open(File.join(File.dirname(__FILE__), '../../files/VERWINFO.txt')), true)
|
7
|
+
end
|
8
|
+
|
9
|
+
subject { @info_file.batches.first.transactions.first }
|
10
|
+
|
11
|
+
it "should have transaction info" do
|
12
|
+
subject.info.except(:euro_record, :reverse_info, :reject_info, :transaction_descriptions, :settle_info).should == { :amount => BigDecimal('0.0'), :from_account=>123071492, :to_account=>123456789, :entry_account=>123456789, :from_account_verification_nr=>nil, :transaction_reference_ok=>nil }
|
13
|
+
end
|
14
|
+
|
15
|
+
it "should contain transaction info records" do
|
16
|
+
info_keys = subject.info.keys
|
17
|
+
[:euro_record, :reverse_info, :reject_info, :transaction_descriptions, :settle_info].each do |record_type|
|
18
|
+
info_keys.should include record_type
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
end
|
data/spec/clieop_spec.rb
CHANGED
@@ -4,7 +4,7 @@ describe Clieop do
|
|
4
4
|
|
5
5
|
it "should test basic invoice usage" do
|
6
6
|
|
7
|
-
file = Clieop::File.new
|
7
|
+
file = Clieop::Payment::File.new
|
8
8
|
|
9
9
|
file.invoice_batch({:description => 'some description', :account_nr => 123, :account_owner => 'me'}) do |batch|
|
10
10
|
|
@@ -24,7 +24,7 @@ describe Clieop do
|
|
24
24
|
end
|
25
25
|
|
26
26
|
it "should format the checksum" do
|
27
|
-
batch = Clieop::Batch.new({:description => "Description", :account_nr => "Account Nr", :account_owner => "Account Owner" } )
|
27
|
+
batch = Clieop::Payment::Batch.new({:description => "Description", :account_nr => "Account Nr", :account_owner => "Account Owner" } )
|
28
28
|
batch.account_checksum('1234567890123').should eql('4567890123')
|
29
29
|
batch.account_checksum('7654321').should eql('7654321')
|
30
30
|
end
|
@@ -0,0 +1,97 @@
|
|
1
|
+
010VERWINFOA4.110101544320123456789000201
|
2
|
+
0500123456789 0000000000000270000000025TA
|
3
|
+
051EUR
|
4
|
+
1000000000000000012307149201234567890123456789
|
5
|
+
101EUR00000000000000000000000000
|
6
|
+
105CI:81:40 0007002885114827698
|
7
|
+
110INCASSO TEST COMPANY
|
8
|
+
110AUTO INCASSO ABONNEMENT
|
9
|
+
110T.B.V. ABONNEMENT ADVIES ABONNEM
|
10
|
+
50001 4432101015
|
11
|
+
6001021BEDRAG NUL NIET TOEGESTAAN
|
12
|
+
1000000000000000012339666401234567890123456789
|
13
|
+
101EUR00000000000000000000000000
|
14
|
+
105CI:80:44 0007002885114827701
|
15
|
+
110INCASSO TEST COMPANY
|
16
|
+
110AUTO INCASSO ABONNEMENT
|
17
|
+
110T.B.V. ABONNEMENT BEST-OFF ABON
|
18
|
+
50001 4432101015
|
19
|
+
6001021BEDRAG NUL NIET TOEGESTAAN
|
20
|
+
1000000000000000012307149201234567890123456789
|
21
|
+
101EUR00000000000000000000000000
|
22
|
+
105CI:81:45 0007002885114827719
|
23
|
+
110INCASSO TEST COMPANY
|
24
|
+
110AUTO INCASSO ABONNEMENT
|
25
|
+
110T.B.V. ABONNEMENT ADVIES ABONNEM
|
26
|
+
50001 4432101015
|
27
|
+
6001021BEDRAG NUL NIET TOEGESTAAN
|
28
|
+
1000000000000000012339666401234567890123456789
|
29
|
+
101EUR00000000000000000000000000
|
30
|
+
105CI:80:51 0007002885114827727
|
31
|
+
110INCASSO TEST COMPANY
|
32
|
+
110AUTO INCASSO ABONNEMENT
|
33
|
+
110T.B.V. ABONNEMENT BEST-OFF ABON
|
34
|
+
50001 4432101015
|
35
|
+
6001021BEDRAG NUL NIET TOEGESTAAN
|
36
|
+
1000000000000000012307149201234567890123456789
|
37
|
+
101EUR00000000000000000000000000
|
38
|
+
105CI:81:52 0007002885114827735
|
39
|
+
110INCASSO TEST COMPANY
|
40
|
+
110AUTO INCASSO ABONNEMENT
|
41
|
+
110T.B.V. ABONNEMENT ADVIES ABONNEM
|
42
|
+
50001 4432101015
|
43
|
+
6001021BEDRAG NUL NIET TOEGESTAAN
|
44
|
+
1000000000000000012339666401234567890123456789
|
45
|
+
101EUR00000000000000000000000000
|
46
|
+
105CI:80:56 0007002885114827743
|
47
|
+
110INCASSO TEST COMPANY
|
48
|
+
110AUTO INCASSO ABONNEMENT
|
49
|
+
110T.B.V. ABONNEMENT BEST-OFF ABON
|
50
|
+
50001 4432101015
|
51
|
+
6001021BEDRAG NUL NIET TOEGESTAAN
|
52
|
+
1000000000000000012307149201234567890123456789
|
53
|
+
101EUR00000000000000000000000000
|
54
|
+
105CI:81:57 0007002885114827751
|
55
|
+
110INCASSO TEST COMPANY
|
56
|
+
110AUTO INCASSO ABONNEMENT
|
57
|
+
110T.B.V. ABONNEMENT ADVIES ABONNEM
|
58
|
+
50001 4432101015
|
59
|
+
6001021BEDRAG NUL NIET TOEGESTAAN
|
60
|
+
1000000000000000012339666401234567890123456789
|
61
|
+
101EUR00000000000000000000000000
|
62
|
+
105CI:80:60 0007002885114827761
|
63
|
+
110INCASSO TEST COMPANY
|
64
|
+
110AUTO INCASSO ABONNEMENT
|
65
|
+
110T.B.V. ABONNEMENT BEST-OFF ABON
|
66
|
+
50001 4432101015
|
67
|
+
6001021BEDRAG NUL NIET TOEGESTAAN
|
68
|
+
1000000000000000012307149201234567890123456789
|
69
|
+
101EUR00000000000000000000000000
|
70
|
+
105CI:81:61 0007002885114827778
|
71
|
+
110INCASSO TEST COMPANY
|
72
|
+
110AUTO INCASSO ABONNEMENT
|
73
|
+
110T.B.V. ABONNEMENT ADVIES ABONNEM
|
74
|
+
50001 4432101015
|
75
|
+
6001021BEDRAG NUL NIET TOEGESTAAN
|
76
|
+
950000000900000000000009
|
77
|
+
0500123456789 0000000000000270000000025TA
|
78
|
+
051EUR
|
79
|
+
1000000000000000012307149201234567890123456789
|
80
|
+
101EUR00000000000000000000000000
|
81
|
+
105CI:81:40 0007002885114827698
|
82
|
+
110INCASSO TEST COMPANY
|
83
|
+
110AUTO INCASSO ABONNEMENT
|
84
|
+
110T.B.V. ABONNEMENT ADVIES ABONNEM
|
85
|
+
50001 4432101015
|
86
|
+
6001021BEDRAG NUL NIET TOEGESTAAN
|
87
|
+
1000000000000000012339666401234567890123456789
|
88
|
+
101EUR00000000000000000000000000
|
89
|
+
105CI:80:44 0007002885114827701
|
90
|
+
110INCASSO TEST COMPANY
|
91
|
+
110AUTO INCASSO ABONNEMENT
|
92
|
+
110T.B.V. ABONNEMENT BEST-OFF ABON
|
93
|
+
50001 4432101015
|
94
|
+
6001021BEDRAG NUL NIET TOEGESTAAN
|
95
|
+
950000000900000000000009
|
96
|
+
99000000100
|
97
|
+
|