dwolla-ruby 2.5.1 → 2.5.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,424 +1,424 @@
1
- require 'stringio'
2
- require 'test/unit'
3
- require 'dwolla'
4
- require 'mocha/setup'
5
- include Mocha
6
-
7
- #monkeypatch request methods
8
- module Dwolla
9
- @mock_rest_client = nil
10
-
11
- def self.mock_rest_client=(mock_client)
12
- @mock_rest_client = mock_client
13
- end
14
-
15
- def self.execute_request(opts)
16
- get_params = (opts[:headers] || {})[:params]
17
- post_params = opts[:payload]
18
-
19
- case opts[:method]
20
- when :get then @mock_rest_client.get opts[:url], get_params, post_params
21
- when :post then @mock_rest_client.post opts[:url], get_params, post_params
22
- end
23
- end
24
- end
25
-
26
- def test_response(body, code=200)
27
- # When an exception is raised, restclient clobbers method_missing. Hence we
28
- # can't just use the stubs interface.
29
- body = MultiJson.dump(body) if !(body.kind_of? String)
30
- m = mock
31
- m.instance_variable_set('@dwolla_values', { :body => body, :code => code })
32
- def m.body; @dwolla_values[:body]; end
33
- def m.code; @dwolla_values[:code]; end
34
- m
35
- end
36
-
37
- def test_transaction_byid(params={})
38
- {
39
- :Success => true,
40
- :Message => 'Success',
41
- :Response => {
42
- :Id => 2834469,
43
- :Amount => 1,
44
- :Date => "05/02/2013 17:18:09",
45
- :Type => "withdrawal",
46
- :UserType => "Dwolla",
47
- :DestinationId => "XXX80-1",
48
- :DestinationName => "Veridian Credit Union",
49
- :SourceId => "812-734-7288",
50
- :SourceName => "Michael Schonfeld",
51
- :ClearingDate => "5/2/2013",
52
- :Status => "processed",
53
- :Notes => nil,
54
- :Fees => nil
55
- }
56
- }.merge(params)
57
- end
58
-
59
- def test_transactions_array(params={})
60
- {
61
- :Success => true,
62
- :Message => 'Success',
63
- :Response => [
64
- {
65
- :Id => 2834469,
66
- :Amount => 1,
67
- :Date => "05/02/2013 17:18:09",
68
- :Type => "withdrawal",
69
- :UserType => "Dwolla",
70
- :DestinationId => "XXX80-1",
71
- :DestinationName => "Veridian Credit Union",
72
- :SourceId => "812-734-7288",
73
- :SourceName => "Michael Schonfeld",
74
- :ClearingDate => "5/2/2013",
75
- :Status => "processed",
76
- :Notes => nil,
77
- :Fees => nil
78
- },
79
- {
80
- :Id => 2834457,
81
- :Amount => 1,
82
- :Date => "05/02/2013 17:17:02",
83
- :Type => "deposit",
84
- :UserType => "Dwolla",
85
- :DestinationId => "812-734-7288",
86
- :DestinationName => "Michael Schonfeld",
87
- :SourceId => "XXX80-1",
88
- :SourceName => "Veridian Credit Union",
89
- :ClearingDate => "5/2/2013",
90
- :Status => "processed",
91
- :Notes => nil,
92
- :Fees => nil
93
- }
94
- ]
95
- }.merge(params)
96
- end
97
-
98
- def test_transactions_stats(params={})
99
- {
100
- :Success => true,
101
- :Message => 'Success',
102
- :Response => [
103
- {
104
- :TransactionsCount => 3,
105
- :TransactionsTotal => 0.03
106
- }
107
- ]
108
- }.merge(params)
109
- end
110
-
111
- def test_balance(params={})
112
- {
113
- :Success => true,
114
- :Message => 'Success',
115
- :Response => 10.00
116
- }.merge(params)
117
- end
118
-
119
- def test_send(params={})
120
- {
121
- :Success => true,
122
- :Message => 'Success',
123
- :Response => 2834853
124
- }.merge(params)
125
- end
126
-
127
- def test_request(params={})
128
- {
129
- :Success => true,
130
- :Message => 'Success',
131
- :Response => 2221134
132
- }.merge(params)
133
- end
134
-
135
- def test_request_byid(params={})
136
- {
137
- :Success => true,
138
- :Message => 'Success',
139
- :Response => {
140
- :Id => 2209516,
141
- :Source => {
142
- :Id => "812-734-7288",
143
- :Name => "Michael Schonfeld",
144
- :Type => "Dwolla",
145
- :Image => nil
146
- },
147
- :Destination => {
148
- :Id => "812-552-5325",
149
- :Name => "Mark Littlewood",
150
- :Type => "Dwolla",
151
- :Image => nil
152
- },
153
- :Amount => 8,
154
- :DateRequested => "8/15/2012 10:18:46 PM",
155
- :Status => "Pending",
156
- :Transaction => nil
157
- }
158
- }.merge(params)
159
- end
160
-
161
- def test_requests_array(params={})
162
- {
163
- :Success => true,
164
- :Message => 'Success',
165
- :Response => [
166
- {
167
- :Id => 2209516,
168
- :Source => {
169
- :Id => "812-734-7288",
170
- :Name => "Michael Schonfeld",
171
- :Type => "Dwolla",
172
- :Image => nil
173
- },
174
- :Destination => {
175
- :Id => "812-552-5325",
176
- :Name => "Mark Littlewood",
177
- :Type => "Dwolla",
178
- :Image => nil
179
- },
180
- :Amount => 8,
181
- :DateRequested => "8/15/2012 10:18:46 PM",
182
- :Status => "Pending",
183
- :Transaction => nil
184
- },
185
- {
186
- :Id => 2213417,
187
- :Source => {
188
- :Id => "812-713-9234",
189
- :Name => "Dwolla",
190
- :Type => "Dwolla",
191
- :Image => nil
192
- },
193
- :Destination => {
194
- :Id => "812-734-7288",
195
- :Name => "Michael Schonfeld",
196
- :Type => "Dwolla",
197
- :Image => nil
198
- },
199
- :Amount => 0.1,
200
- :DateRequested => "12/4/2012 5:20:38 PM",
201
- :Status => "Pending",
202
- :Transaction => nil
203
- }
204
- ]
205
- }.merge(params)
206
- end
207
-
208
- def test_request_cancel(params={})
209
- {
210
- :Success => true,
211
- :Message => 'Success',
212
- :Response => ''
213
- }.merge(params)
214
- end
215
-
216
- def test_request_fulfill(params={})
217
- {
218
- :Success => true,
219
- :Message => 'Success',
220
- :Response => {
221
- :Id => 2844131,
222
- :RequestId => 2219682,
223
- :Source => {
224
- :Id => "812-734-7288",
225
- :Name => "Michael Schonfeld",
226
- :Type => "Dwolla",
227
- :Image => nil
228
- },
229
- :Destination => {
230
- :Id => "812-726-8148",
231
- :Name => "Paul Liberman",
232
- :Type => "Dwolla",
233
- :Image => nil
234
- },
235
- :Amount => 1,
236
- :SentDate => "5/3/2013 10:55:56 AM",
237
- :ClearingDate => "5/3/2013 10:55:56 AM",
238
- :Status => "processed"
239
- }
240
- }.merge(params)
241
- end
242
-
243
- def test_fundingsource_byid(params={})
244
- {
245
- :Success => true,
246
- :Message => 'Success',
247
- :Response => {
248
- :Balance => 7.74,
249
- :Id => "a4946ae2d2b7f1f880790f31a36887f5",
250
- :Name => "Veridian Credit Union - Savings",
251
- :Type => "Savings",
252
- :Verified => true,
253
- :ProcessingType => "FiSync"
254
- }
255
- }.merge(params)
256
- end
257
-
258
- def test_fundingsources_array(params={})
259
- {
260
- :Success => true,
261
- :Message => 'Success',
262
- :Response => [
263
- {
264
- :Id => "a4946ae2d2b7f1f880790f31a36887f5",
265
- :Name => "Veridian Credit Union - Savings",
266
- :Type => "Savings",
267
- :Verified => true,
268
- :ProcessingType => "FiSync"
269
- },
270
- {
271
- :Id => "c21012f98742d4b0affcd8aeabefb369",
272
- :Name => "My Checking Account - Checking",
273
- :Type => "Checking",
274
- :Verified => true,
275
- :ProcessingType => "ACH"
276
- }
277
- ]
278
- }.merge(params)
279
- end
280
-
281
- def test_fundingsource_withdraw(params={})
282
- {
283
- :Success => true,
284
- :Message => 'Success',
285
- :Response => {
286
- :Id => 2834469,
287
- :Amount => 1,
288
- :Date => "5/2/2013 9:18:09 PM",
289
- :Type => "withdrawal",
290
- :UserType => "Dwolla",
291
- :DestinationId => "XXX80-1",
292
- :DestinationName => "Veridian Credit Union",
293
- :SourceId => "812-734-7288",
294
- :SourceName => "Michael Schonfeld",
295
- :ClearingDate => "5/2/2013",
296
- :Status => "pending",
297
- :Notes => nil,
298
- :Fees => nil
299
- }
300
- }.merge(params)
301
- end
302
-
303
- def test_fundingsource_deposit(params={})
304
- {
305
- :Success => true,
306
- :Message => 'Success',
307
- :Response => {
308
- :Id => 2834457,
309
- :Amount => 1,
310
- :Date => "5/2/2013 9:17:02 PM",
311
- :Type => "deposit",
312
- :UserType => "Dwolla",
313
- :DestinationId => "812-734-7288",
314
- :DestinationName => "Michael Schonfeld",
315
- :SourceId => "XXX80-1",
316
- :SourceName => "Veridian Credit Union",
317
- :ClearingDate => "5/2/2013",
318
- :Status => "pending",
319
- :Notes => nil,
320
- :Fees => nil
321
- }
322
- }.merge(params)
323
- end
324
-
325
- def test_user_self(params={})
326
- {
327
- :Success => true,
328
- :Message => 'Success',
329
- :Response => {
330
- :City => "Paris",
331
- :State => "TN",
332
- :Type => "Personal",
333
- :Id => "812-629-2658",
334
- :Name => "Codeacademy Course",
335
- :Latitude => 0,
336
- :Longitude => 0
337
- }
338
- }.merge(params)
339
- end
340
-
341
- def test_user_byid(params={})
342
- {
343
- :Success => true,
344
- :Message => 'Success',
345
- :Response => {
346
- :Name => "Alex Hart",
347
- :Id => "812-499-5823",
348
- :Type => "Dwolla",
349
- :Image => "https://www.dwolla.com/avatars/812-499-5823",
350
- :City => nil,
351
- :State => nil
352
- }
353
- }.merge(params)
354
- end
355
-
356
- def test_users_array(params={})
357
- {
358
- :Success => true,
359
- :Message => 'Success',
360
- :Response => [
361
- {
362
- :Name => "Alex Hart",
363
- :Id => "812-499-5823",
364
- :Type => "Dwolla",
365
- :Image => "https://www.dwolla.com/avatars/812-499-5823",
366
- :City => nil,
367
- :State => nil
368
- },
369
- {
370
- :Name => "Alexander Taub",
371
- :Id => "812-626-8794",
372
- :Type => "Dwolla",
373
- :Image => "https://www.dwolla.com/avatars/812-626-8794",
374
- :City => nil,
375
- :State => nil
376
- }
377
- ]
378
- }.merge(params)
379
- end
380
-
381
- def test_contacts_array(params={})
382
- {
383
- :Success => true,
384
- :Message => 'Success',
385
- :Response => [
386
- {
387
- :Name => "Pinnacle Marketing",
388
- :Id => "812-464-9495",
389
- :Type => "Dwolla",
390
- :Image => "https://www.dwolla.com/avatars/812-464-9495",
391
- :Latitude => 0,
392
- :Longitude => 0,
393
- :Address => "Box 311\n134 Moore Hill Road",
394
- :City => "Newbury",
395
- :State => "VT",
396
- :PostalCode => "05051",
397
- :Group => "812-534-7970,812-530-2592,812-451-7983,812-554-6122,812-499-3232,812-475-9151,812-568-7828,812-518-8055,812-514-9530",
398
- :Delta => 0
399
- },
400
- {
401
- :Name => "CMS Plus Hosting LLC",
402
- :Id => "812-534-7970",
403
- :Type => "Dwolla",
404
- :Image => "https://www.dwolla.com/avatars/812-534-7970",
405
- :Latitude => 0,
406
- :Longitude => 0,
407
- :Address => "20 E BEECH\nPO BOX 47",
408
- :City => "Cedar Springs",
409
- :State => "MI",
410
- :PostalCode => "49319",
411
- :Group => "812-464-9495,812-530-2592,812-451-7983,812-554-6122,812-499-3232,812-475-9151,812-568-7828,812-518-8055,812-514-9530",
412
- :Delta => 0
413
- }
414
- ]
415
- }.merge(params)
416
- end
417
-
418
- def test_api_error
419
- {
420
- :Success => false,
421
- :Message => 'Success',
422
- :Response => ''
423
- }
1
+ require 'stringio'
2
+ require 'test/unit'
3
+ require 'dwolla'
4
+ require 'mocha/setup'
5
+ include Mocha
6
+
7
+ #monkeypatch request methods
8
+ module Dwolla
9
+ @mock_rest_client = nil
10
+
11
+ def self.mock_rest_client=(mock_client)
12
+ @mock_rest_client = mock_client
13
+ end
14
+
15
+ def self.execute_request(opts)
16
+ get_params = (opts[:headers] || {})[:params]
17
+ post_params = opts[:payload]
18
+
19
+ case opts[:method]
20
+ when :get then @mock_rest_client.get opts[:url], get_params, post_params
21
+ when :post then @mock_rest_client.post opts[:url], get_params, post_params
22
+ end
23
+ end
24
+ end
25
+
26
+ def test_response(body, code=200)
27
+ # When an exception is raised, restclient clobbers method_missing. Hence we
28
+ # can't just use the stubs interface.
29
+ body = MultiJson.dump(body) if !(body.kind_of? String)
30
+ m = mock
31
+ m.instance_variable_set('@dwolla_values', { :body => body, :code => code })
32
+ def m.body; @dwolla_values[:body]; end
33
+ def m.code; @dwolla_values[:code]; end
34
+ m
35
+ end
36
+
37
+ def test_transaction_byid(params={})
38
+ {
39
+ :Success => true,
40
+ :Message => 'Success',
41
+ :Response => {
42
+ :Id => 2834469,
43
+ :Amount => 1,
44
+ :Date => "05/02/2013 17:18:09",
45
+ :Type => "withdrawal",
46
+ :UserType => "Dwolla",
47
+ :DestinationId => "XXX80-1",
48
+ :DestinationName => "Veridian Credit Union",
49
+ :SourceId => "812-734-7288",
50
+ :SourceName => "Michael Schonfeld",
51
+ :ClearingDate => "5/2/2013",
52
+ :Status => "processed",
53
+ :Notes => nil,
54
+ :Fees => nil
55
+ }
56
+ }.merge(params)
57
+ end
58
+
59
+ def test_transactions_array(params={})
60
+ {
61
+ :Success => true,
62
+ :Message => 'Success',
63
+ :Response => [
64
+ {
65
+ :Id => 2834469,
66
+ :Amount => 1,
67
+ :Date => "05/02/2013 17:18:09",
68
+ :Type => "withdrawal",
69
+ :UserType => "Dwolla",
70
+ :DestinationId => "XXX80-1",
71
+ :DestinationName => "Veridian Credit Union",
72
+ :SourceId => "812-734-7288",
73
+ :SourceName => "Michael Schonfeld",
74
+ :ClearingDate => "5/2/2013",
75
+ :Status => "processed",
76
+ :Notes => nil,
77
+ :Fees => nil
78
+ },
79
+ {
80
+ :Id => 2834457,
81
+ :Amount => 1,
82
+ :Date => "05/02/2013 17:17:02",
83
+ :Type => "deposit",
84
+ :UserType => "Dwolla",
85
+ :DestinationId => "812-734-7288",
86
+ :DestinationName => "Michael Schonfeld",
87
+ :SourceId => "XXX80-1",
88
+ :SourceName => "Veridian Credit Union",
89
+ :ClearingDate => "5/2/2013",
90
+ :Status => "processed",
91
+ :Notes => nil,
92
+ :Fees => nil
93
+ }
94
+ ]
95
+ }.merge(params)
96
+ end
97
+
98
+ def test_transactions_stats(params={})
99
+ {
100
+ :Success => true,
101
+ :Message => 'Success',
102
+ :Response => [
103
+ {
104
+ :TransactionsCount => 3,
105
+ :TransactionsTotal => 0.03
106
+ }
107
+ ]
108
+ }.merge(params)
109
+ end
110
+
111
+ def test_balance(params={})
112
+ {
113
+ :Success => true,
114
+ :Message => 'Success',
115
+ :Response => 10.00
116
+ }.merge(params)
117
+ end
118
+
119
+ def test_send(params={})
120
+ {
121
+ :Success => true,
122
+ :Message => 'Success',
123
+ :Response => 2834853
124
+ }.merge(params)
125
+ end
126
+
127
+ def test_request(params={})
128
+ {
129
+ :Success => true,
130
+ :Message => 'Success',
131
+ :Response => 2221134
132
+ }.merge(params)
133
+ end
134
+
135
+ def test_request_byid(params={})
136
+ {
137
+ :Success => true,
138
+ :Message => 'Success',
139
+ :Response => {
140
+ :Id => 2209516,
141
+ :Source => {
142
+ :Id => "812-734-7288",
143
+ :Name => "Michael Schonfeld",
144
+ :Type => "Dwolla",
145
+ :Image => nil
146
+ },
147
+ :Destination => {
148
+ :Id => "812-552-5325",
149
+ :Name => "Mark Littlewood",
150
+ :Type => "Dwolla",
151
+ :Image => nil
152
+ },
153
+ :Amount => 8,
154
+ :DateRequested => "8/15/2012 10:18:46 PM",
155
+ :Status => "Pending",
156
+ :Transaction => nil
157
+ }
158
+ }.merge(params)
159
+ end
160
+
161
+ def test_requests_array(params={})
162
+ {
163
+ :Success => true,
164
+ :Message => 'Success',
165
+ :Response => [
166
+ {
167
+ :Id => 2209516,
168
+ :Source => {
169
+ :Id => "812-734-7288",
170
+ :Name => "Michael Schonfeld",
171
+ :Type => "Dwolla",
172
+ :Image => nil
173
+ },
174
+ :Destination => {
175
+ :Id => "812-552-5325",
176
+ :Name => "Mark Littlewood",
177
+ :Type => "Dwolla",
178
+ :Image => nil
179
+ },
180
+ :Amount => 8,
181
+ :DateRequested => "8/15/2012 10:18:46 PM",
182
+ :Status => "Pending",
183
+ :Transaction => nil
184
+ },
185
+ {
186
+ :Id => 2213417,
187
+ :Source => {
188
+ :Id => "812-713-9234",
189
+ :Name => "Dwolla",
190
+ :Type => "Dwolla",
191
+ :Image => nil
192
+ },
193
+ :Destination => {
194
+ :Id => "812-734-7288",
195
+ :Name => "Michael Schonfeld",
196
+ :Type => "Dwolla",
197
+ :Image => nil
198
+ },
199
+ :Amount => 0.1,
200
+ :DateRequested => "12/4/2012 5:20:38 PM",
201
+ :Status => "Pending",
202
+ :Transaction => nil
203
+ }
204
+ ]
205
+ }.merge(params)
206
+ end
207
+
208
+ def test_request_cancel(params={})
209
+ {
210
+ :Success => true,
211
+ :Message => 'Success',
212
+ :Response => ''
213
+ }.merge(params)
214
+ end
215
+
216
+ def test_request_fulfill(params={})
217
+ {
218
+ :Success => true,
219
+ :Message => 'Success',
220
+ :Response => {
221
+ :Id => 2844131,
222
+ :RequestId => 2219682,
223
+ :Source => {
224
+ :Id => "812-734-7288",
225
+ :Name => "Michael Schonfeld",
226
+ :Type => "Dwolla",
227
+ :Image => nil
228
+ },
229
+ :Destination => {
230
+ :Id => "812-726-8148",
231
+ :Name => "Paul Liberman",
232
+ :Type => "Dwolla",
233
+ :Image => nil
234
+ },
235
+ :Amount => 1,
236
+ :SentDate => "5/3/2013 10:55:56 AM",
237
+ :ClearingDate => "5/3/2013 10:55:56 AM",
238
+ :Status => "processed"
239
+ }
240
+ }.merge(params)
241
+ end
242
+
243
+ def test_fundingsource_byid(params={})
244
+ {
245
+ :Success => true,
246
+ :Message => 'Success',
247
+ :Response => {
248
+ :Balance => 7.74,
249
+ :Id => "a4946ae2d2b7f1f880790f31a36887f5",
250
+ :Name => "Veridian Credit Union - Savings",
251
+ :Type => "Savings",
252
+ :Verified => true,
253
+ :ProcessingType => "FiSync"
254
+ }
255
+ }.merge(params)
256
+ end
257
+
258
+ def test_fundingsources_array(params={})
259
+ {
260
+ :Success => true,
261
+ :Message => 'Success',
262
+ :Response => [
263
+ {
264
+ :Id => "a4946ae2d2b7f1f880790f31a36887f5",
265
+ :Name => "Veridian Credit Union - Savings",
266
+ :Type => "Savings",
267
+ :Verified => true,
268
+ :ProcessingType => "FiSync"
269
+ },
270
+ {
271
+ :Id => "c21012f98742d4b0affcd8aeabefb369",
272
+ :Name => "My Checking Account - Checking",
273
+ :Type => "Checking",
274
+ :Verified => true,
275
+ :ProcessingType => "ACH"
276
+ }
277
+ ]
278
+ }.merge(params)
279
+ end
280
+
281
+ def test_fundingsource_withdraw(params={})
282
+ {
283
+ :Success => true,
284
+ :Message => 'Success',
285
+ :Response => {
286
+ :Id => 2834469,
287
+ :Amount => 1,
288
+ :Date => "5/2/2013 9:18:09 PM",
289
+ :Type => "withdrawal",
290
+ :UserType => "Dwolla",
291
+ :DestinationId => "XXX80-1",
292
+ :DestinationName => "Veridian Credit Union",
293
+ :SourceId => "812-734-7288",
294
+ :SourceName => "Michael Schonfeld",
295
+ :ClearingDate => "5/2/2013",
296
+ :Status => "pending",
297
+ :Notes => nil,
298
+ :Fees => nil
299
+ }
300
+ }.merge(params)
301
+ end
302
+
303
+ def test_fundingsource_deposit(params={})
304
+ {
305
+ :Success => true,
306
+ :Message => 'Success',
307
+ :Response => {
308
+ :Id => 2834457,
309
+ :Amount => 1,
310
+ :Date => "5/2/2013 9:17:02 PM",
311
+ :Type => "deposit",
312
+ :UserType => "Dwolla",
313
+ :DestinationId => "812-734-7288",
314
+ :DestinationName => "Michael Schonfeld",
315
+ :SourceId => "XXX80-1",
316
+ :SourceName => "Veridian Credit Union",
317
+ :ClearingDate => "5/2/2013",
318
+ :Status => "pending",
319
+ :Notes => nil,
320
+ :Fees => nil
321
+ }
322
+ }.merge(params)
323
+ end
324
+
325
+ def test_user_self(params={})
326
+ {
327
+ :Success => true,
328
+ :Message => 'Success',
329
+ :Response => {
330
+ :City => "Paris",
331
+ :State => "TN",
332
+ :Type => "Personal",
333
+ :Id => "812-629-2658",
334
+ :Name => "Codeacademy Course",
335
+ :Latitude => 0,
336
+ :Longitude => 0
337
+ }
338
+ }.merge(params)
339
+ end
340
+
341
+ def test_user_byid(params={})
342
+ {
343
+ :Success => true,
344
+ :Message => 'Success',
345
+ :Response => {
346
+ :Name => "Alex Hart",
347
+ :Id => "812-499-5823",
348
+ :Type => "Dwolla",
349
+ :Image => "https://www.dwolla.com/avatars/812-499-5823",
350
+ :City => nil,
351
+ :State => nil
352
+ }
353
+ }.merge(params)
354
+ end
355
+
356
+ def test_users_array(params={})
357
+ {
358
+ :Success => true,
359
+ :Message => 'Success',
360
+ :Response => [
361
+ {
362
+ :Name => "Alex Hart",
363
+ :Id => "812-499-5823",
364
+ :Type => "Dwolla",
365
+ :Image => "https://www.dwolla.com/avatars/812-499-5823",
366
+ :City => nil,
367
+ :State => nil
368
+ },
369
+ {
370
+ :Name => "Alexander Taub",
371
+ :Id => "812-626-8794",
372
+ :Type => "Dwolla",
373
+ :Image => "https://www.dwolla.com/avatars/812-626-8794",
374
+ :City => nil,
375
+ :State => nil
376
+ }
377
+ ]
378
+ }.merge(params)
379
+ end
380
+
381
+ def test_contacts_array(params={})
382
+ {
383
+ :Success => true,
384
+ :Message => 'Success',
385
+ :Response => [
386
+ {
387
+ :Name => "Pinnacle Marketing",
388
+ :Id => "812-464-9495",
389
+ :Type => "Dwolla",
390
+ :Image => "https://www.dwolla.com/avatars/812-464-9495",
391
+ :Latitude => 0,
392
+ :Longitude => 0,
393
+ :Address => "Box 311\n134 Moore Hill Road",
394
+ :City => "Newbury",
395
+ :State => "VT",
396
+ :PostalCode => "05051",
397
+ :Group => "812-534-7970,812-530-2592,812-451-7983,812-554-6122,812-499-3232,812-475-9151,812-568-7828,812-518-8055,812-514-9530",
398
+ :Delta => 0
399
+ },
400
+ {
401
+ :Name => "CMS Plus Hosting LLC",
402
+ :Id => "812-534-7970",
403
+ :Type => "Dwolla",
404
+ :Image => "https://www.dwolla.com/avatars/812-534-7970",
405
+ :Latitude => 0,
406
+ :Longitude => 0,
407
+ :Address => "20 E BEECH\nPO BOX 47",
408
+ :City => "Cedar Springs",
409
+ :State => "MI",
410
+ :PostalCode => "49319",
411
+ :Group => "812-464-9495,812-530-2592,812-451-7983,812-554-6122,812-499-3232,812-475-9151,812-568-7828,812-518-8055,812-514-9530",
412
+ :Delta => 0
413
+ }
414
+ ]
415
+ }.merge(params)
416
+ end
417
+
418
+ def test_api_error
419
+ {
420
+ :Success => false,
421
+ :Message => 'Success',
422
+ :Response => ''
423
+ }
424
424
  end