king_dtaus 2.0.0.pre → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
data/spec/dtazv_spec.rb CHANGED
@@ -6,42 +6,9 @@ require 'spec_helper'
6
6
  describe KingDta::Dtazv do
7
7
 
8
8
  before :each do
9
- @dtazv = KingDta::Dtazv.new(Date.today)
10
- @dudes_konto = dudes_konto
11
- @dalai_lamas_account = dalai_lamas_account
12
-
13
- @dtazv.account = KingDta::Account.new(
14
- :account_number => @dudes_konto.account_number,
15
- :bank_number => @dudes_konto.bank_number,
16
- :client_name => @dudes_konto.client_name,
17
- :client_number => @dudes_konto.client_number,
18
- :bank_street => @dudes_konto.account_street,
19
- :bank_city => @dudes_konto.account_city,
20
- :bank_zip_code => @dudes_konto.account_zip_code,
21
- :bank_name => @dudes_konto.bank_name,
22
- :client_street => @dudes_konto.client_street,
23
- :client_city => @dudes_konto.client_city,
24
- :client_zip_code => @dudes_konto.client_zip_code,
25
- :bank_country_code => @dudes_konto.bank_country_code,
26
- :client_country_code => @dudes_konto.client_country_code
27
- )
28
-
29
- @fidel_castros_booking = KingDta::Booking.new(KingDta::Account.new(
30
- :account_number => @dalai_lamas_account.account_number,
31
- :bank_number => @dalai_lamas_account.bank_number,
32
- :client_name => @dalai_lamas_account.client_name,
33
- :client_number => @dalai_lamas_account.client_number,
34
- :bank_street => @dalai_lamas_account.account_street,
35
- :bank_city => @dalai_lamas_account.account_city,
36
- :bank_zip_code => @dalai_lamas_account.account_zip_code,
37
- :bank_name => @dalai_lamas_account.bank_name,
38
- :client_street => @dalai_lamas_account.client_street,
39
- :client_city => @dalai_lamas_account.client_city,
40
- :client_zip_code => @dalai_lamas_account.client_zip_code,
41
- :bank_country_code => @dalai_lamas_account.bank_country_code,
42
- :client_country_code => @dalai_lamas_account.client_country_code
43
- ), 220.25)
44
-
9
+ @dtazv = KingDta::Dtazv.new(Date.parse('2011-08-28'))
10
+ @dtazv.account = KingDta::Account.new sender_opts
11
+ @booking = KingDta::Booking.new( KingDta::Account.new( receiver_opts ), 220.25)
45
12
  end
46
13
 
47
14
  it "should init without values" do
@@ -62,42 +29,26 @@ describe KingDta::Dtazv do
62
29
 
63
30
  it "should create file" do
64
31
  @dtazv.default_text = 'Default Verwendungszweck'
65
- 6.times { @dtazv.add(@fidel_castros_booking) }
32
+ 6.times { @dtazv.add(@booking) }
66
33
  # create test output file in spec dir
67
34
  filename = File.join(File.dirname(__FILE__), 'test_output.dta')
68
35
  @dtazv.create_file(filename)
69
36
  str = ''
70
- File.open(filename, 'r').each do |ln|
71
- str << ln
72
- end
37
+ File.open(filename, 'r').each { |ln| str << ln }
73
38
  str.length.should == 5120
74
39
  #remove testfile
75
40
  File.delete(filename)
76
41
  end
77
42
 
78
43
  it "should not add a booking if closed" do
79
- @dtazv.add(@fidel_castros_booking)
44
+ @dtazv.add(@booking)
80
45
  @dtazv.create
81
- lambda{ @dtazv.add(@fidel_castros_booking) }.should raise_error(KingDta::Exception)
46
+ lambda{ @dtazv.add(@booking) }.should raise_error(KingDta::Exception)
82
47
  end
83
48
 
84
49
  it "should not add a booking if closed" do
85
- @dtazv.add(@fidel_castros_booking)
86
- negative_booking = KingDta::Booking.new(KingDta::Account.new(
87
- :account_number => @dalai_lamas_account.account_number,
88
- :bank_number => @dalai_lamas_account.bank_number,
89
- :client_name => @dalai_lamas_account.client_name,
90
- :client_number => @dalai_lamas_account.client_number,
91
- :bank_street => @dalai_lamas_account.account_street,
92
- :bank_city => @dalai_lamas_account.account_city,
93
- :bank_zip_code => @dalai_lamas_account.account_zip_code,
94
- :bank_name => @dalai_lamas_account.bank_name,
95
- :client_street => @dalai_lamas_account.client_street,
96
- :client_city => @dalai_lamas_account.client_city,
97
- :client_zip_code => @dalai_lamas_account.client_zip_code,
98
- :bank_country_code => @dalai_lamas_account.bank_country_code,
99
- :client_country_code => @dalai_lamas_account.client_country_code
100
- ), -220.25)
50
+ @dtazv.add(@booking)
51
+ negative_booking = KingDta::Booking.new(KingDta::Account.new( receiver_opts ), -220.25)
101
52
  lambda{ @dtazv.add(negative_booking) }.should raise_error(KingDta::Exception)
102
53
  end
103
54
 
@@ -105,53 +56,34 @@ describe KingDta::Dtazv do
105
56
  lambda{ @dtazv.create}.should raise_error(KingDta::Exception)
106
57
  end
107
58
 
108
- # TODO
109
- # it "should create the whole dta string with a single booking" do
110
- # @dtaus.default_text = 'Default verwendungszweck'
111
- # @dtaus.add(@booking)
112
- # str = @dtaus.create
113
- # str.length.should == 512
114
- # str.should include(@kto1.name.upcase)
115
- # str.should include(@kto2.name.upcase)
116
- # str.should include(@dtaus.default_text.upcase)
117
- # out = "0128ALK3704004400000000GIMME YOUR MONEY AG #{Date.today.strftime("%d%m%y")} 78289700370000000000 #{Date.today.strftime("%d%m%Y")} 1"+
118
- # "0187C00000000370400440002787777000000000000005000 0000000000037040044782897003700000022025 PETER & MAY GMBH GIMME YOUR MONEY AGDEFAULT VERWENDUNGSZWECK 1 00 "+
119
- # "0128E 0000001000000000000000000000002787777000000000370400440000000022025 "
120
- # str.should == out
121
- # end
59
+ it "should create the whole dta string with a single booking" do
60
+ @dtazv.add(@booking)
61
+ str = @dtazv.create
62
+ str.length.should == 1280
63
+ str.should include(receiver_opts[:owner_name].upcase)
64
+ out = "0256Q370502991326049634JAN KUS MEINE EINE STRASSE 2 51063 MEINE KOELN 11082801110828N0000000000 0768T37050299EUR132604963411082800000000 0000000000COBADEFF366 DE DALAI LAMA BUSH-AVENUE 55 445555 INDIA /PL10105013151000002308622378 EUR00000000000220250 00000000 0013 0 000256Z000000000000220000000000000001 "
65
+ str.should == out
66
+ end
122
67
 
123
- # TODO
124
- # it "should create whole dta string with long booking text in extension" do
125
- # @dtaus.add(@booking)
126
- # @dtaus.bookings.first.text = 'Rgn R-3456-0102220 Monatsbeitrag 08/10 Freelancer Version Vielen Dank Ihre SalesKing GmbH'
127
- # str = @dtaus.create
128
- # str.length.should == 640
129
- # str.should include(@kto2.name.upcase)
130
- # out = "0128ALK3704004400000000GIMME YOUR MONEY AG #{Date.today.strftime("%d%m%y")} 78289700370000000000 #{Date.today.strftime("%d%m%Y")} 1"+
131
- # "0274C00000000370400440002787777000000000000005000 0000000000037040044782897003700000022025 PETER & MAY GMBH GIMME YOUR MONEY AGRGN R-3456-0102220 MONATSBE1 0302ITRAG 08/10 FREELANCER VERS02ION VIELEN DANK IHRE SALESK 02ING GMBH "+
132
- # "0128E 0000001000000000000000000000002787777000000000370400440000000022025 "
133
- # str.should == out
134
- # end
68
+ it "should create whole dta string with long booking text in extension" do
69
+ @dtazv.add(@booking)
70
+ @dtazv.bookings.first.text = 'Rgn R-3456-0102220 Monatsbeitrag 08/10 Freelancer Version Vielen Dank Ihre SalesKing GmbH'
71
+ str = @dtazv.create
72
+ str.length.should == 1280
73
+ str.should include(receiver_opts[:owner_name].upcase)
74
+ out = "0256Q370502991326049634JAN KUS MEINE EINE STRASSE 2 51063 MEINE KOELN 11082801110828N0000000000 0768T37050299EUR132604963411082800000000 0000000000COBADEFF366 DE DALAI LAMA BUSH-AVENUE 55 445555 INDIA /PL10105013151000002308622378 EUR00000000000220250RGN R-3456-0102220 MONATSBEITRAG 08/10 FREELANCER VERSION VIELEN DANK IHRE SALESKING GMBH 00000000 0013 0 000256Z000000000000220000000000000001 "
75
+ str.should == out
76
+ end
135
77
 
136
- # TODO
137
- # it "should create the whole dta string with a lot of bookings" do
138
- # @dtaus.default_text = 'Default Verwendungszweck'
139
- # 6.times { @dtaus.add(@booking) }
140
- # str = @dtaus.create
141
- # str.length.should == 1792
142
- # str.should include(@kto1.name.upcase)
143
- # str.should include(@kto2.name.upcase)
144
- # str.should include(@dtaus.default_text.upcase)
145
- # out = "0128ALK3704004400000000GIMME YOUR MONEY AG #{Date.today.strftime("%d%m%y")} 78289700370000000000 #{Date.today.strftime("%d%m%Y")} 1"+
146
- # "0187C00000000370400440002787777000000000000005000 0000000000037040044782897003700000022025 PETER & MAY GMBH GIMME YOUR MONEY AGDEFAULT VERWENDUNGSZWECK 1 00 "+
147
- # "0187C00000000370400440002787777000000000000005000 0000000000037040044782897003700000022025 PETER & MAY GMBH GIMME YOUR MONEY AGDEFAULT VERWENDUNGSZWECK 1 00 "+
148
- # "0187C00000000370400440002787777000000000000005000 0000000000037040044782897003700000022025 PETER & MAY GMBH GIMME YOUR MONEY AGDEFAULT VERWENDUNGSZWECK 1 00 "+
149
- # "0187C00000000370400440002787777000000000000005000 0000000000037040044782897003700000022025 PETER & MAY GMBH GIMME YOUR MONEY AGDEFAULT VERWENDUNGSZWECK 1 00 "+
150
- # "0187C00000000370400440002787777000000000000005000 0000000000037040044782897003700000022025 PETER & MAY GMBH GIMME YOUR MONEY AGDEFAULT VERWENDUNGSZWECK 1 00 "+
151
- # "0187C00000000370400440002787777000000000000005000 0000000000037040044782897003700000022025 PETER & MAY GMBH GIMME YOUR MONEY AGDEFAULT VERWENDUNGSZWECK 1 00 "+
152
- # "0128E 0000006000000000000000000000016726662000000002222402640000000132150 "
153
- # str.should == out
154
- # end
78
+ it "should create the whole dta string with a lot of bookings" do
79
+ 6.times { @dtazv.add(@booking) }
80
+ str = @dtazv.create
81
+ str.length.should == 5120
82
+ str.should include(receiver_opts[:owner_name].upcase)
83
+ str.should include(sender_opts[:owner_name].upcase)
84
+ out = "0256Q370502991326049634JAN KUS MEINE EINE STRASSE 2 51063 MEINE KOELN 11082801110828N0000000000 0768T37050299EUR132604963411082800000000 0000000000COBADEFF366 DE DALAI LAMA BUSH-AVENUE 55 445555 INDIA /PL10105013151000002308622378 EUR00000000000220250 00000000 0013 0 000768T37050299EUR132604963411082800000000 0000000000COBADEFF366 DE DALAI LAMA BUSH-AVENUE 55 445555 INDIA /PL10105013151000002308622378 EUR00000000000220250 00000000 0013 0 000768T37050299EUR132604963411082800000000 0000000000COBADEFF366 DE DALAI LAMA BUSH-AVENUE 55 445555 INDIA /PL10105013151000002308622378 EUR00000000000220250 00000000 0013 0 000768T37050299EUR132604963411082800000000 0000000000COBADEFF366 DE DALAI LAMA BUSH-AVENUE 55 445555 INDIA /PL10105013151000002308622378 EUR00000000000220250 00000000 0013 0 000768T37050299EUR132604963411082800000000 0000000000COBADEFF366 DE DALAI LAMA BUSH-AVENUE 55 445555 INDIA /PL10105013151000002308622378 EUR00000000000220250 00000000 0013 0 000768T37050299EUR132604963411082800000000 0000000000COBADEFF366 DE DALAI LAMA BUSH-AVENUE 55 445555 INDIA /PL10105013151000002308622378 EUR00000000000220250 00000000 0013 0 000256Z000000000001320000000000000006 "
85
+ str.should == out
86
+ end
155
87
 
156
88
  end
157
89
 
@@ -159,127 +91,84 @@ describe "KingDta::DtazvSegments" do
159
91
 
160
92
  before :each do
161
93
  @date = Date.today
162
- @dudes_dtazv_export = KingDta::Dtazv.new(@date)
163
- @dudes_konto = dudes_konto
164
- @dalai_lamas_account = dalai_lamas_account
165
- @dudes_dtazv_export.account = KingDta::Account.new(
166
- :account_number => @dudes_konto.account_number,
167
- :bank_number => @dudes_konto.bank_number,
168
- :client_name => @dudes_konto.client_name,
169
- :bank_name => @dudes_konto.bank_name,
170
- :client_number => @dudes_konto.client_number,
171
- :bank_street => @dudes_konto.account_street,
172
- :bank_city => @dudes_konto.account_city,
173
- :bank_zip_code => @dudes_konto.account_zip_code,
174
- :client_street => @dudes_konto.client_street,
175
- :client_city => @dudes_konto.client_city,
176
- :client_zip_code => @dudes_konto.client_zip_code,
177
- :bank_country_code => @dudes_konto.bank_country_code,
178
- :client_country_code => @dudes_konto.client_country_code
179
- )
180
-
181
- @fidel_castros_booking = KingDta::Booking.new(KingDta::Account.new(
182
- :account_number => @dalai_lamas_account.account_number,
183
- :bank_number => @dalai_lamas_account.bank_number,
184
- :client_name => @dalai_lamas_account.client_name,
185
- :bank_name => @dalai_lamas_account.bank_name,
186
- :client_number => @dalai_lamas_account.client_number,
187
- :bank_street => @dalai_lamas_account.account_street,
188
- :bank_city => @dalai_lamas_account.account_city,
189
- :bank_zip_code => @dalai_lamas_account.account_zip_code,
190
- :client_street => @dalai_lamas_account.client_street,
191
- :client_city => @dalai_lamas_account.client_city,
192
- :client_zip_code => @dalai_lamas_account.client_zip_code,
193
- :bank_country_code => @dalai_lamas_account.bank_country_code,
194
- :client_country_code => @dalai_lamas_account.client_country_code
195
- ), 220.25)
196
-
197
- @bookings = []
198
- @bookings << @fidel_castros_booking
94
+ @dtazv = KingDta::Dtazv.new(@date)
95
+ @dtazv.account = KingDta::Account.new( sender_opts)
96
+ @booking = KingDta::Booking.new(KingDta::Account.new( receiver_opts ), 220.25)
97
+
98
+ @bookings = [@booking]
199
99
  end
200
100
 
201
101
 
202
102
  # P SEGMENT NOT IMPLEMENTED AND USED YET
203
103
  # it "should return the proper P segment" do
204
- # @dudes_dtazv_export.add_p.should == "0256P37040044 Commerzbank K\303\266ln 5th avenue 55323 los angeles11060801 "
104
+ # @dtazv.add_p.should == "0256P37040044 Commerzbank K\303\266ln 5th avenue 55323 los angeles11060801 "
205
105
  # end
206
106
 
207
107
  # it "should return the proper length of P segment" do
208
- # @dudes_dtazv_export.add_p.size.should == 256
108
+ # @dtazv.add_p.size.should == 256
209
109
  # end
210
110
 
211
111
  it "should return the proper Q segment" do
212
- @dudes_dtazv_export.add_q.should == "0256Q370502991326049634JAN KUS MEINE EINE STRASSE 2 51063 MEINE KOELN #{@date.strftime("%y%m%d")}01#{@date.strftime("%y%m%d")}N0000000000 "
112
+ @dtazv.add_q.should == "0256Q370502991326049634JAN KUS MEINE EINE STRASSE 2 51063 MEINE KOELN #{@date.strftime("%y%m%d")}01#{@date.strftime("%y%m%d")}N0000000000 "
213
113
  end
214
114
 
215
115
  it "should return the proper length of P segment" do
216
- @dudes_dtazv_export.add_q.size.should == 256
116
+ @dtazv.add_q.size.should == 256
217
117
  end
218
118
 
219
- # it "should create header" do
220
- # str = @dtaus.add_a
221
- # str.length.should == 128
222
- # out = "0128ALK3704004400000000GIMME YOUR MONEY AG #{Date.today.strftime("%d%m%y")} 78289700370000000000 #{Date.today.strftime("%d%m%Y")} 1"
223
- # str.should == out
224
- # #60-70 kontonummer mit nullen aufgefüllt - hier nicht da ktnr == 10 stellen
225
- # str[60...70].should == "#{test_kto1.nr}"
226
- # str.should include(test_kto1.blz)
227
- # end
228
-
229
119
  it "should return the proper T segment" do
230
- @dudes_dtazv_export.add_t(@fidel_castros_booking).should == "0768T37050299EUR1326049634#{@date.strftime("%y%m%d")}00000000 0000000000MARKF1100 DE FIDEL CASTRO BUSH-AVENUE 55 445555 KUBA /GR1601101250000000012300695 EUR00000000000220250 00000000 0013 0 00"
120
+ @dtazv.add_t(@booking).should == "0768T37050299EUR1326049634#{@date.strftime("%y%m%d")}00000000 0000000000COBADEFF366 DE DALAI LAMA BUSH-AVENUE 55 445555 INDIA /PL10105013151000002308622378 EUR00000000000220250 00000000 0013 0 00"
231
121
  end
232
122
 
233
123
  it "should return the proper length of T segment" do
234
- @dudes_dtazv_export.add_t(@fidel_castros_booking).size.should == 768
124
+ @dtazv.add_t(@booking).size.should == 768
235
125
  end
236
126
 
237
- # TODO
238
- # it "should create c-sektion with booking text at 19" do
239
- # @dtaus.add(@booking)
240
- # @dtaus.bookings.first.text = 'SalesKing Monatsbeitrag 08/10 Freelancer Version'
241
- # @dtaus.add_c(@booking)
242
- # str = @dtaus.dta_string
243
- # str.length.should == 256
244
- # str.should include(@kto2.name.upcase)
245
- # out = "0216C00000000370400440002787777000000000000005000 0000000000037040044782897003700000022025 PETER & MAY GMBH GIMME YOUR MONEY AGSALESKING MONATSBEITRAG 08/1 010210 FREELANCER VERSION "
246
- # str.should == out
247
- # end
248
-
249
127
  # V SEGMENT NOT IMPLEMENTED AND USED YET
250
128
  # it "should return the proper V segment" do
251
- # @dudes_dtazv_export.add_t.should == "..........."
129
+ # @dtazv.add_t.should == "..........."
252
130
  # end
253
131
 
254
132
  # it "should return the proper length of V segment" do
255
- # @dudes_dtazv_export.add_t.size.should == 256
133
+ # @dtazv.add_t.size.should == 256
256
134
  # end
257
135
 
258
136
  # W SEGMENT NOT IMPLEMENTED AND USED YET
259
137
  # it "should return the proper W segment" do
260
- # @dudes_dtazv_export.add_t.should == "..........."
138
+ # @dtazv.add_t.should == "..........."
261
139
  # end
262
140
 
263
141
  # it "should return the proper length of W segment" do
264
- # @dudes_dtazv_export.add_t.size.should == 256
142
+ # @dtazv.add_t.size.should == 256
265
143
  # end
266
144
 
267
145
  it "should return the proper Y segment" do
268
- @dudes_dtazv_export.add_y(@bookings).should == "0256Y000000000000000000000000000000000000000000000000000000000000000000000001 "
146
+ @dtazv.add_y(@bookings).should == "0256Y000000000000000000000000000000000000000000000000000000000000000000000001 "
269
147
  end
270
148
 
271
149
  it "should return the proper length of Y segment" do
272
- @dudes_dtazv_export.add_y(@bookings).size.should == 256
150
+ @dtazv.add_y(@bookings).size.should == 256
273
151
  end
274
152
 
275
153
  it "should return the proper Z segment" do
276
- @dudes_dtazv_export.add_z(@bookings).should == "0256Z000000000000220000000000000001 "
154
+ @dtazv.add_z(@bookings).should == "0256Z000000000000220000000000000001 "
277
155
  end
278
156
 
279
157
  it "should return the proper length of Z segment" do
280
- @dudes_dtazv_export.add_z(@bookings).size.should == 256
158
+ @dtazv.add_z(@bookings).size.should == 256
281
159
  end
282
160
 
161
+ # TODO
162
+ # it "should create header" do
163
+ # str = @dtaus.add_a
164
+ # str.length.should == 128
165
+ # out = "0128ALK3704004400000000GIMME YOUR MONEY AG #{Date.today.strftime("%d%m%y")} 78289700370000000000 #{Date.today.strftime("%d%m%Y")} 1"
166
+ # str.should == out
167
+ # #60-70 kontonummer mit nullen aufgefüllt - hier nicht da ktnr == 10 stellen
168
+ # str[60...70].should == "#{test_kto1.nr}"
169
+ # str.should include(test_kto1.blz)
170
+ # end
171
+
283
172
  # TODO
284
173
  # it "should create c-sektion with default booking text" do
285
174
  # @dtaus.default_text = 'Default verwendungszweck'
@@ -291,4 +180,16 @@ describe "KingDta::DtazvSegments" do
291
180
  # str.should == out
292
181
  # end
293
182
 
183
+ # TODO
184
+ # it "should create c-sektion with booking text at 19" do
185
+ # @dtaus.add(@booking)
186
+ # @dtaus.bookings.first.text = 'SalesKing Monatsbeitrag 08/10 Freelancer Version'
187
+ # @dtaus.add_c(@booking)
188
+ # str = @dtaus.dta_string
189
+ # str.length.should == 256
190
+ # str.should include(@kto2.name.upcase)
191
+ # out = "0216C00000000370400440002787777000000000000005000 0000000000037040044782897003700000022025 PETER & MAY GMBH GIMME YOUR MONEY AGSALESKING MONATSBEITRAG 08/1 010210 FREELANCER VERSION "
192
+ # str.should == out
193
+ # end
194
+
294
195
  end
data/spec/spec_helper.rb CHANGED
@@ -11,103 +11,80 @@ require "king_dtaus"
11
11
  require 'rspec'
12
12
  require 'ostruct'
13
13
  require 'date'
14
- require 'mocha'
15
14
 
16
15
  RSpec.configure do |config|
17
16
  end
18
17
 
19
-
20
- #Filename der eigenen Kontodaten
21
- # Beispiel:
22
- # typ:LK
23
- # blz:99988811
24
- # konto:123456
25
- # bank:Nord-Ostschwaebische Sandbank
26
- #
27
- # name:Jodelverein Holladrioe 1863 e.V.
28
- # zweck:Mitgliedsbeitrag 2003
29
- # Der Typ ist LK oder GK. Siehe Option -t
30
- # zweck ist ein optionaler Default-Text, der verwendet wird,
31
- # falls eine Buchung keinen Text hat.
32
- # Die Adressdaten der Bank sind optional und werdezum erzeugen
33
- # des Begleitblatts verwendet
34
- # bankstrasse:Kieselweg 3
35
- # bankplz:0815
36
- # bankort:Felsblock
37
-
38
- def dudes_konto
39
- opts = {
40
- :account_number => '1326049634',
41
- :bank_number => '37050299',
42
- :bank_name => 'Kreissparkasse Köln',
43
- :zweck => 'Monatsbeitrag',
44
- :account_street => "Bank Eine Straße 2",
45
- :account_city => "Bank Köln",
46
- :account_zip_code => "51063",
47
- :client_number => "",
48
- :client_name =>'Jan Kus',
49
- :client_street => "Meine Eine Straße 2",
50
- :client_city => "Meine Köln",
51
- :client_zip_code => "51063",
52
- :bank_country_code => "DE",
53
- :client_country_code => "DE"
54
- }
55
- TestKonto.new(opts)
18
+ # a full account, address infos are only needed if BIC or IBAN is unknown
19
+ def sender_opts
20
+ {
21
+ :bank_account_number => '1326049634',
22
+ :bank_number => '37050299',
23
+ :bank_name => 'Kreissparkasse Köln',
24
+ :bank_street => "Bank Eine Straße 2",
25
+ :bank_city => "Bank Köln",
26
+ :bank_zip => "51063",
27
+ :bank_country_code => "DE",
28
+ :owner_number => "",
29
+ :owner_name =>'Jan Kus',
30
+ :owner_street => "Meine Eine Straße 2",
31
+ :owner_city => "Meine Köln",
32
+ :owner_zip_code => "51063",
33
+ :owner_country_code => "DE"
34
+ }
56
35
  end
57
36
 
58
- def dalai_lamas_account
59
- opts = {
60
- :account_number => 'GR1601101250000000012300695',
61
- :bank_number => 'MARKF1100',
62
- :bank_name => 'Kuba National Bank',
63
- :zweck => 'President-Fee',
64
- :account_street => "5th avenue",
65
- :account_city => "los angeles",
66
- :account_zip_code => "55323",
67
- :client_number => "",
68
- :client_name =>'Fidel Castro',
69
- :client_street => "Bush-Avenue 55",
70
- :client_city => "Kuba",
71
- :client_zip_code => "066600",
72
- :client_zip_code => "445555",
73
- :bank_country_code => "DE",
74
- :client_country_code => "DE"
75
- }
76
- TestKonto.new(opts)
37
+ def receiver_opts
38
+ {
39
+ :bank_iban => 'PL10105013151000002308622378',
40
+ :bank_bic => 'COBADEFF366',
41
+ :owner_name =>'Dalai Lama',
42
+ :owner_street => "Bush-Avenue 55",
43
+ :owner_city => "India",
44
+ :owner_zip_code => "445555",
45
+ :owner_country_code => "DE" # actually wrong since iban is in poland
46
+ # only needed if no bic present
47
+ # :bank_name => 'Dalai Lamas Bank',
48
+ # :bank_street => "5th avenue",
49
+ # :bank_city => "Pulheim",
50
+ # :bank_zip => "55323",
51
+ # :owner_number => "",
52
+ # :bank_country_code => "DE",
53
+ }
77
54
  end
78
55
 
79
56
  def test_kto1
80
57
  opts = {
81
- :account_number => '7828970037',
58
+ :bank_account_number => '7828970037',
82
59
  :bank_number => '37040044',
83
- :client_name =>'Gimme your Money AG',
60
+ :owner_name =>'Gimme your Money AG',
84
61
  :bank_name => 'Commerzbank Köln',
85
62
  :zweck => 'Monatsbeitrag',
86
- :client_number => ""
63
+ :owner_number => ""
87
64
  }
88
65
  TestKonto.new(opts)
89
66
  end
90
67
 
91
68
  def test_kto2
92
69
  opts = {
93
- :account_number => '2787777',
70
+ :bank_account_number => '2787777',
94
71
  :bank_number => '37040044',
95
- :client_name =>'Peter & May GmbH',
72
+ :owner_name =>'Peter & May GmbH',
96
73
  :bank_name => 'Commerzbank Köln',
97
74
  :zweck => 'Monatsbeitrag',
98
- :client_number => ""
75
+ :owner_number => ""
99
76
  }
100
77
  TestKonto.new(opts)
101
78
  end
102
79
 
103
80
  def test_kto3
104
81
  opts = {
105
- :account_number => '2787777',
82
+ :bank_account_number => '2787777',
106
83
  :bank_number => '37040044',
107
- :client_name =>'Andrew Müller',
84
+ :owner_name =>'Andrew Müller',
108
85
  :bank_name => 'Commerzbank Köln',
109
86
  :zweck => 'Monatsbeitrag',
110
- :client_number => ""
87
+ :owner_number => ""
111
88
  }
112
89
  TestKonto.new(opts)
113
90
  end