big-door 0.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (42) hide show
  1. data/.bundle/config +2 -0
  2. data/.document +5 -0
  3. data/.gitignore +22 -0
  4. data/Gemfile +12 -0
  5. data/LICENSE +20 -0
  6. data/README.rdoc +17 -0
  7. data/Rakefile +59 -0
  8. data/VERSION +1 -0
  9. data/features/big-door.feature +26 -0
  10. data/features/step_definitions/big-door_steps.rb +83 -0
  11. data/features/support/env.rb +5 -0
  12. data/lib/big-door.rb +127 -0
  13. data/lib/big-door/base.rb +45 -0
  14. data/lib/big-door/currency.rb +25 -0
  15. data/lib/big-door/named_transaction.rb +25 -0
  16. data/lib/big-door/named_transaction_group.rb +27 -0
  17. data/lib/big-door/request.rb +7 -0
  18. data/lib/big-door/response_codes.rb +266 -0
  19. data/lib/big-door/user.rb +49 -0
  20. data/spec/.rspec +1 -0
  21. data/spec/big-door_spec.rb +105 -0
  22. data/spec/spec_helper.rb +19 -0
  23. data/spec/support/vcr.rb +7 -0
  24. data/vcr_cassettes/NamedTransaction/NamedTransaction.yml +213 -0
  25. data/vcr_cassettes/NamedTransaction/specific.yml +6043 -0
  26. data/vcr_cassettes/award/award_summary.yml +34 -0
  27. data/vcr_cassettes/currency/currency.yml +52 -0
  28. data/vcr_cassettes/currency/currency_type.yml +31 -0
  29. data/vcr_cassettes/currency/specific.yml +2980 -0
  30. data/vcr_cassettes/good/good_summary.yml +34 -0
  31. data/vcr_cassettes/level/level_summary.yml +34 -0
  32. data/vcr_cassettes/named_transaction/named_transactions.yml +107 -0
  33. data/vcr_cassettes/named_transaction_group/all.yml +145 -0
  34. data/vcr_cassettes/named_transaction_group/specific.yml +3171 -0
  35. data/vcr_cassettes/user/add_points.yml +36 -0
  36. data/vcr_cassettes/user/all.yml +473 -0
  37. data/vcr_cassettes/user/create.yml +393 -0
  38. data/vcr_cassettes/user/currency_balance.yml +738 -0
  39. data/vcr_cassettes/user/new.yml +5660 -0
  40. data/vcr_cassettes/user/new_currency_balance.yml +470 -0
  41. data/vcr_cassettes/user/specific.yml +213 -0
  42. metadata +175 -0
@@ -0,0 +1,36 @@
1
+ ---
2
+ - !ruby/struct:VCR::HTTPInteraction
3
+ request: !ruby/struct:VCR::Request
4
+ method: :post
5
+ uri: http://api.bigdoor.com:80/api/publisher/0d38d9cd41b0440bbf22c0720be58b27/named_transaction_group/612135/execute/tester?time=1282839854.71&format=json&sig=78cb00653fa756fb5f641bd171fcacde15fc5111c8ef8874d708f0d644a7401d
6
+ body: time=1282839854.71&token=fc525f3d2d6febd71dcbf40cec2fe054&amount=30
7
+ headers:
8
+ content-type:
9
+ - application/x-www-form-urlencoded
10
+ connection:
11
+ - close
12
+ content-length:
13
+ - "67"
14
+ host:
15
+ - api.bigdoor.com
16
+ response: !ruby/struct:VCR::Response
17
+ status: !ruby/struct:VCR::ResponseStatus
18
+ code: 201
19
+ message: CREATED
20
+ headers:
21
+ bdm-reason-phrase:
22
+ - Created
23
+ connection:
24
+ - Close
25
+ content-type:
26
+ - text/html; charset=utf-8
27
+ server:
28
+ - Apache/2.2.9 (Debian) PHP/5.2.6-1+lenny9 with Suhosin-Patch mod_wsgi/2.5 Python/2.5.2
29
+ date:
30
+ - Thu, 26 Aug 2010 16:24:15 GMT
31
+ content-length:
32
+ - "1"
33
+ vary:
34
+ - Authorization,Cookie,Accept-Encoding
35
+ body: "0"
36
+ http_version: "1.1"
@@ -0,0 +1,473 @@
1
+ ---
2
+ - !ruby/struct:VCR::HTTPInteraction
3
+ request: !ruby/struct:VCR::Request
4
+ method: :get
5
+ uri: http://api.bigdoor.com:80/api/publisher/0d38d9cd41b0440bbf22c0720be58b27/end_user?sig=f107fb1b239467b0bc42bc7d8b561f5e09c5bab7cc23c7d37e1d6b7ab478df3f&time=1282851496.07&format=json
6
+ body:
7
+ headers:
8
+ connection:
9
+ - close
10
+ host:
11
+ - api.bigdoor.com
12
+ response: !ruby/struct:VCR::Response
13
+ status: !ruby/struct:VCR::ResponseStatus
14
+ code: 200
15
+ message: OK
16
+ headers:
17
+ content-type:
18
+ - application/json; charset=utf-8
19
+ connection:
20
+ - Close
21
+ date:
22
+ - Thu, 26 Aug 2010 19:38:16 GMT
23
+ server:
24
+ - Apache/2.2.9 (Debian) PHP/5.2.6-1+lenny8 with Suhosin-Patch mod_wsgi/2.5 Python/2.5.2
25
+ content-length:
26
+ - "3376"
27
+ vary:
28
+ - Authorization,Cookie
29
+ body: |-
30
+ [
31
+ [
32
+ {
33
+ "read_only": 0,
34
+ "modified_timestamp": 1282851345,
35
+ "resource_name": "end_user",
36
+ "award_summaries": [],
37
+ "level_summaries": [],
38
+ "sent_good_summaries": [],
39
+ "currency_balances": [],
40
+ "created_timestamp": 1282851345,
41
+ "end_user_login": "fakeemail@trada.com",
42
+ "guid": "1ef9e7b0b14911df91a9c5fca3bf701b",
43
+ "received_good_summaries": []
44
+ },
45
+ {
46
+ "read_only": 0,
47
+ "modified_timestamp": 1282851363,
48
+ "resource_name": "end_user",
49
+ "award_summaries": [],
50
+ "level_summaries": [],
51
+ "sent_good_summaries": [],
52
+ "currency_balances": [],
53
+ "created_timestamp": 1282851363,
54
+ "end_user_login": "fakeemailer@trada.com",
55
+ "guid": "29fc6bf5b14911dfa15a55a9222eea83",
56
+ "received_good_summaries": []
57
+ },
58
+ {
59
+ "read_only": 0,
60
+ "modified_timestamp": 1281026097,
61
+ "resource_name": "end_user",
62
+ "award_summaries": [],
63
+ "level_summaries": [],
64
+ "sent_good_summaries": [],
65
+ "currency_balances": [
66
+ {
67
+ "end_user_description": null,
68
+ "transaction_group_id": "fc525f3d2d6febd71dcbf40cec2fe054",
69
+ "modified_timestamp": 1282839855,
70
+ "pub_title": "temp_points",
71
+ "urls": [],
72
+ "current_balance": "510.00",
73
+ "adjustment_amount": "30.00",
74
+ "currency_id": 579,
75
+ "previous_balance": "480.00",
76
+ "currency_adjusted": false,
77
+ "created_timestamp": 1282752987,
78
+ "pub_description": null,
79
+ "end_user_title": "Temp Points"
80
+ }
81
+ ],
82
+ "created_timestamp": 1281026097,
83
+ "end_user_login": "tester",
84
+ "guid": "6263ffd7a0af11df94fb7339fb3db728",
85
+ "received_good_summaries": []
86
+ },
87
+ {
88
+ "read_only": 0,
89
+ "modified_timestamp": 1281043384,
90
+ "resource_name": "end_user",
91
+ "award_summaries": [],
92
+ "level_summaries": [],
93
+ "sent_good_summaries": [],
94
+ "currency_balances": [
95
+ {
96
+ "end_user_description": null,
97
+ "transaction_group_id": "fc39d1ebc8ca49c7b8ee97a9cec32970",
98
+ "modified_timestamp": 1282689777,
99
+ "pub_title": "temp_points",
100
+ "urls": [],
101
+ "current_balance": "30.00",
102
+ "adjustment_amount": "30.00",
103
+ "currency_id": 579,
104
+ "previous_balance": "0.00",
105
+ "currency_adjusted": false,
106
+ "created_timestamp": 1282689777,
107
+ "pub_description": null,
108
+ "end_user_title": "Temp Points"
109
+ }
110
+ ],
111
+ "created_timestamp": 1281043384,
112
+ "end_user_login": "testers",
113
+ "guid": "a24ff58ca0d711df966120ad2f73afad",
114
+ "received_good_summaries": []
115
+ }
116
+ ],
117
+ {}
118
+ ]
119
+ http_version: "1.1"
120
+ - !ruby/struct:VCR::HTTPInteraction
121
+ request: !ruby/struct:VCR::Request
122
+ method: :get
123
+ uri: http://api.bigdoor.com:80/api/publisher/0d38d9cd41b0440bbf22c0720be58b27/end_user?sig=19737eeb78baecb4c1e4abe2337eb2db46a3d6cd616fef1cdcc223f0635e9ec4&time=1282851667.83&format=json
124
+ body:
125
+ headers:
126
+ connection:
127
+ - close
128
+ host:
129
+ - api.bigdoor.com
130
+ response: !ruby/struct:VCR::Response
131
+ status: !ruby/struct:VCR::ResponseStatus
132
+ code: 200
133
+ message: OK
134
+ headers:
135
+ connection:
136
+ - Close
137
+ content-type:
138
+ - application/json; charset=utf-8
139
+ server:
140
+ - Apache/2.2.9 (Debian) PHP/5.2.6-1+lenny8 with Suhosin-Patch mod_wsgi/2.5 Python/2.5.2
141
+ date:
142
+ - Thu, 26 Aug 2010 19:41:08 GMT
143
+ content-length:
144
+ - "3376"
145
+ vary:
146
+ - Authorization,Cookie
147
+ body: |-
148
+ [
149
+ [
150
+ {
151
+ "read_only": 0,
152
+ "modified_timestamp": 1282851345,
153
+ "resource_name": "end_user",
154
+ "award_summaries": [],
155
+ "level_summaries": [],
156
+ "sent_good_summaries": [],
157
+ "currency_balances": [],
158
+ "created_timestamp": 1282851345,
159
+ "end_user_login": "fakeemail@trada.com",
160
+ "guid": "1ef9e7b0b14911df91a9c5fca3bf701b",
161
+ "received_good_summaries": []
162
+ },
163
+ {
164
+ "read_only": 0,
165
+ "modified_timestamp": 1282851363,
166
+ "resource_name": "end_user",
167
+ "award_summaries": [],
168
+ "level_summaries": [],
169
+ "sent_good_summaries": [],
170
+ "currency_balances": [],
171
+ "created_timestamp": 1282851363,
172
+ "end_user_login": "fakeemailer@trada.com",
173
+ "guid": "29fc6bf5b14911dfa15a55a9222eea83",
174
+ "received_good_summaries": []
175
+ },
176
+ {
177
+ "read_only": 0,
178
+ "modified_timestamp": 1281026097,
179
+ "resource_name": "end_user",
180
+ "award_summaries": [],
181
+ "level_summaries": [],
182
+ "sent_good_summaries": [],
183
+ "currency_balances": [
184
+ {
185
+ "end_user_description": null,
186
+ "transaction_group_id": "fc525f3d2d6febd71dcbf40cec2fe054",
187
+ "modified_timestamp": 1282839855,
188
+ "pub_title": "temp_points",
189
+ "urls": [],
190
+ "current_balance": "510.00",
191
+ "adjustment_amount": "30.00",
192
+ "currency_id": 579,
193
+ "previous_balance": "480.00",
194
+ "currency_adjusted": false,
195
+ "created_timestamp": 1282752987,
196
+ "pub_description": null,
197
+ "end_user_title": "Temp Points"
198
+ }
199
+ ],
200
+ "created_timestamp": 1281026097,
201
+ "end_user_login": "tester",
202
+ "guid": "6263ffd7a0af11df94fb7339fb3db728",
203
+ "received_good_summaries": []
204
+ },
205
+ {
206
+ "read_only": 0,
207
+ "modified_timestamp": 1281043384,
208
+ "resource_name": "end_user",
209
+ "award_summaries": [],
210
+ "level_summaries": [],
211
+ "sent_good_summaries": [],
212
+ "currency_balances": [
213
+ {
214
+ "end_user_description": null,
215
+ "transaction_group_id": "fc39d1ebc8ca49c7b8ee97a9cec32970",
216
+ "modified_timestamp": 1282689777,
217
+ "pub_title": "temp_points",
218
+ "urls": [],
219
+ "current_balance": "30.00",
220
+ "adjustment_amount": "30.00",
221
+ "currency_id": 579,
222
+ "previous_balance": "0.00",
223
+ "currency_adjusted": false,
224
+ "created_timestamp": 1282689777,
225
+ "pub_description": null,
226
+ "end_user_title": "Temp Points"
227
+ }
228
+ ],
229
+ "created_timestamp": 1281043384,
230
+ "end_user_login": "testers",
231
+ "guid": "a24ff58ca0d711df966120ad2f73afad",
232
+ "received_good_summaries": []
233
+ }
234
+ ],
235
+ {}
236
+ ]
237
+ http_version: "1.1"
238
+ - !ruby/struct:VCR::HTTPInteraction
239
+ request: !ruby/struct:VCR::Request
240
+ method: :get
241
+ uri: http://api.bigdoor.com:80/api/publisher/0d38d9cd41b0440bbf22c0720be58b27/end_user?sig=b795042f516f813a5a830069aeed914460ab3fabfc14a5443c4c5082e0acd89c&time=1282851684.82&format=json
242
+ body:
243
+ headers:
244
+ connection:
245
+ - close
246
+ host:
247
+ - api.bigdoor.com
248
+ response: !ruby/struct:VCR::Response
249
+ status: !ruby/struct:VCR::ResponseStatus
250
+ code: 200
251
+ message: OK
252
+ headers:
253
+ content-type:
254
+ - application/json; charset=utf-8
255
+ connection:
256
+ - Close
257
+ date:
258
+ - Thu, 26 Aug 2010 19:41:25 GMT
259
+ server:
260
+ - Apache/2.2.9 (Debian) PHP/5.2.6-1+lenny8 with Suhosin-Patch mod_wsgi/2.5 Python/2.5.2
261
+ content-length:
262
+ - "3376"
263
+ vary:
264
+ - Authorization,Cookie
265
+ body: |-
266
+ [
267
+ [
268
+ {
269
+ "read_only": 0,
270
+ "modified_timestamp": 1282851345,
271
+ "resource_name": "end_user",
272
+ "award_summaries": [],
273
+ "level_summaries": [],
274
+ "sent_good_summaries": [],
275
+ "currency_balances": [],
276
+ "created_timestamp": 1282851345,
277
+ "end_user_login": "fakeemail@trada.com",
278
+ "guid": "1ef9e7b0b14911df91a9c5fca3bf701b",
279
+ "received_good_summaries": []
280
+ },
281
+ {
282
+ "read_only": 0,
283
+ "modified_timestamp": 1282851363,
284
+ "resource_name": "end_user",
285
+ "award_summaries": [],
286
+ "level_summaries": [],
287
+ "sent_good_summaries": [],
288
+ "currency_balances": [],
289
+ "created_timestamp": 1282851363,
290
+ "end_user_login": "fakeemailer@trada.com",
291
+ "guid": "29fc6bf5b14911dfa15a55a9222eea83",
292
+ "received_good_summaries": []
293
+ },
294
+ {
295
+ "read_only": 0,
296
+ "modified_timestamp": 1281026097,
297
+ "resource_name": "end_user",
298
+ "award_summaries": [],
299
+ "level_summaries": [],
300
+ "sent_good_summaries": [],
301
+ "currency_balances": [
302
+ {
303
+ "end_user_description": null,
304
+ "transaction_group_id": "fc525f3d2d6febd71dcbf40cec2fe054",
305
+ "modified_timestamp": 1282839855,
306
+ "pub_title": "temp_points",
307
+ "urls": [],
308
+ "current_balance": "510.00",
309
+ "adjustment_amount": "30.00",
310
+ "currency_id": 579,
311
+ "previous_balance": "480.00",
312
+ "currency_adjusted": false,
313
+ "created_timestamp": 1282752987,
314
+ "pub_description": null,
315
+ "end_user_title": "Temp Points"
316
+ }
317
+ ],
318
+ "created_timestamp": 1281026097,
319
+ "end_user_login": "tester",
320
+ "guid": "6263ffd7a0af11df94fb7339fb3db728",
321
+ "received_good_summaries": []
322
+ },
323
+ {
324
+ "read_only": 0,
325
+ "modified_timestamp": 1281043384,
326
+ "resource_name": "end_user",
327
+ "award_summaries": [],
328
+ "level_summaries": [],
329
+ "sent_good_summaries": [],
330
+ "currency_balances": [
331
+ {
332
+ "end_user_description": null,
333
+ "transaction_group_id": "fc39d1ebc8ca49c7b8ee97a9cec32970",
334
+ "modified_timestamp": 1282689777,
335
+ "pub_title": "temp_points",
336
+ "urls": [],
337
+ "current_balance": "30.00",
338
+ "adjustment_amount": "30.00",
339
+ "currency_id": 579,
340
+ "previous_balance": "0.00",
341
+ "currency_adjusted": false,
342
+ "created_timestamp": 1282689777,
343
+ "pub_description": null,
344
+ "end_user_title": "Temp Points"
345
+ }
346
+ ],
347
+ "created_timestamp": 1281043384,
348
+ "end_user_login": "testers",
349
+ "guid": "a24ff58ca0d711df966120ad2f73afad",
350
+ "received_good_summaries": []
351
+ }
352
+ ],
353
+ {}
354
+ ]
355
+ http_version: "1.1"
356
+ - !ruby/struct:VCR::HTTPInteraction
357
+ request: !ruby/struct:VCR::Request
358
+ method: :get
359
+ uri: http://api.bigdoor.com:80/api/publisher/0d38d9cd41b0440bbf22c0720be58b27/end_user?sig=e66f97b2fb049f89cb12ddc133a136d631b8dea3ab2916c2da183fd54723bee2&time=1282851764.81&format=json
360
+ body:
361
+ headers:
362
+ connection:
363
+ - close
364
+ host:
365
+ - api.bigdoor.com
366
+ response: !ruby/struct:VCR::Response
367
+ status: !ruby/struct:VCR::ResponseStatus
368
+ code: 200
369
+ message: OK
370
+ headers:
371
+ connection:
372
+ - Close
373
+ content-type:
374
+ - application/json; charset=utf-8
375
+ server:
376
+ - Apache/2.2.9 (Debian) PHP/5.2.6-1+lenny8 with Suhosin-Patch mod_wsgi/2.5 Python/2.5.2
377
+ date:
378
+ - Thu, 26 Aug 2010 19:42:45 GMT
379
+ content-length:
380
+ - "3376"
381
+ vary:
382
+ - Authorization,Cookie
383
+ body: |-
384
+ [
385
+ [
386
+ {
387
+ "read_only": 0,
388
+ "modified_timestamp": 1282851345,
389
+ "resource_name": "end_user",
390
+ "award_summaries": [],
391
+ "level_summaries": [],
392
+ "sent_good_summaries": [],
393
+ "currency_balances": [],
394
+ "created_timestamp": 1282851345,
395
+ "end_user_login": "fakeemail@trada.com",
396
+ "guid": "1ef9e7b0b14911df91a9c5fca3bf701b",
397
+ "received_good_summaries": []
398
+ },
399
+ {
400
+ "read_only": 0,
401
+ "modified_timestamp": 1282851363,
402
+ "resource_name": "end_user",
403
+ "award_summaries": [],
404
+ "level_summaries": [],
405
+ "sent_good_summaries": [],
406
+ "currency_balances": [],
407
+ "created_timestamp": 1282851363,
408
+ "end_user_login": "fakeemailer@trada.com",
409
+ "guid": "29fc6bf5b14911dfa15a55a9222eea83",
410
+ "received_good_summaries": []
411
+ },
412
+ {
413
+ "read_only": 0,
414
+ "modified_timestamp": 1281026097,
415
+ "resource_name": "end_user",
416
+ "award_summaries": [],
417
+ "level_summaries": [],
418
+ "sent_good_summaries": [],
419
+ "currency_balances": [
420
+ {
421
+ "end_user_description": null,
422
+ "transaction_group_id": "fc525f3d2d6febd71dcbf40cec2fe054",
423
+ "modified_timestamp": 1282839855,
424
+ "pub_title": "temp_points",
425
+ "urls": [],
426
+ "current_balance": "510.00",
427
+ "adjustment_amount": "30.00",
428
+ "currency_id": 579,
429
+ "previous_balance": "480.00",
430
+ "currency_adjusted": false,
431
+ "created_timestamp": 1282752987,
432
+ "pub_description": null,
433
+ "end_user_title": "Temp Points"
434
+ }
435
+ ],
436
+ "created_timestamp": 1281026097,
437
+ "end_user_login": "tester",
438
+ "guid": "6263ffd7a0af11df94fb7339fb3db728",
439
+ "received_good_summaries": []
440
+ },
441
+ {
442
+ "read_only": 0,
443
+ "modified_timestamp": 1281043384,
444
+ "resource_name": "end_user",
445
+ "award_summaries": [],
446
+ "level_summaries": [],
447
+ "sent_good_summaries": [],
448
+ "currency_balances": [
449
+ {
450
+ "end_user_description": null,
451
+ "transaction_group_id": "fc39d1ebc8ca49c7b8ee97a9cec32970",
452
+ "modified_timestamp": 1282689777,
453
+ "pub_title": "temp_points",
454
+ "urls": [],
455
+ "current_balance": "30.00",
456
+ "adjustment_amount": "30.00",
457
+ "currency_id": 579,
458
+ "previous_balance": "0.00",
459
+ "currency_adjusted": false,
460
+ "created_timestamp": 1282689777,
461
+ "pub_description": null,
462
+ "end_user_title": "Temp Points"
463
+ }
464
+ ],
465
+ "created_timestamp": 1281043384,
466
+ "end_user_login": "testers",
467
+ "guid": "a24ff58ca0d711df966120ad2f73afad",
468
+ "received_good_summaries": []
469
+ }
470
+ ],
471
+ {}
472
+ ]
473
+ http_version: "1.1"