epopia-stripe-ruby-mock 2.5.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (171) hide show
  1. checksums.yaml +7 -0
  2. data/.env +2 -0
  3. data/.gitignore +8 -0
  4. data/.rspec +1 -0
  5. data/.travis.yml +28 -0
  6. data/Gemfile +12 -0
  7. data/LICENSE.txt +22 -0
  8. data/README.md +413 -0
  9. data/Rakefile +14 -0
  10. data/bin/stripe-mock-server +19 -0
  11. data/lib/stripe_mock.rb +95 -0
  12. data/lib/stripe_mock/api/account_balance.rb +14 -0
  13. data/lib/stripe_mock/api/bank_tokens.rb +13 -0
  14. data/lib/stripe_mock/api/card_tokens.rb +13 -0
  15. data/lib/stripe_mock/api/client.rb +41 -0
  16. data/lib/stripe_mock/api/conversion_rate.rb +14 -0
  17. data/lib/stripe_mock/api/debug.rb +11 -0
  18. data/lib/stripe_mock/api/errors.rb +65 -0
  19. data/lib/stripe_mock/api/global_id_prefix.rb +22 -0
  20. data/lib/stripe_mock/api/instance.rb +38 -0
  21. data/lib/stripe_mock/api/live.rb +15 -0
  22. data/lib/stripe_mock/api/server.rb +39 -0
  23. data/lib/stripe_mock/api/test_helpers.rb +24 -0
  24. data/lib/stripe_mock/api/webhooks.rb +88 -0
  25. data/lib/stripe_mock/client.rb +127 -0
  26. data/lib/stripe_mock/data.rb +1193 -0
  27. data/lib/stripe_mock/data/list.rb +73 -0
  28. data/lib/stripe_mock/error_queue.rb +27 -0
  29. data/lib/stripe_mock/errors/closed_client_connection_error.rb +9 -0
  30. data/lib/stripe_mock/errors/server_timeout_error.rb +12 -0
  31. data/lib/stripe_mock/errors/stripe_mock_error.rb +15 -0
  32. data/lib/stripe_mock/errors/uninitialized_instance_error.rb +9 -0
  33. data/lib/stripe_mock/errors/unstarted_state_error.rb +9 -0
  34. data/lib/stripe_mock/errors/unsupported_request_error.rb +4 -0
  35. data/lib/stripe_mock/instance.rb +237 -0
  36. data/lib/stripe_mock/request_handlers/accounts.rb +86 -0
  37. data/lib/stripe_mock/request_handlers/balance.rb +17 -0
  38. data/lib/stripe_mock/request_handlers/balance_transactions.rb +37 -0
  39. data/lib/stripe_mock/request_handlers/cards.rb +35 -0
  40. data/lib/stripe_mock/request_handlers/charges.rb +177 -0
  41. data/lib/stripe_mock/request_handlers/country_spec.rb +22 -0
  42. data/lib/stripe_mock/request_handlers/coupons.rb +35 -0
  43. data/lib/stripe_mock/request_handlers/customers.rb +137 -0
  44. data/lib/stripe_mock/request_handlers/disputes.rb +35 -0
  45. data/lib/stripe_mock/request_handlers/ephemeral_key.rb +13 -0
  46. data/lib/stripe_mock/request_handlers/events.rb +21 -0
  47. data/lib/stripe_mock/request_handlers/external_accounts.rb +55 -0
  48. data/lib/stripe_mock/request_handlers/helpers/bank_account_helpers.rb +14 -0
  49. data/lib/stripe_mock/request_handlers/helpers/card_helpers.rb +127 -0
  50. data/lib/stripe_mock/request_handlers/helpers/charge_helpers.rb +16 -0
  51. data/lib/stripe_mock/request_handlers/helpers/coupon_helpers.rb +17 -0
  52. data/lib/stripe_mock/request_handlers/helpers/external_account_helpers.rb +49 -0
  53. data/lib/stripe_mock/request_handlers/helpers/subscription_helpers.rb +119 -0
  54. data/lib/stripe_mock/request_handlers/helpers/token_helpers.rb +44 -0
  55. data/lib/stripe_mock/request_handlers/invoice_items.rb +45 -0
  56. data/lib/stripe_mock/request_handlers/invoices.rb +177 -0
  57. data/lib/stripe_mock/request_handlers/orders.rb +80 -0
  58. data/lib/stripe_mock/request_handlers/payment_intents.rb +203 -0
  59. data/lib/stripe_mock/request_handlers/payment_methods.rb +112 -0
  60. data/lib/stripe_mock/request_handlers/payouts.rb +32 -0
  61. data/lib/stripe_mock/request_handlers/plans.rb +42 -0
  62. data/lib/stripe_mock/request_handlers/products.rb +43 -0
  63. data/lib/stripe_mock/request_handlers/recipients.rb +60 -0
  64. data/lib/stripe_mock/request_handlers/refunds.rb +91 -0
  65. data/lib/stripe_mock/request_handlers/sources.rb +55 -0
  66. data/lib/stripe_mock/request_handlers/subscription_items.rb +36 -0
  67. data/lib/stripe_mock/request_handlers/subscriptions.rb +296 -0
  68. data/lib/stripe_mock/request_handlers/tax_rates.rb +36 -0
  69. data/lib/stripe_mock/request_handlers/tokens.rb +75 -0
  70. data/lib/stripe_mock/request_handlers/transfers.rb +65 -0
  71. data/lib/stripe_mock/request_handlers/validators/param_validators.rb +32 -0
  72. data/lib/stripe_mock/server.rb +93 -0
  73. data/lib/stripe_mock/test_strategies/base.rb +81 -0
  74. data/lib/stripe_mock/test_strategies/live.rb +40 -0
  75. data/lib/stripe_mock/test_strategies/mock.rb +27 -0
  76. data/lib/stripe_mock/util.rb +44 -0
  77. data/lib/stripe_mock/version.rb +4 -0
  78. data/lib/stripe_mock/webhook_fixtures/account.application.deauthorized.json +12 -0
  79. data/lib/stripe_mock/webhook_fixtures/account.external_account.created.json +27 -0
  80. data/lib/stripe_mock/webhook_fixtures/account.external_account.deleted.json +27 -0
  81. data/lib/stripe_mock/webhook_fixtures/account.external_account.updated.json +27 -0
  82. data/lib/stripe_mock/webhook_fixtures/account.updated.json +26 -0
  83. data/lib/stripe_mock/webhook_fixtures/balance.available.json +25 -0
  84. data/lib/stripe_mock/webhook_fixtures/charge.dispute.closed.json +22 -0
  85. data/lib/stripe_mock/webhook_fixtures/charge.dispute.created.json +22 -0
  86. data/lib/stripe_mock/webhook_fixtures/charge.dispute.funds_reinstated.json +88 -0
  87. data/lib/stripe_mock/webhook_fixtures/charge.dispute.funds_withdrawn.json +88 -0
  88. data/lib/stripe_mock/webhook_fixtures/charge.dispute.updated.json +25 -0
  89. data/lib/stripe_mock/webhook_fixtures/charge.failed.json +56 -0
  90. data/lib/stripe_mock/webhook_fixtures/charge.refunded.json +69 -0
  91. data/lib/stripe_mock/webhook_fixtures/charge.succeeded.json +55 -0
  92. data/lib/stripe_mock/webhook_fixtures/charge.updated.json +58 -0
  93. data/lib/stripe_mock/webhook_fixtures/coupon.created.json +23 -0
  94. data/lib/stripe_mock/webhook_fixtures/coupon.deleted.json +23 -0
  95. data/lib/stripe_mock/webhook_fixtures/customer.created.json +54 -0
  96. data/lib/stripe_mock/webhook_fixtures/customer.deleted.json +42 -0
  97. data/lib/stripe_mock/webhook_fixtures/customer.discount.created.json +28 -0
  98. data/lib/stripe_mock/webhook_fixtures/customer.discount.deleted.json +28 -0
  99. data/lib/stripe_mock/webhook_fixtures/customer.discount.updated.json +43 -0
  100. data/lib/stripe_mock/webhook_fixtures/customer.source.created.json +32 -0
  101. data/lib/stripe_mock/webhook_fixtures/customer.source.deleted.json +32 -0
  102. data/lib/stripe_mock/webhook_fixtures/customer.source.updated.json +36 -0
  103. data/lib/stripe_mock/webhook_fixtures/customer.subscription.created.json +66 -0
  104. data/lib/stripe_mock/webhook_fixtures/customer.subscription.deleted.json +65 -0
  105. data/lib/stripe_mock/webhook_fixtures/customer.subscription.trial_will_end.json +65 -0
  106. data/lib/stripe_mock/webhook_fixtures/customer.subscription.updated.json +78 -0
  107. data/lib/stripe_mock/webhook_fixtures/customer.updated.json +57 -0
  108. data/lib/stripe_mock/webhook_fixtures/invoice.created.json +71 -0
  109. data/lib/stripe_mock/webhook_fixtures/invoice.payment_failed.json +105 -0
  110. data/lib/stripe_mock/webhook_fixtures/invoice.payment_succeeded.json +112 -0
  111. data/lib/stripe_mock/webhook_fixtures/invoice.updated.json +74 -0
  112. data/lib/stripe_mock/webhook_fixtures/invoiceitem.created.json +21 -0
  113. data/lib/stripe_mock/webhook_fixtures/invoiceitem.deleted.json +21 -0
  114. data/lib/stripe_mock/webhook_fixtures/invoiceitem.updated.json +24 -0
  115. data/lib/stripe_mock/webhook_fixtures/plan.created.json +20 -0
  116. data/lib/stripe_mock/webhook_fixtures/plan.deleted.json +20 -0
  117. data/lib/stripe_mock/webhook_fixtures/plan.updated.json +23 -0
  118. data/lib/stripe_mock/webhook_fixtures/transfer.created.json +89 -0
  119. data/lib/stripe_mock/webhook_fixtures/transfer.failed.json +89 -0
  120. data/lib/stripe_mock/webhook_fixtures/transfer.paid.json +89 -0
  121. data/lib/stripe_mock/webhook_fixtures/transfer.updated.json +92 -0
  122. data/lib/trollop.rb +782 -0
  123. data/spec/_dummy/webhooks/dummy.event.json +6 -0
  124. data/spec/api/instance_spec.rb +30 -0
  125. data/spec/fixtures/create_refund.yml +126 -0
  126. data/spec/fixtures/stripe_webhooks/account.updated.json +7 -0
  127. data/spec/fixtures/stripe_webhooks/custom.account.updated.json +5 -0
  128. data/spec/instance_spec.rb +100 -0
  129. data/spec/integration_examples/charge_token_examples.rb +51 -0
  130. data/spec/integration_examples/customer_card_examples.rb +42 -0
  131. data/spec/integration_examples/prepare_error_examples.rb +38 -0
  132. data/spec/list_spec.rb +140 -0
  133. data/spec/readme_spec.rb +75 -0
  134. data/spec/server_spec.rb +139 -0
  135. data/spec/shared_stripe_examples/account_examples.rb +96 -0
  136. data/spec/shared_stripe_examples/balance_examples.rb +11 -0
  137. data/spec/shared_stripe_examples/balance_transaction_examples.rb +63 -0
  138. data/spec/shared_stripe_examples/bank_examples.rb +229 -0
  139. data/spec/shared_stripe_examples/bank_token_examples.rb +59 -0
  140. data/spec/shared_stripe_examples/card_examples.rb +307 -0
  141. data/spec/shared_stripe_examples/card_token_examples.rb +185 -0
  142. data/spec/shared_stripe_examples/charge_examples.rb +510 -0
  143. data/spec/shared_stripe_examples/country_specs_examples.rb +18 -0
  144. data/spec/shared_stripe_examples/coupon_examples.rb +85 -0
  145. data/spec/shared_stripe_examples/customer_examples.rb +453 -0
  146. data/spec/shared_stripe_examples/dispute_examples.rb +98 -0
  147. data/spec/shared_stripe_examples/ephemeral_key_examples.rb +17 -0
  148. data/spec/shared_stripe_examples/error_mock_examples.rb +162 -0
  149. data/spec/shared_stripe_examples/external_account_examples.rb +170 -0
  150. data/spec/shared_stripe_examples/extra_features_examples.rb +36 -0
  151. data/spec/shared_stripe_examples/invoice_examples.rb +524 -0
  152. data/spec/shared_stripe_examples/invoice_item_examples.rb +69 -0
  153. data/spec/shared_stripe_examples/payment_intent_examples.rb +131 -0
  154. data/spec/shared_stripe_examples/payment_method_examples.rb +175 -0
  155. data/spec/shared_stripe_examples/payout_examples.rb +68 -0
  156. data/spec/shared_stripe_examples/plan_examples.rb +194 -0
  157. data/spec/shared_stripe_examples/product_example.rb +65 -0
  158. data/spec/shared_stripe_examples/recipient_examples.rb +118 -0
  159. data/spec/shared_stripe_examples/refund_examples.rb +472 -0
  160. data/spec/shared_stripe_examples/subscription_examples.rb +1148 -0
  161. data/spec/shared_stripe_examples/subscription_items_examples.rb +75 -0
  162. data/spec/shared_stripe_examples/tax_rate_examples.rb +42 -0
  163. data/spec/shared_stripe_examples/transfer_examples.rb +130 -0
  164. data/spec/shared_stripe_examples/validation_examples.rb +19 -0
  165. data/spec/shared_stripe_examples/webhook_event_examples.rb +261 -0
  166. data/spec/spec_helper.rb +58 -0
  167. data/spec/stripe_mock_spec.rb +123 -0
  168. data/spec/support/stripe_examples.rb +42 -0
  169. data/spec/util_spec.rb +121 -0
  170. data/stripe-ruby-mock.gemspec +27 -0
  171. metadata +344 -0
@@ -0,0 +1,65 @@
1
+ {
2
+ "created": 1326853478,
3
+ "livemode": false,
4
+ "id": "evt_00000000000000",
5
+ "type": "customer.subscription.deleted",
6
+ "object": "event",
7
+ "data": {
8
+ "object": {
9
+ "id": "su_00000000000000",
10
+ "items": {
11
+ "object": "list",
12
+ "data": [{
13
+ "id": "si_00000000000000",
14
+ "object": "subscription_item",
15
+ "created": 1497881783,
16
+ "plan": {
17
+ "interval": "month",
18
+ "product": "pr_00000000000000",
19
+ "amount": 100,
20
+ "currency": "usd",
21
+ "id": "fkx0AFo_00000000000000",
22
+ "object": "plan",
23
+ "livemode": false,
24
+ "interval_count": 1,
25
+ "trial_period_days": null,
26
+ "metadata": {}
27
+ },
28
+ "quantity": 1
29
+ },
30
+ {
31
+ "id": "si_00000000000001",
32
+ "object": "subscription_item",
33
+ "created": 1497881788,
34
+ "plan": {
35
+ "interval": "month",
36
+ "product": "pr_00000000000001",
37
+ "amount": 200,
38
+ "currency": "eur",
39
+ "id": "fkx0AFo_00000000000001",
40
+ "object": "plan",
41
+ "livemode": false,
42
+ "interval_count": 1,
43
+ "trial_period_days": null,
44
+ "metadata": {}
45
+ },
46
+ "quantity": 5
47
+ }
48
+ ]
49
+ },
50
+ "object": "subscription",
51
+ "start": 1381080564,
52
+ "status": "canceled",
53
+ "customer": "cus_00000000000000",
54
+ "cancel_at_period_end": false,
55
+ "current_period_start": 1381080564,
56
+ "current_period_end": 1383758964,
57
+ "ended_at": 1381021514,
58
+ "trial_start": null,
59
+ "trial_end": null,
60
+ "canceled_at": null,
61
+ "quantity": 1,
62
+ "application_fee_percent": null
63
+ }
64
+ }
65
+ }
@@ -0,0 +1,65 @@
1
+ {
2
+ "created": 1326853478,
3
+ "livemode": false,
4
+ "id": "evt_00000000000000",
5
+ "type": "customer.subscription.trial_will_end",
6
+ "object": "event",
7
+ "data": {
8
+ "object": {
9
+ "id": "su_00000000000000",
10
+ "items": {
11
+ "object": "list",
12
+ "data": [{
13
+ "id": "si_00000000000000",
14
+ "object": "subscription_item",
15
+ "created": 1497881783,
16
+ "plan": {
17
+ "interval": "month",
18
+ "product": "pr_00000000000000",
19
+ "amount": 100,
20
+ "currency": "usd",
21
+ "id": "fkx0AFo_00000000000000",
22
+ "object": "plan",
23
+ "livemode": false,
24
+ "interval_count": 1,
25
+ "trial_period_days": null,
26
+ "metadata": {}
27
+ },
28
+ "quantity": 1
29
+ },
30
+ {
31
+ "id": "si_00000000000001",
32
+ "object": "subscription_item",
33
+ "created": 1497881788,
34
+ "plan": {
35
+ "interval": "month",
36
+ "product": "pr_00000000000001",
37
+ "amount": 200,
38
+ "currency": "eur",
39
+ "id": "fkx0AFo_00000000000001",
40
+ "object": "plan",
41
+ "livemode": false,
42
+ "interval_count": 1,
43
+ "trial_period_days": null,
44
+ "metadata": {}
45
+ },
46
+ "quantity": 5
47
+ }
48
+ ]
49
+ },
50
+ "object": "subscription",
51
+ "start": 1381080623,
52
+ "status": "trialing",
53
+ "customer": "cus_00000000000000",
54
+ "cancel_at_period_end": false,
55
+ "current_period_start": 1381080623,
56
+ "current_period_end": 1383759023,
57
+ "ended_at": null,
58
+ "trial_start": 1381021530,
59
+ "trial_end": 1381280730,
60
+ "canceled_at": null,
61
+ "quantity": 1,
62
+ "application_fee_percent": null
63
+ }
64
+ }
65
+ }
@@ -0,0 +1,78 @@
1
+ {
2
+ "created": 1326853478,
3
+ "livemode": false,
4
+ "id": "evt_00000000000000",
5
+ "type": "customer.subscription.updated",
6
+ "object": "event",
7
+ "data": {
8
+ "object": {
9
+ "id": "su_00000000000000",
10
+ "items": {
11
+ "object": "list",
12
+ "data": [{
13
+ "id": "si_00000000000000",
14
+ "object": "subscription_item",
15
+ "created": 1497881783,
16
+ "plan": {
17
+ "interval": "month",
18
+ "product": "pr_00000000000000",
19
+ "amount": 100,
20
+ "currency": "usd",
21
+ "id": "fkx0AFo_00000000000000",
22
+ "object": "plan",
23
+ "livemode": false,
24
+ "interval_count": 1,
25
+ "trial_period_days": null,
26
+ "metadata": {}
27
+ },
28
+ "quantity": 1
29
+ },
30
+ {
31
+ "id": "si_00000000000001",
32
+ "object": "subscription_item",
33
+ "created": 1497881788,
34
+ "plan": {
35
+ "interval": "month",
36
+ "product": "pr_00000000000001",
37
+ "amount": 200,
38
+ "currency": "eur",
39
+ "id": "fkx0AFo_00000000000001",
40
+ "object": "plan",
41
+ "livemode": false,
42
+ "interval_count": 1,
43
+ "trial_period_days": null,
44
+ "metadata": {}
45
+ },
46
+ "quantity": 5
47
+ }
48
+ ]
49
+ },
50
+ "object": "subscription",
51
+ "start": 1381080561,
52
+ "status": "active",
53
+ "customer": "cus_00000000000000",
54
+ "cancel_at_period_end": false,
55
+ "current_period_start": 1381080561,
56
+ "current_period_end": 1383758961,
57
+ "ended_at": null,
58
+ "trial_start": null,
59
+ "trial_end": null,
60
+ "canceled_at": null,
61
+ "quantity": 1,
62
+ "application_fee_percent": null
63
+ },
64
+ "previous_attributes": {
65
+ "plan": {
66
+ "interval": "month",
67
+ "product": "pr_00000000000002",
68
+ "amount": 100,
69
+ "currency": "usd",
70
+ "id": "OLD_PLAN_ID",
71
+ "object": "plan",
72
+ "livemode": false,
73
+ "interval_count": 1,
74
+ "trial_period_days": null
75
+ }
76
+ }
77
+ }
78
+ }
@@ -0,0 +1,57 @@
1
+ {
2
+ "created": 1326853478,
3
+ "livemode": false,
4
+ "id": "evt_00000000000000",
5
+ "type": "customer.updated",
6
+ "object": "event",
7
+ "data": {
8
+ "object": {
9
+ "object": "customer",
10
+ "created": 1375148334,
11
+ "id": "cus_00000000000000",
12
+ "livemode": false,
13
+ "description": null,
14
+ "email": "bond@mailinator.com",
15
+ "delinquent": true,
16
+ "metadata": {
17
+ },
18
+ "subscription": null,
19
+ "discount": null,
20
+ "account_balance": 0,
21
+ "sources": {
22
+ "object": "list",
23
+ "count": 1,
24
+ "url": "/v1/customers/cus_2I2AhGQOPmEFeu/cards",
25
+ "data": [
26
+ {
27
+ "id": "cc_2I2akIhmladin5",
28
+ "object": "card",
29
+ "last4": "0341",
30
+ "type": "Visa",
31
+ "brand": "Visa",
32
+ "funding": "credit",
33
+ "exp_month": 12,
34
+ "exp_year": 2013,
35
+ "fingerprint": "fWvZEzdbEIFF8QrK",
36
+ "customer": "cus_2I2AhGQOPmEFeu",
37
+ "country": "US",
38
+ "name": "Johnny Goodman",
39
+ "address_line1": null,
40
+ "address_line2": null,
41
+ "address_city": null,
42
+ "address_state": null,
43
+ "address_zip": null,
44
+ "address_country": null,
45
+ "cvc_check": "pass",
46
+ "address_line1_check": null,
47
+ "address_zip_check": null
48
+ }
49
+ ]
50
+ },
51
+ "default_source": "cc_2I2akIhmladin5"
52
+ },
53
+ "previous_attributes": {
54
+ "description": "Old description"
55
+ }
56
+ }
57
+ }
@@ -0,0 +1,71 @@
1
+ {
2
+ "created": 1326853478,
3
+ "livemode": false,
4
+ "id": "evt_00000000000000",
5
+ "type": "invoice.created",
6
+ "status": "paid",
7
+ "object": "event",
8
+ "data": {
9
+ "object": {
10
+ "created": 1380674206,
11
+ "id": "in_00000000000000",
12
+ "period_start": 1378082075,
13
+ "period_end": 1380674075,
14
+ "lines": {
15
+ "count": 1,
16
+ "object": "list",
17
+ "url": "/v1/invoices/in_00000000000000/lines",
18
+ "data": [
19
+ {
20
+ "id": "su_2hksGtIPylSBg2",
21
+ "object": "line_item",
22
+ "type": "subscription",
23
+ "livemode": true,
24
+ "amount": 100,
25
+ "currency": "usd",
26
+ "proration": false,
27
+ "period": {
28
+ "start": 1383759042,
29
+ "end": 1386351042
30
+ },
31
+ "quantity": 1,
32
+ "plan": {
33
+ "interval": "month",
34
+ "amount": 100,
35
+ "currency": "usd",
36
+ "id": "fkx0AFo",
37
+ "object": "plan",
38
+ "livemode": false,
39
+ "interval_count": 1,
40
+ "trial_period_days": null,
41
+ "product": "pr_00000000000000",
42
+ "metadata": {}
43
+ },
44
+ "description": null,
45
+ "metadata": null
46
+ }
47
+ ]
48
+ },
49
+ "subtotal": 1000,
50
+ "total": 1000,
51
+ "customer": "cus_00000000000000",
52
+ "object": "invoice",
53
+ "attempted": false,
54
+ "closed": true,
55
+ "paid": true,
56
+ "livemode": false,
57
+ "attempt_count": 1,
58
+ "amount_due": 1000,
59
+ "currency": "usd",
60
+ "starting_balance": 0,
61
+ "ending_balance": 0,
62
+ "next_payment_attempt": null,
63
+ "charge": "ch_00000000000000",
64
+ "discount": null,
65
+ "application_fee": null,
66
+ "subscription": "sub_00000000000000",
67
+ "metadata": {},
68
+ "description": null
69
+ }
70
+ }
71
+ }
@@ -0,0 +1,105 @@
1
+ {
2
+ "created": 1326853478,
3
+ "livemode": false,
4
+ "id": "evt_00000000000000",
5
+ "type": "invoice.payment_failed",
6
+ "object": "event",
7
+ "data": {
8
+ "object": {
9
+ "date": 1380674206,
10
+ "id": "in_00000000000000",
11
+ "period_start": 1378082075,
12
+ "period_end": 1380674075,
13
+ "lines": {
14
+ "object": "list",
15
+ "count": 3,
16
+ "url": "/v1/invoices/in_00000000000000/lines",
17
+ "data": [
18
+ {
19
+ "id": "ii_00000000000000",
20
+ "object": "line_item",
21
+ "type": "invoiceitem",
22
+ "livemode": false,
23
+ "amount": 19000,
24
+ "currency": "usd",
25
+ "proration": true,
26
+ "period": {
27
+ "start": 1393765661,
28
+ "end": 1393765661
29
+ },
30
+ "quantity": null,
31
+ "plan": null,
32
+ "description": "Remaining time on Platinum after 02 Mar 2014",
33
+ "metadata": {}
34
+ },
35
+ {
36
+ "id": "ii_00000000000001",
37
+ "object": "line_item",
38
+ "type": "invoiceitem",
39
+ "livemode": false,
40
+ "amount": -9000,
41
+ "currency": "usd",
42
+ "proration": true,
43
+ "period": {
44
+ "start": 1393765661,
45
+ "end": 1393765661
46
+ },
47
+ "quantity": null,
48
+ "plan": null,
49
+ "description": "Unused time on Gold after 05 Mar 2014",
50
+ "metadata": {}
51
+ },
52
+ {
53
+ "id": "su_00000000000000",
54
+ "object": "line_item",
55
+ "type": "subscription",
56
+ "livemode": false,
57
+ "amount": 20000,
58
+ "currency": "usd",
59
+ "proration": false,
60
+ "period": {
61
+ "start": 1383759053,
62
+ "end": 1386351053
63
+ },
64
+ "quantity": 1,
65
+ "plan": {
66
+ "interval": "month",
67
+ "product": "pr_00000000000000",
68
+ "created": 1300000000,
69
+ "amount": 20000,
70
+ "currency": "usd",
71
+ "id": "platinum",
72
+ "object": "plan",
73
+ "livemode": false,
74
+ "interval_count": 1,
75
+ "trial_period_days": null,
76
+ "metadata": {}
77
+ },
78
+ "description": null,
79
+ "metadata": null
80
+ }
81
+ ]
82
+ },
83
+ "subtotal": 30000,
84
+ "total": 30000,
85
+ "customer": "cus_00000000000000",
86
+ "object": "invoice",
87
+ "attempted": true,
88
+ "closed": false,
89
+ "paid": false,
90
+ "livemode": false,
91
+ "attempt_count": 1,
92
+ "amount_due": 30000,
93
+ "currency": "usd",
94
+ "starting_balance": 0,
95
+ "ending_balance": 0,
96
+ "next_payment_attempt": 1380760475,
97
+ "charge": "ch_00000000000000",
98
+ "discount": null,
99
+ "application_fee": null,
100
+ "subscription": "su_00000000000000",
101
+ "metadata": {},
102
+ "description": null
103
+ }
104
+ }
105
+ }
@@ -0,0 +1,112 @@
1
+ {
2
+ "created": 1326853478,
3
+ "livemode": false,
4
+ "id": "evt_00000000000000",
5
+ "type": "invoice.payment_succeeded",
6
+ "object": "event",
7
+ "data": {
8
+ "object": {
9
+ "id": "in_00000000000000",
10
+ "object": "invoice",
11
+ "amount_due": 999,
12
+ "application_fee": null,
13
+ "attempt_count": 1,
14
+ "attempted": true,
15
+ "charge": "ch_18EcOcLrgDIZ7iq8TaNlErVv",
16
+ "closed": true,
17
+ "currency": "eur",
18
+ "customer": "cus_00000000000000",
19
+ "created": 1464084258,
20
+ "description": null,
21
+ "discount": null,
22
+ "ending_balance": 0,
23
+ "forgiven": false,
24
+ "lines": {
25
+ "data": [{
26
+ "id": "sub_00000000000000",
27
+ "object": "line_item",
28
+ "amount": 50,
29
+ "currency": "eur",
30
+ "description": null,
31
+ "discountable": true,
32
+ "livemode": true,
33
+ "metadata": {},
34
+ "period": {
35
+ "start": 1500637196,
36
+ "end": 1532173196
37
+ },
38
+ "plan": {
39
+ "id": "platinum",
40
+ "object": "plan",
41
+ "amount": 500,
42
+ "created": 1499943145,
43
+ "currency": "eur",
44
+ "interval": "month",
45
+ "interval_count": 1,
46
+ "livemode": false,
47
+ "metadata": {},
48
+ "name": "New Plan Test",
49
+ "statement_descriptor": null,
50
+ "trial_period_days": null
51
+ },
52
+ "proration": false,
53
+ "quantity": 1,
54
+ "subscription": null,
55
+ "subscription_item": "si_18ZfWyLrgDIZ7iq8fSlSNGIV",
56
+ "type": "subscription"
57
+ },
58
+ {
59
+ "id": "sub_00000000000000",
60
+ "object": "line_item",
61
+ "amount": 50,
62
+ "currency": "eur",
63
+ "description": null,
64
+ "discountable": true,
65
+ "livemode": true,
66
+ "metadata": {},
67
+ "period": {
68
+ "start": 1500637196,
69
+ "end": 1532173196
70
+ },
71
+ "plan": {
72
+ "id": "gold",
73
+ "object": "plan",
74
+ "amount": 300,
75
+ "created": 1499943155,
76
+ "currency": "eur",
77
+ "interval": "month",
78
+ "interval_count": 1,
79
+ "livemode": false,
80
+ "metadata": {},
81
+ "name": "New gold Plan Test",
82
+ "statement_descriptor": null,
83
+ "trial_period_days": null
84
+ },
85
+ "proration": false,
86
+ "quantity": 1,
87
+ "subscription": null,
88
+ "subscription_item": "si_18ZfWyLrgDIZ7iq8fSlSNGIV",
89
+ "type": "subscription"
90
+ }],
91
+ "total_count": 1,
92
+ "object": "list",
93
+ "url": "/v1/invoices/in_18EcOcLrgDIZ7iq8zsDkunZ0/lines"
94
+ },
95
+ "livemode": false,
96
+ "metadata": {},
97
+ "next_payment_attempt": null,
98
+ "paid": true,
99
+ "period_end": 1464084258,
100
+ "period_start": 1464084258,
101
+ "receipt_number": null,
102
+ "starting_balance": 0,
103
+ "statement_descriptor": null,
104
+ "subscription": "sub_00000000000000",
105
+ "subtotal": 999,
106
+ "tax": null,
107
+ "tax_percent": null,
108
+ "total": 999,
109
+ "webhooks_delivered_at": 1464084258
110
+ }
111
+ }
112
+ }