fake_stripe 0.0.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (82) hide show
  1. checksums.yaml +7 -0
  2. data/CONTRIBUTING.md +33 -0
  3. data/LICENSE +19 -0
  4. data/README.md +66 -0
  5. data/Rakefile +8 -0
  6. data/lib/fake_stripe.rb +49 -0
  7. data/lib/fake_stripe/assets/v1.js +38 -0
  8. data/lib/fake_stripe/assets/v2-mock.js +18 -0
  9. data/lib/fake_stripe/assets/v2.js +757 -0
  10. data/lib/fake_stripe/configuration.rb +15 -0
  11. data/lib/fake_stripe/fixtures/cancel_subscription.json +18 -0
  12. data/lib/fake_stripe/fixtures/cancel_transfer.json +161 -0
  13. data/lib/fake_stripe/fixtures/capture_charge.json +51 -0
  14. data/lib/fake_stripe/fixtures/close_dispute.json +13 -0
  15. data/lib/fake_stripe/fixtures/create_card.json +21 -0
  16. data/lib/fake_stripe/fixtures/create_charge.json +45 -0
  17. data/lib/fake_stripe/fixtures/create_coupon.json +17 -0
  18. data/lib/fake_stripe/fixtures/create_customer.json +51 -0
  19. data/lib/fake_stripe/fixtures/create_invoice.json +52 -0
  20. data/lib/fake_stripe/fixtures/create_invoiceitem.json +15 -0
  21. data/lib/fake_stripe/fixtures/create_plan.json +14 -0
  22. data/lib/fake_stripe/fixtures/create_recipient.json +25 -0
  23. data/lib/fake_stripe/fixtures/create_subscription.json +18 -0
  24. data/lib/fake_stripe/fixtures/create_token.json +26 -0
  25. data/lib/fake_stripe/fixtures/create_transfer.json +161 -0
  26. data/lib/fake_stripe/fixtures/delete_card.json +4 -0
  27. data/lib/fake_stripe/fixtures/delete_coupon.json +4 -0
  28. data/lib/fake_stripe/fixtures/delete_customer.json +4 -0
  29. data/lib/fake_stripe/fixtures/delete_customer_discount.json +4 -0
  30. data/lib/fake_stripe/fixtures/delete_invoiceitem.json +4 -0
  31. data/lib/fake_stripe/fixtures/delete_plan.json +4 -0
  32. data/lib/fake_stripe/fixtures/delete_recipient.json +4 -0
  33. data/lib/fake_stripe/fixtures/delete_subscription_discount.json +4 -0
  34. data/lib/fake_stripe/fixtures/list_application_fees.json +55 -0
  35. data/lib/fake_stripe/fixtures/list_balance_history.json +76 -0
  36. data/lib/fake_stripe/fixtures/list_cards.json +70 -0
  37. data/lib/fake_stripe/fixtures/list_charges.json +146 -0
  38. data/lib/fake_stripe/fixtures/list_coupons.json +58 -0
  39. data/lib/fake_stripe/fixtures/list_customers.json +157 -0
  40. data/lib/fake_stripe/fixtures/list_events.json +172 -0
  41. data/lib/fake_stripe/fixtures/list_invoiceitems.json +52 -0
  42. data/lib/fake_stripe/fixtures/list_invoices.json +199 -0
  43. data/lib/fake_stripe/fixtures/list_plans.json +49 -0
  44. data/lib/fake_stripe/fixtures/list_recipients.json +82 -0
  45. data/lib/fake_stripe/fixtures/list_subscriptions.json +100 -0
  46. data/lib/fake_stripe/fixtures/list_transfers.json +488 -0
  47. data/lib/fake_stripe/fixtures/pay_invoice.json +65 -0
  48. data/lib/fake_stripe/fixtures/refund_application_fee.json +17 -0
  49. data/lib/fake_stripe/fixtures/refund_charge.json +51 -0
  50. data/lib/fake_stripe/fixtures/retrieve_account.json +19 -0
  51. data/lib/fake_stripe/fixtures/retrieve_application_fee.json +17 -0
  52. data/lib/fake_stripe/fixtures/retrieve_balance.json +16 -0
  53. data/lib/fake_stripe/fixtures/retrieve_balance_transaction.json +23 -0
  54. data/lib/fake_stripe/fixtures/retrieve_card.json +21 -0
  55. data/lib/fake_stripe/fixtures/retrieve_charge.json +45 -0
  56. data/lib/fake_stripe/fixtures/retrieve_coupon.json +17 -0
  57. data/lib/fake_stripe/fixtures/retrieve_customer.json +51 -0
  58. data/lib/fake_stripe/fixtures/retrieve_event.json +56 -0
  59. data/lib/fake_stripe/fixtures/retrieve_invoice.json +64 -0
  60. data/lib/fake_stripe/fixtures/retrieve_invoice_line_items.json +61 -0
  61. data/lib/fake_stripe/fixtures/retrieve_invoiceitem.json +15 -0
  62. data/lib/fake_stripe/fixtures/retrieve_plan.json +14 -0
  63. data/lib/fake_stripe/fixtures/retrieve_recipient.json +25 -0
  64. data/lib/fake_stripe/fixtures/retrieve_subscription.json +31 -0
  65. data/lib/fake_stripe/fixtures/retrieve_token.json +26 -0
  66. data/lib/fake_stripe/fixtures/retrieve_transfer.json +161 -0
  67. data/lib/fake_stripe/fixtures/retrieve_upcoming_invoice.json +63 -0
  68. data/lib/fake_stripe/fixtures/update_card.json +21 -0
  69. data/lib/fake_stripe/fixtures/update_charge.json +45 -0
  70. data/lib/fake_stripe/fixtures/update_customer.json +51 -0
  71. data/lib/fake_stripe/fixtures/update_dispute.json +13 -0
  72. data/lib/fake_stripe/fixtures/update_invoice.json +64 -0
  73. data/lib/fake_stripe/fixtures/update_invoiceitem.json +15 -0
  74. data/lib/fake_stripe/fixtures/update_plan.json +14 -0
  75. data/lib/fake_stripe/fixtures/update_recipient.json +25 -0
  76. data/lib/fake_stripe/fixtures/update_subscription.json +18 -0
  77. data/lib/fake_stripe/fixtures/update_transfer.json +161 -0
  78. data/lib/fake_stripe/initializers/webmock.rb +3 -0
  79. data/lib/fake_stripe/stub_app.rb +307 -0
  80. data/lib/fake_stripe/stub_stripe_js.rb +29 -0
  81. data/lib/fake_stripe/version.rb +3 -0
  82. metadata +211 -0
@@ -0,0 +1,488 @@
1
+ {
2
+ "object": "list",
3
+ "url": "/v1/transfers",
4
+ "count": 3,
5
+ "data": [
6
+ {
7
+ "id": "tr_103ehW2eZvKYlo2CvqXdcIQL",
8
+ "object": "transfer",
9
+ "date": 1394841600,
10
+ "livemode": false,
11
+ "amount": 336081,
12
+ "currency": "usd",
13
+ "status": "pending",
14
+ "balance_transaction": "txn_103cQg2eZvKYlo2CYKVlR2nh",
15
+ "summary": {
16
+ "charge_gross": 365872,
17
+ "charge_fees": 29694,
18
+ "charge_fee_details": [
19
+ {
20
+ "amount": 29661,
21
+ "currency": "usd",
22
+ "type": "stripe_fee",
23
+ "description": null,
24
+ "application": null
25
+ }
26
+ ],
27
+ "refund_gross": -100,
28
+ "refund_fees": -3,
29
+ "refund_fee_details": [
30
+ {
31
+ "amount": -3,
32
+ "currency": "usd",
33
+ "type": "stripe_fee",
34
+ "description": null,
35
+ "application": null
36
+ }
37
+ ],
38
+ "adjustment_gross": 0,
39
+ "adjustment_fees": 0,
40
+ "adjustment_fee_details": [
41
+
42
+ ],
43
+ "validation_fees": 0,
44
+ "validation_count": 0,
45
+ "charge_count": 625,
46
+ "refund_count": 1,
47
+ "adjustment_count": 0,
48
+ "net": 336081,
49
+ "currency": "usd",
50
+ "collected_fee_gross": 0,
51
+ "collected_fee_count": 0,
52
+ "collected_fee_refund_gross": 0,
53
+ "collected_fee_refund_count": 0
54
+ },
55
+ "transactions": {
56
+ "object": "list",
57
+ "count": 626,
58
+ "url": "/v1/transfers/tr_103ehW2eZvKYlo2CvqXdcIQL/transactions",
59
+ "data": [
60
+ {
61
+ "id": "ch_103d7S2eZvKYlo2ClgiFvMVj",
62
+ "type": "charge",
63
+ "amount": 500,
64
+ "currency": "usd",
65
+ "net": 455,
66
+ "created": 1394311101,
67
+ "description": null,
68
+ "fee": 45,
69
+ "fee_details": [
70
+ {
71
+ "amount": 45,
72
+ "currency": "usd",
73
+ "type": "stripe_fee",
74
+ "description": "Stripe processing fees",
75
+ "application": null
76
+ }
77
+ ]
78
+ },
79
+ {
80
+ "id": "ch_103d4l2eZvKYlo2CYxMUKdVS",
81
+ "type": "charge",
82
+ "amount": 500,
83
+ "currency": "usd",
84
+ "net": 455,
85
+ "created": 1394301116,
86
+ "description": null,
87
+ "fee": 45,
88
+ "fee_details": [
89
+ {
90
+ "amount": 45,
91
+ "currency": "usd",
92
+ "type": "stripe_fee",
93
+ "description": "Stripe processing fees",
94
+ "application": null
95
+ }
96
+ ]
97
+ },
98
+ {
99
+ "id": "ch_103cv62eZvKYlo2CC16QiOJh",
100
+ "type": "charge",
101
+ "amount": 2000,
102
+ "currency": "usd",
103
+ "net": 1912,
104
+ "created": 1394265182,
105
+ "description": "payinguser@example.com",
106
+ "fee": 88,
107
+ "fee_details": [
108
+ {
109
+ "amount": 88,
110
+ "currency": "usd",
111
+ "type": "stripe_fee",
112
+ "description": "Stripe processing fees",
113
+ "application": null
114
+ }
115
+ ]
116
+ },
117
+ {
118
+ "id": "ch_103cnV2eZvKYlo2CRoDM3aSW",
119
+ "type": "charge",
120
+ "amount": 500,
121
+ "currency": "usd",
122
+ "net": 455,
123
+ "created": 1394236904,
124
+ "description": null,
125
+ "fee": 45,
126
+ "fee_details": [
127
+ {
128
+ "amount": 45,
129
+ "currency": "usd",
130
+ "type": "stripe_fee",
131
+ "description": "Stripe processing fees",
132
+ "application": null
133
+ }
134
+ ]
135
+ },
136
+ {
137
+ "id": "ch_103cnX2eZvKYlo2CrtXEpq5u",
138
+ "type": "charge",
139
+ "amount": 500,
140
+ "currency": "usd",
141
+ "net": 455,
142
+ "created": 1394237040,
143
+ "description": null,
144
+ "fee": 45,
145
+ "fee_details": [
146
+ {
147
+ "amount": 45,
148
+ "currency": "usd",
149
+ "type": "stripe_fee",
150
+ "description": "Stripe processing fees",
151
+ "application": null
152
+ }
153
+ ]
154
+ }
155
+ ]
156
+ },
157
+ "other_transfers": [
158
+ "tr_103ehW2eZvKYlo2CvqXdcIQL"
159
+ ],
160
+ "account": null,
161
+ "description": "STRIPE TRANSFER",
162
+ "metadata": {
163
+ },
164
+ "statement_descriptor": null,
165
+ "recipient": null
166
+ },
167
+ {
168
+ "id": "tr_103ehW2eZvKYlo2CvqXdcIQM",
169
+ "object": "transfer",
170
+ "date": 1394841601,
171
+ "livemode": false,
172
+ "amount": 336081,
173
+ "currency": "usd",
174
+ "status": "pending",
175
+ "balance_transaction": "txn_103cQg2eZvKYlo2CYKVlR2ni",
176
+ "summary": {
177
+ "charge_gross": 365872,
178
+ "charge_fees": 29694,
179
+ "charge_fee_details": [
180
+ {
181
+ "amount": 29661,
182
+ "currency": "usd",
183
+ "type": "stripe_fee",
184
+ "description": null,
185
+ "application": null
186
+ }
187
+ ],
188
+ "refund_gross": -100,
189
+ "refund_fees": -3,
190
+ "refund_fee_details": [
191
+ {
192
+ "amount": -3,
193
+ "currency": "usd",
194
+ "type": "stripe_fee",
195
+ "description": null,
196
+ "application": null
197
+ }
198
+ ],
199
+ "adjustment_gross": 0,
200
+ "adjustment_fees": 0,
201
+ "adjustment_fee_details": [
202
+ ],
203
+ "validation_fees": 0,
204
+ "validation_count": 0,
205
+ "charge_count": 625,
206
+ "refund_count": 1,
207
+ "adjustment_count": 0,
208
+ "net": 336081,
209
+ "currency": "usd",
210
+ "collected_fee_gross": 0,
211
+ "collected_fee_count": 0,
212
+ "collected_fee_refund_gross": 0,
213
+ "collected_fee_refund_count": 0
214
+ },
215
+ "transactions": {
216
+ "object": "list",
217
+ "count": 626,
218
+ "url": "/v1/transfers/tr_103ehW2eZvKYlo2CvqXdcIQM/transactions",
219
+ "data": [
220
+ {
221
+ "id": "ch_103d7S2eZvKYlo2ClgiFvMVk",
222
+ "type": "charge",
223
+ "amount": 500,
224
+ "currency": "usd",
225
+ "net": 455,
226
+ "created": 1394311102,
227
+ "description": null,
228
+ "fee": 45,
229
+ "fee_details": [
230
+ {
231
+ "amount": 45,
232
+ "currency": "usd",
233
+ "type": "stripe_fee",
234
+ "description": "Stripe processing fees",
235
+ "application": null
236
+ }
237
+ ]
238
+ },
239
+ {
240
+ "id": "ch_103d4l2eZvKYlo2CYxMUKdVT",
241
+ "type": "charge",
242
+ "amount": 500,
243
+ "currency": "usd",
244
+ "net": 455,
245
+ "created": 1394301117,
246
+ "description": null,
247
+ "fee": 45,
248
+ "fee_details": [
249
+ {
250
+ "amount": 45,
251
+ "currency": "usd",
252
+ "type": "stripe_fee",
253
+ "description": "Stripe processing fees",
254
+ "application": null
255
+ }
256
+ ]
257
+ },
258
+ {
259
+ "id": "ch_103cv62eZvKYlo2CC16QiOJi",
260
+ "type": "charge",
261
+ "amount": 2000,
262
+ "currency": "usd",
263
+ "net": 1912,
264
+ "created": 1394265182,
265
+ "description": "payinguser@example.com",
266
+ "fee": 88,
267
+ "fee_details": [
268
+ {
269
+ "amount": 88,
270
+ "currency": "usd",
271
+ "type": "stripe_fee",
272
+ "description": "Stripe processing fees",
273
+ "application": null
274
+ }
275
+ ]
276
+ },
277
+ {
278
+ "id": "ch_103cnV2eZvKYlo2CRoDM3aSX",
279
+ "type": "charge",
280
+ "amount": 500,
281
+ "currency": "usd",
282
+ "net": 455,
283
+ "created": 1394236905,
284
+ "description": null,
285
+ "fee": 45,
286
+ "fee_details": [
287
+ {
288
+ "amount": 45,
289
+ "currency": "usd",
290
+ "type": "stripe_fee",
291
+ "description": "Stripe processing fees",
292
+ "application": null
293
+ }
294
+ ]
295
+ },
296
+ {
297
+ "id": "ch_103cnX2eZvKYlo2CrtXEpq5v",
298
+ "type": "charge",
299
+ "amount": 500,
300
+ "currency": "usd",
301
+ "net": 455,
302
+ "created": 1394237041,
303
+ "description": null,
304
+ "fee": 45,
305
+ "fee_details": [
306
+ {
307
+ "amount": 45,
308
+ "currency": "usd",
309
+ "type": "stripe_fee",
310
+ "description": "Stripe processing fees",
311
+ "application": null
312
+ }
313
+ ]
314
+ }
315
+ ]
316
+ },
317
+ "other_transfers": [
318
+ "tr_103ehW2eZvKYlo2CvqXdcIQM"
319
+ ],
320
+ "account": null,
321
+ "description": "STRIPE TRANSFER",
322
+ "metadata": {
323
+ },
324
+ "statement_descriptor": null,
325
+ "recipient": null
326
+ },
327
+ {
328
+ "id": "tr_103ehW2eZvKYlo2CvqXdcIQN",
329
+ "object": "transfer",
330
+ "date": 1394841602,
331
+ "livemode": false,
332
+ "amount": 336081,
333
+ "currency": "usd",
334
+ "status": "pending",
335
+ "balance_transaction": "txn_103cQg2eZvKYlo2CYKVlR2nj",
336
+ "summary": {
337
+ "charge_gross": 365872,
338
+ "charge_fees": 29694,
339
+ "charge_fee_details": [
340
+ {
341
+ "amount": 29661,
342
+ "currency": "usd",
343
+ "type": "stripe_fee",
344
+ "description": null,
345
+ "application": null
346
+ }
347
+ ],
348
+ "refund_gross": -100,
349
+ "refund_fees": -3,
350
+ "refund_fee_details": [
351
+ {
352
+ "amount": -3,
353
+ "currency": "usd",
354
+ "type": "stripe_fee",
355
+ "description": null,
356
+ "application": null
357
+ }
358
+ ],
359
+ "adjustment_gross": 0,
360
+ "adjustment_fees": 0,
361
+ "adjustment_fee_details": [
362
+ ],
363
+ "validation_fees": 0,
364
+ "validation_count": 0,
365
+ "charge_count": 625,
366
+ "refund_count": 1,
367
+ "adjustment_count": 0,
368
+ "net": 336081,
369
+ "currency": "usd",
370
+ "collected_fee_gross": 0,
371
+ "collected_fee_count": 0,
372
+ "collected_fee_refund_gross": 0,
373
+ "collected_fee_refund_count": 0
374
+ },
375
+ "transactions": {
376
+ "object": "list",
377
+ "count": 626,
378
+ "url": "/v1/transfers/tr_103ehW2eZvKYlo2CvqXdcIQN/transactions",
379
+ "data": [
380
+ {
381
+ "id": "ch_103d7S2eZvKYlo2ClgiFvMVl",
382
+ "type": "charge",
383
+ "amount": 500,
384
+ "currency": "usd",
385
+ "net": 455,
386
+ "created": 1394311103,
387
+ "description": null,
388
+ "fee": 45,
389
+ "fee_details": [
390
+ {
391
+ "amount": 45,
392
+ "currency": "usd",
393
+ "type": "stripe_fee",
394
+ "description": "Stripe processing fees",
395
+ "application": null
396
+ }
397
+ ]
398
+ },
399
+ {
400
+ "id": "ch_103d4l2eZvKYlo2CYxMUKdVU",
401
+ "type": "charge",
402
+ "amount": 500,
403
+ "currency": "usd",
404
+ "net": 455,
405
+ "created": 1394301118,
406
+ "description": null,
407
+ "fee": 45,
408
+ "fee_details": [
409
+ {
410
+ "amount": 45,
411
+ "currency": "usd",
412
+ "type": "stripe_fee",
413
+ "description": "Stripe processing fees",
414
+ "application": null
415
+ }
416
+ ]
417
+ },
418
+ {
419
+ "id": "ch_103cv62eZvKYlo2CC16QiOJj",
420
+ "type": "charge",
421
+ "amount": 2000,
422
+ "currency": "usd",
423
+ "net": 1912,
424
+ "created": 1394265182,
425
+ "description": "payinguser@example.com",
426
+ "fee": 88,
427
+ "fee_details": [
428
+ {
429
+ "amount": 88,
430
+ "currency": "usd",
431
+ "type": "stripe_fee",
432
+ "description": "Stripe processing fees",
433
+ "application": null
434
+ }
435
+ ]
436
+ },
437
+ {
438
+ "id": "ch_103cnV2eZvKYlo2CRoDM3aSY",
439
+ "type": "charge",
440
+ "amount": 500,
441
+ "currency": "usd",
442
+ "net": 455,
443
+ "created": 1394236906,
444
+ "description": null,
445
+ "fee": 45,
446
+ "fee_details": [
447
+ {
448
+ "amount": 45,
449
+ "currency": "usd",
450
+ "type": "stripe_fee",
451
+ "description": "Stripe processing fees",
452
+ "application": null
453
+ }
454
+ ]
455
+ },
456
+ {
457
+ "id": "ch_103cnX2eZvKYlo2CrtXEpq5w",
458
+ "type": "charge",
459
+ "amount": 500,
460
+ "currency": "usd",
461
+ "net": 455,
462
+ "created": 1394237042,
463
+ "description": null,
464
+ "fee": 45,
465
+ "fee_details": [
466
+ {
467
+ "amount": 45,
468
+ "currency": "usd",
469
+ "type": "stripe_fee",
470
+ "description": "Stripe processing fees",
471
+ "application": null
472
+ }
473
+ ]
474
+ }
475
+ ]
476
+ },
477
+ "other_transfers": [
478
+ "tr_103ehW2eZvKYlo2CvqXdcIQN"
479
+ ],
480
+ "account": null,
481
+ "description": "STRIPE TRANSFER",
482
+ "metadata": {
483
+ },
484
+ "statement_descriptor": null,
485
+ "recipient": null
486
+ }
487
+ ]
488
+ }