stripe-ruby-mock 3.1.0.rc2 → 3.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (117) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/rspec_tests.yml +38 -0
  3. data/.rspec +2 -1
  4. data/CHANGELOG.md +34 -0
  5. data/README.md +5 -3
  6. data/lib/stripe_mock/api/webhooks.rb +65 -26
  7. data/lib/stripe_mock/data.rb +80 -11
  8. data/lib/stripe_mock/instance.rb +6 -2
  9. data/lib/stripe_mock/request_handlers/accounts.rb +17 -6
  10. data/lib/stripe_mock/request_handlers/charges.rb +5 -0
  11. data/lib/stripe_mock/request_handlers/checkout_session.rb +165 -2
  12. data/lib/stripe_mock/request_handlers/events.rb +30 -3
  13. data/lib/stripe_mock/request_handlers/helpers/coupon_helpers.rb +1 -0
  14. data/lib/stripe_mock/request_handlers/helpers/subscription_helpers.rb +28 -9
  15. data/lib/stripe_mock/request_handlers/invoices.rb +6 -1
  16. data/lib/stripe_mock/request_handlers/payment_intents.rb +13 -2
  17. data/lib/stripe_mock/request_handlers/payment_methods.rb +5 -1
  18. data/lib/stripe_mock/request_handlers/prices.rb +18 -0
  19. data/lib/stripe_mock/request_handlers/promotion_codes.rb +43 -0
  20. data/lib/stripe_mock/request_handlers/refunds.rb +13 -2
  21. data/lib/stripe_mock/request_handlers/setup_intents.rb +16 -9
  22. data/lib/stripe_mock/request_handlers/subscriptions.rb +93 -4
  23. data/lib/stripe_mock/request_handlers/transfers.rb +12 -1
  24. data/lib/stripe_mock/request_handlers/validators/param_validators.rb +5 -8
  25. data/lib/stripe_mock/server.rb +2 -2
  26. data/lib/stripe_mock/test_strategies/base.rb +51 -25
  27. data/lib/stripe_mock/version.rb +1 -1
  28. data/lib/stripe_mock/webhook_fixtures/account.updated.json +1 -1
  29. data/lib/stripe_mock/webhook_fixtures/balance.available.json +26 -20
  30. data/lib/stripe_mock/webhook_fixtures/charge.captured.json +143 -0
  31. data/lib/stripe_mock/webhook_fixtures/charge.dispute.created.json +63 -16
  32. data/lib/stripe_mock/webhook_fixtures/charge.failed.json +49 -120
  33. data/lib/stripe_mock/webhook_fixtures/charge.refund.updated.json +35 -0
  34. data/lib/stripe_mock/webhook_fixtures/charge.refunded.json +145 -50
  35. data/lib/stripe_mock/webhook_fixtures/charge.succeeded.json +114 -43
  36. data/lib/stripe_mock/webhook_fixtures/checkout.session.completed.json +79 -0
  37. data/lib/stripe_mock/webhook_fixtures/checkout.session.completed.payment_mode.json +53 -0
  38. data/lib/stripe_mock/webhook_fixtures/checkout.session.completed.setup_mode.json +45 -0
  39. data/lib/stripe_mock/webhook_fixtures/customer.created.json +37 -46
  40. data/lib/stripe_mock/webhook_fixtures/customer.deleted.json +36 -32
  41. data/lib/stripe_mock/webhook_fixtures/customer.source.created.json +31 -22
  42. data/lib/stripe_mock/webhook_fixtures/customer.source.updated.json +36 -25
  43. data/lib/stripe_mock/webhook_fixtures/customer.subscription.created.json +135 -47
  44. data/lib/stripe_mock/webhook_fixtures/customer.subscription.deleted.json +134 -45
  45. data/lib/stripe_mock/webhook_fixtures/customer.subscription.updated.json +135 -56
  46. data/lib/stripe_mock/webhook_fixtures/customer.updated.json +38 -47
  47. data/lib/stripe_mock/webhook_fixtures/invoice.created.json +176 -49
  48. data/lib/stripe_mock/webhook_fixtures/invoice.finalized.json +171 -0
  49. data/lib/stripe_mock/webhook_fixtures/invoice.paid.json +171 -0
  50. data/lib/stripe_mock/webhook_fixtures/invoice.payment_action_required.json +171 -0
  51. data/lib/stripe_mock/webhook_fixtures/invoice.payment_failed.json +149 -83
  52. data/lib/stripe_mock/webhook_fixtures/invoice.payment_succeeded.json +149 -90
  53. data/lib/stripe_mock/webhook_fixtures/invoice.upcoming.json +70 -0
  54. data/lib/stripe_mock/webhook_fixtures/invoice.updated.json +178 -50
  55. data/lib/stripe_mock/webhook_fixtures/invoiceitem.created.json +87 -13
  56. data/lib/stripe_mock/webhook_fixtures/invoiceitem.updated.json +88 -14
  57. data/lib/stripe_mock/webhook_fixtures/mandate.updated.json +34 -0
  58. data/lib/stripe_mock/webhook_fixtures/payment_intent.amount_capturable_updated.json +170 -0
  59. data/lib/stripe_mock/webhook_fixtures/payment_intent.canceled.json +73 -0
  60. data/lib/stripe_mock/webhook_fixtures/payment_intent.created.json +86 -0
  61. data/lib/stripe_mock/webhook_fixtures/payment_intent.payment_failed.json +118 -79
  62. data/lib/stripe_mock/webhook_fixtures/payment_intent.processing.json +162 -0
  63. data/lib/stripe_mock/webhook_fixtures/payment_intent.requires_action.json +191 -0
  64. data/lib/stripe_mock/webhook_fixtures/payment_intent.succeeded.json +85 -53
  65. data/lib/stripe_mock/webhook_fixtures/payment_link.created.json +47 -0
  66. data/lib/stripe_mock/webhook_fixtures/payment_link.updated.json +50 -0
  67. data/lib/stripe_mock/webhook_fixtures/payment_method.attached.json +63 -0
  68. data/lib/stripe_mock/webhook_fixtures/payment_method.detached.json +62 -0
  69. data/lib/stripe_mock/webhook_fixtures/payout.created.json +40 -0
  70. data/lib/stripe_mock/webhook_fixtures/payout.paid.json +40 -0
  71. data/lib/stripe_mock/webhook_fixtures/payout.updated.json +46 -0
  72. data/lib/stripe_mock/webhook_fixtures/plan.created.json +30 -13
  73. data/lib/stripe_mock/webhook_fixtures/plan.deleted.json +30 -13
  74. data/lib/stripe_mock/webhook_fixtures/plan.updated.json +34 -14
  75. data/lib/stripe_mock/webhook_fixtures/price.created.json +42 -0
  76. data/lib/stripe_mock/webhook_fixtures/price.deleted.json +42 -0
  77. data/lib/stripe_mock/webhook_fixtures/price.updated.json +48 -0
  78. data/lib/stripe_mock/webhook_fixtures/product.created.json +19 -13
  79. data/lib/stripe_mock/webhook_fixtures/product.deleted.json +20 -14
  80. data/lib/stripe_mock/webhook_fixtures/product.updated.json +24 -15
  81. data/lib/stripe_mock/webhook_fixtures/quote.accepted.json +92 -0
  82. data/lib/stripe_mock/webhook_fixtures/quote.canceled.json +92 -0
  83. data/lib/stripe_mock/webhook_fixtures/quote.created.json +92 -0
  84. data/lib/stripe_mock/webhook_fixtures/quote.finalized.json +92 -0
  85. data/lib/stripe_mock/webhook_fixtures/setup_intent.canceled.json +46 -0
  86. data/lib/stripe_mock/webhook_fixtures/setup_intent.created.json +51 -0
  87. data/lib/stripe_mock/webhook_fixtures/setup_intent.setup_failed.json +100 -0
  88. data/lib/stripe_mock/webhook_fixtures/setup_intent.succeeded.json +46 -0
  89. data/lib/stripe_mock/webhook_fixtures/subscription_schedule.canceled.json +119 -0
  90. data/lib/stripe_mock/webhook_fixtures/subscription_schedule.created.json +114 -0
  91. data/lib/stripe_mock/webhook_fixtures/subscription_schedule.released.json +111 -0
  92. data/lib/stripe_mock/webhook_fixtures/subscription_schedule.updated.json +125 -0
  93. data/lib/stripe_mock/webhook_fixtures/tax_rate.created.json +32 -0
  94. data/lib/stripe_mock/webhook_fixtures/tax_rate.updated.json +37 -0
  95. data/lib/stripe_mock.rb +3 -1
  96. data/spec/instance_spec.rb +3 -1
  97. data/spec/integration_examples/completing_checkout_sessions_example.rb +37 -0
  98. data/spec/readme_spec.rb +1 -1
  99. data/spec/shared_stripe_examples/account_examples.rb +9 -1
  100. data/spec/shared_stripe_examples/checkout_session_examples.rb +99 -0
  101. data/spec/shared_stripe_examples/invoice_examples.rb +21 -0
  102. data/spec/shared_stripe_examples/payment_intent_examples.rb +74 -0
  103. data/spec/shared_stripe_examples/payment_method_examples.rb +32 -27
  104. data/spec/shared_stripe_examples/price_examples.rb +42 -2
  105. data/spec/shared_stripe_examples/product_examples.rb +1 -9
  106. data/spec/shared_stripe_examples/promotion_code_examples.rb +68 -0
  107. data/spec/shared_stripe_examples/refund_examples.rb +13 -0
  108. data/spec/shared_stripe_examples/setup_intent_examples.rb +17 -0
  109. data/spec/shared_stripe_examples/subscription_examples.rb +213 -2
  110. data/spec/shared_stripe_examples/transfer_examples.rb +10 -1
  111. data/spec/shared_stripe_examples/webhook_event_examples.rb +51 -5
  112. data/spec/support/stripe_examples.rb +3 -1
  113. data/stripe-ruby-mock.gemspec +1 -1
  114. metadata +54 -11
  115. data/.travis.yml +0 -25
  116. data/lib/stripe_mock/request_handlers/checkout.rb +0 -15
  117. data/spec/shared_stripe_examples/checkout_examples.rb +0 -38
@@ -1,58 +1,49 @@
1
1
  {
2
- "created": 1326853478,
3
- "livemode": false,
4
- "id": "evt_00000000000000",
5
- "type": "customer.updated",
2
+ "id": "evt_000000000000000000000000",
6
3
  "object": "event",
4
+ "api_version": "2020-08-27",
5
+ "created": 1648320110,
7
6
  "data": {
8
7
  "object": {
9
- "object": "customer",
10
- "created": 1375148334,
11
8
  "id": "cus_00000000000000",
9
+ "object": "customer",
10
+ "address": null,
11
+ "balance": 0,
12
+ "created": 1648320107,
13
+ "currency": "usd",
14
+ "default_source": "card_000000000000000000000000",
15
+ "delinquent": false,
16
+ "description": "(created by Stripe CLI)",
17
+ "discount": null,
18
+ "email": null,
19
+ "invoice_prefix": "985BA9CB",
20
+ "invoice_settings": {
21
+ "custom_fields": null,
22
+ "default_payment_method": null,
23
+ "footer": null
24
+ },
12
25
  "livemode": false,
13
- "description": null,
14
- "email": "bond@mailinator.com",
15
- "delinquent": true,
16
26
  "metadata": {
17
27
  },
18
- "preferred_locales": [],
19
- "subscription": null,
20
- "discount": null,
21
- "account_balance": 0,
22
- "sources": {
23
- "object": "list",
24
- "count": 1,
25
- "url": "/v1/customers/cus_2I2AhGQOPmEFeu/cards",
26
- "data": [
27
- {
28
- "id": "cc_2I2akIhmladin5",
29
- "object": "card",
30
- "last4": "0341",
31
- "type": "Visa",
32
- "brand": "Visa",
33
- "funding": "credit",
34
- "exp_month": 12,
35
- "exp_year": 2013,
36
- "fingerprint": "fWvZEzdbEIFF8QrK",
37
- "customer": "cus_2I2AhGQOPmEFeu",
38
- "country": "US",
39
- "name": "Johnny Goodman",
40
- "address_line1": null,
41
- "address_line2": null,
42
- "address_city": null,
43
- "address_state": null,
44
- "address_zip": null,
45
- "address_country": null,
46
- "cvc_check": "pass",
47
- "address_line1_check": null,
48
- "address_zip_check": null
49
- }
50
- ]
51
- },
52
- "default_source": "cc_2I2akIhmladin5"
28
+ "name": null,
29
+ "next_invoice_sequence": 1,
30
+ "phone": null,
31
+ "preferred_locales": [
32
+
33
+ ],
34
+ "shipping": null,
35
+ "tax_exempt": "none",
36
+ "test_clock": null
53
37
  },
54
38
  "previous_attributes": {
55
- "description": "Old description"
39
+ "currency": null
56
40
  }
57
- }
58
- }
41
+ },
42
+ "livemode": false,
43
+ "pending_webhooks": 2,
44
+ "request": {
45
+ "id": "req_00000000000000",
46
+ "idempotency_key": "af06a7d9-5408-4f65-8379-59a93874d04c"
47
+ },
48
+ "type": "customer.updated"
49
+ }
@@ -1,71 +1,198 @@
1
1
  {
2
- "created": 1326853478,
3
- "livemode": false,
4
- "id": "evt_00000000000000",
5
- "type": "invoice.created",
6
- "status": "paid",
2
+ "id": "evt_000000000000000000000000",
7
3
  "object": "event",
4
+ "api_version": "2020-08-27",
5
+ "created": 1648320110,
8
6
  "data": {
9
7
  "object": {
10
- "created": 1380674206,
11
- "id": "in_00000000000000",
12
- "period_start": 1378082075,
13
- "period_end": 1380674075,
8
+ "id": "in_000000000000000000000000",
9
+ "object": "invoice",
10
+ "account_country": "US",
11
+ "account_name": "Example Company, Inc.",
12
+ "account_tax_ids": null,
13
+ "amount_due": 1500,
14
+ "amount_paid": 0,
15
+ "amount_remaining": 1500,
16
+ "application_fee_amount": null,
17
+ "attempt_count": 0,
18
+ "attempted": false,
19
+ "auto_advance": true,
20
+ "automatic_tax": {
21
+ "enabled": false,
22
+ "status": null
23
+ },
24
+ "billing_reason": "subscription_create",
25
+ "charge": null,
26
+ "collection_method": "charge_automatically",
27
+ "created": 1648320110,
28
+ "currency": "usd",
29
+ "custom_fields": null,
30
+ "customer": "cus_00000000000000",
31
+ "customer_address": null,
32
+ "customer_email": null,
33
+ "customer_name": null,
34
+ "customer_phone": null,
35
+ "customer_shipping": null,
36
+ "customer_tax_exempt": "none",
37
+ "customer_tax_ids": [
38
+
39
+ ],
40
+ "default_payment_method": null,
41
+ "default_source": null,
42
+ "default_tax_rates": [
43
+
44
+ ],
45
+ "description": null,
46
+ "discount": null,
47
+ "discounts": [
48
+
49
+ ],
50
+ "due_date": null,
51
+ "ending_balance": null,
52
+ "footer": null,
53
+ "hosted_invoice_url": null,
54
+ "invoice_pdf": null,
55
+ "last_finalization_error": null,
14
56
  "lines": {
15
- "count": 1,
16
57
  "object": "list",
17
- "url": "/v1/invoices/in_00000000000000/lines",
18
58
  "data": [
19
59
  {
20
- "id": "su_2hksGtIPylSBg2",
60
+ "id": "il_000000000000000000000000",
21
61
  "object": "line_item",
22
- "type": "subscription",
23
- "livemode": true,
24
- "amount": 100,
62
+ "amount": 1500,
25
63
  "currency": "usd",
26
- "proration": false,
64
+ "description": "1 × myproduct (at $15.00 / month)",
65
+ "discount_amounts": [
66
+
67
+ ],
68
+ "discountable": true,
69
+ "discounts": [
70
+
71
+ ],
72
+ "livemode": false,
73
+ "metadata": {
74
+ },
27
75
  "period": {
28
- "start": 1383759042,
29
- "end": 1386351042
76
+ "end": 1650998510,
77
+ "start": 1648320110
30
78
  },
31
- "quantity": 1,
32
79
  "plan": {
33
- "interval": "month",
34
- "amount": 100,
35
- "currency": "usd",
36
- "id": "fkx0AFo",
80
+ "id": "price_000000000000000000000000",
37
81
  "object": "plan",
38
- "livemode": false,
82
+ "active": true,
83
+ "aggregate_usage": null,
84
+ "amount": 1500,
85
+ "amount_decimal": "1500",
86
+ "billing_scheme": "per_unit",
87
+ "created": 1648320109,
88
+ "currency": "usd",
89
+ "interval": "month",
39
90
  "interval_count": 1,
91
+ "livemode": false,
92
+ "metadata": {
93
+ },
94
+ "nickname": null,
95
+ "product": "prod_00000000000000",
96
+ "tiers_mode": null,
97
+ "transform_usage": null,
40
98
  "trial_period_days": null,
41
- "product": "pr_00000000000000",
42
- "metadata": {}
99
+ "usage_type": "licensed"
43
100
  },
44
- "description": null,
45
- "metadata": null
101
+ "price": {
102
+ "id": "price_000000000000000000000000",
103
+ "object": "price",
104
+ "active": true,
105
+ "billing_scheme": "per_unit",
106
+ "created": 1648320109,
107
+ "currency": "usd",
108
+ "livemode": false,
109
+ "lookup_key": null,
110
+ "metadata": {
111
+ },
112
+ "nickname": null,
113
+ "product": "prod_00000000000000",
114
+ "recurring": {
115
+ "aggregate_usage": null,
116
+ "interval": "month",
117
+ "interval_count": 1,
118
+ "trial_period_days": null,
119
+ "usage_type": "licensed"
120
+ },
121
+ "tax_behavior": "unspecified",
122
+ "tiers_mode": null,
123
+ "transform_quantity": null,
124
+ "type": "recurring",
125
+ "unit_amount": 1500,
126
+ "unit_amount_decimal": "1500"
127
+ },
128
+ "proration": false,
129
+ "proration_details": {
130
+ "credited_items": null
131
+ },
132
+ "quantity": 1,
133
+ "subscription": "sub_000000000000000000000000",
134
+ "subscription_item": "si_00000000000000",
135
+ "tax_amounts": [
136
+
137
+ ],
138
+ "tax_rates": [
139
+
140
+ ],
141
+ "type": "subscription"
46
142
  }
47
- ]
143
+ ],
144
+ "has_more": false,
145
+ "total_count": 1,
146
+ "url": "/v1/invoices/in_000000000000000000000000/lines"
48
147
  },
49
- "subtotal": 1000,
50
- "total": 1000,
51
- "customer": "cus_00000000000000",
52
- "object": "invoice",
53
- "attempted": false,
54
- "closed": true,
55
- "paid": true,
56
148
  "livemode": false,
57
- "attempt_count": 1,
58
- "amount_due": 1000,
59
- "currency": "usd",
149
+ "metadata": {
150
+ },
151
+ "next_payment_attempt": 1648323710,
152
+ "number": null,
153
+ "on_behalf_of": null,
154
+ "paid": false,
155
+ "paid_out_of_band": false,
156
+ "payment_intent": null,
157
+ "payment_settings": {
158
+ "payment_method_options": null,
159
+ "payment_method_types": null
160
+ },
161
+ "period_end": 1648320110,
162
+ "period_start": 1648320110,
163
+ "post_payment_credit_notes_amount": 0,
164
+ "pre_payment_credit_notes_amount": 0,
165
+ "quote": null,
166
+ "receipt_number": null,
60
167
  "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
168
+ "statement_descriptor": null,
169
+ "status": "draft",
170
+ "status_transitions": {
171
+ "finalized_at": null,
172
+ "marked_uncollectible_at": null,
173
+ "paid_at": null,
174
+ "voided_at": null
175
+ },
176
+ "subscription": "sub_000000000000000000000000",
177
+ "subtotal": 1500,
178
+ "tax": null,
179
+ "test_clock": null,
180
+ "total": 1500,
181
+ "total_discount_amounts": [
182
+
183
+ ],
184
+ "total_tax_amounts": [
185
+
186
+ ],
187
+ "transfer_data": null,
188
+ "webhooks_delivered_at": null
69
189
  }
70
- }
71
- }
190
+ },
191
+ "livemode": false,
192
+ "pending_webhooks": 2,
193
+ "request": {
194
+ "id": "req_00000000000000",
195
+ "idempotency_key": "af06a7d9-5408-4f65-8379-59a93874d04c"
196
+ },
197
+ "type": "invoice.created"
198
+ }
@@ -0,0 +1,171 @@
1
+ {
2
+ "id": "evt_000000000000000000000000",
3
+ "object": "event",
4
+ "api_version": "2020-08-27",
5
+ "created": 1648320015,
6
+ "data": {
7
+ "object": {
8
+ "id": "in_000000000000000000000000",
9
+ "object": "invoice",
10
+ "account_country": "US",
11
+ "account_name": "Example Company, Inc.",
12
+ "account_tax_ids": null,
13
+ "amount_due": 2000,
14
+ "amount_paid": 2000,
15
+ "amount_remaining": 0,
16
+ "application_fee_amount": null,
17
+ "attempt_count": 1,
18
+ "attempted": true,
19
+ "auto_advance": false,
20
+ "automatic_tax": {
21
+ "enabled": false,
22
+ "status": null
23
+ },
24
+ "billing_reason": "manual",
25
+ "charge": "ch_000000000000000000000000",
26
+ "collection_method": "charge_automatically",
27
+ "created": 1648320012,
28
+ "currency": "usd",
29
+ "custom_fields": null,
30
+ "customer": "cus_00000000000000",
31
+ "customer_address": null,
32
+ "customer_email": null,
33
+ "customer_name": null,
34
+ "customer_phone": null,
35
+ "customer_shipping": null,
36
+ "customer_tax_exempt": "none",
37
+ "customer_tax_ids": [
38
+
39
+ ],
40
+ "default_payment_method": null,
41
+ "default_source": null,
42
+ "default_tax_rates": [
43
+
44
+ ],
45
+ "description": "(created by Stripe CLI)",
46
+ "discount": null,
47
+ "discounts": [
48
+
49
+ ],
50
+ "due_date": null,
51
+ "ending_balance": 0,
52
+ "footer": null,
53
+ "hosted_invoice_url": "https://invoice.stripe.com/i/acct_0000000000000000/test_00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
54
+ "invoice_pdf": "https://pay.stripe.com/invoice/acct_0000000000000000/test_000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000/pdf?s=ap",
55
+ "last_finalization_error": null,
56
+ "lines": {
57
+ "object": "list",
58
+ "data": [
59
+ {
60
+ "id": "il_000000000000000000000000",
61
+ "object": "line_item",
62
+ "amount": 2000,
63
+ "currency": "usd",
64
+ "description": "(created by Stripe CLI)",
65
+ "discount_amounts": [
66
+
67
+ ],
68
+ "discountable": true,
69
+ "discounts": [
70
+
71
+ ],
72
+ "invoice_item": "ii_000000000000000000000000",
73
+ "livemode": false,
74
+ "metadata": {
75
+ },
76
+ "period": {
77
+ "end": 1648320011,
78
+ "start": 1648320011
79
+ },
80
+ "plan": null,
81
+ "price": {
82
+ "id": "price_000000000000000000000000",
83
+ "object": "price",
84
+ "active": false,
85
+ "billing_scheme": "per_unit",
86
+ "created": 1648320011,
87
+ "currency": "usd",
88
+ "livemode": false,
89
+ "lookup_key": null,
90
+ "metadata": {
91
+ },
92
+ "nickname": null,
93
+ "product": "prod_00000000000000",
94
+ "recurring": null,
95
+ "tax_behavior": "unspecified",
96
+ "tiers_mode": null,
97
+ "transform_quantity": null,
98
+ "type": "one_time",
99
+ "unit_amount": 2000,
100
+ "unit_amount_decimal": "2000"
101
+ },
102
+ "proration": false,
103
+ "proration_details": {
104
+ "credited_items": null
105
+ },
106
+ "quantity": 1,
107
+ "subscription": null,
108
+ "tax_amounts": [
109
+
110
+ ],
111
+ "tax_rates": [
112
+
113
+ ],
114
+ "type": "invoiceitem"
115
+ }
116
+ ],
117
+ "has_more": false,
118
+ "total_count": 1,
119
+ "url": "/v1/invoices/in_000000000000000000000000/lines"
120
+ },
121
+ "livemode": false,
122
+ "metadata": {
123
+ },
124
+ "next_payment_attempt": null,
125
+ "number": "EE1DF78D-0001",
126
+ "on_behalf_of": null,
127
+ "paid": true,
128
+ "paid_out_of_band": false,
129
+ "payment_intent": "pi_000000000000000000000000",
130
+ "payment_settings": {
131
+ "payment_method_options": null,
132
+ "payment_method_types": null
133
+ },
134
+ "period_end": 1648320012,
135
+ "period_start": 1648320012,
136
+ "post_payment_credit_notes_amount": 0,
137
+ "pre_payment_credit_notes_amount": 0,
138
+ "quote": null,
139
+ "receipt_number": null,
140
+ "starting_balance": 0,
141
+ "statement_descriptor": null,
142
+ "status": "paid",
143
+ "status_transitions": {
144
+ "finalized_at": 1648320013,
145
+ "marked_uncollectible_at": null,
146
+ "paid_at": 1648320013,
147
+ "voided_at": null
148
+ },
149
+ "subscription": null,
150
+ "subtotal": 2000,
151
+ "tax": null,
152
+ "test_clock": null,
153
+ "total": 2000,
154
+ "total_discount_amounts": [
155
+
156
+ ],
157
+ "total_tax_amounts": [
158
+
159
+ ],
160
+ "transfer_data": null,
161
+ "webhooks_delivered_at": 1648320013
162
+ }
163
+ },
164
+ "livemode": false,
165
+ "pending_webhooks": 2,
166
+ "request": {
167
+ "id": "req_00000000000000",
168
+ "idempotency_key": "e8a4b753-6e77-4c7f-ac7b-a43e50ee2605"
169
+ },
170
+ "type": "invoice.finalized"
171
+ }
@@ -0,0 +1,171 @@
1
+ {
2
+ "id": "evt_000000000000000000000000",
3
+ "object": "event",
4
+ "api_version": "2020-08-27",
5
+ "created": 1648320015,
6
+ "data": {
7
+ "object": {
8
+ "id": "in_000000000000000000000000",
9
+ "object": "invoice",
10
+ "account_country": "US",
11
+ "account_name": "Example Company, Inc.",
12
+ "account_tax_ids": null,
13
+ "amount_due": 2000,
14
+ "amount_paid": 2000,
15
+ "amount_remaining": 0,
16
+ "application_fee_amount": null,
17
+ "attempt_count": 1,
18
+ "attempted": true,
19
+ "auto_advance": false,
20
+ "automatic_tax": {
21
+ "enabled": false,
22
+ "status": null
23
+ },
24
+ "billing_reason": "manual",
25
+ "charge": "ch_000000000000000000000000",
26
+ "collection_method": "charge_automatically",
27
+ "created": 1648320012,
28
+ "currency": "usd",
29
+ "custom_fields": null,
30
+ "customer": "cus_00000000000000",
31
+ "customer_address": null,
32
+ "customer_email": null,
33
+ "customer_name": null,
34
+ "customer_phone": null,
35
+ "customer_shipping": null,
36
+ "customer_tax_exempt": "none",
37
+ "customer_tax_ids": [
38
+
39
+ ],
40
+ "default_payment_method": null,
41
+ "default_source": null,
42
+ "default_tax_rates": [
43
+
44
+ ],
45
+ "description": "(created by Stripe CLI)",
46
+ "discount": null,
47
+ "discounts": [
48
+
49
+ ],
50
+ "due_date": null,
51
+ "ending_balance": 0,
52
+ "footer": null,
53
+ "hosted_invoice_url": "https://invoice.stripe.com/i/acct_0000000000000000/test_00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
54
+ "invoice_pdf": "https://pay.stripe.com/invoice/acct_0000000000000000/test_000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000/pdf?s=ap",
55
+ "last_finalization_error": null,
56
+ "lines": {
57
+ "object": "list",
58
+ "data": [
59
+ {
60
+ "id": "il_000000000000000000000000",
61
+ "object": "line_item",
62
+ "amount": 2000,
63
+ "currency": "usd",
64
+ "description": "(created by Stripe CLI)",
65
+ "discount_amounts": [
66
+
67
+ ],
68
+ "discountable": true,
69
+ "discounts": [
70
+
71
+ ],
72
+ "invoice_item": "ii_000000000000000000000000",
73
+ "livemode": false,
74
+ "metadata": {
75
+ },
76
+ "period": {
77
+ "end": 1648320011,
78
+ "start": 1648320011
79
+ },
80
+ "plan": null,
81
+ "price": {
82
+ "id": "price_000000000000000000000000",
83
+ "object": "price",
84
+ "active": false,
85
+ "billing_scheme": "per_unit",
86
+ "created": 1648320011,
87
+ "currency": "usd",
88
+ "livemode": false,
89
+ "lookup_key": null,
90
+ "metadata": {
91
+ },
92
+ "nickname": null,
93
+ "product": "prod_00000000000000",
94
+ "recurring": null,
95
+ "tax_behavior": "unspecified",
96
+ "tiers_mode": null,
97
+ "transform_quantity": null,
98
+ "type": "one_time",
99
+ "unit_amount": 2000,
100
+ "unit_amount_decimal": "2000"
101
+ },
102
+ "proration": false,
103
+ "proration_details": {
104
+ "credited_items": null
105
+ },
106
+ "quantity": 1,
107
+ "subscription": null,
108
+ "tax_amounts": [
109
+
110
+ ],
111
+ "tax_rates": [
112
+
113
+ ],
114
+ "type": "invoiceitem"
115
+ }
116
+ ],
117
+ "has_more": false,
118
+ "total_count": 1,
119
+ "url": "/v1/invoices/in_000000000000000000000000/lines"
120
+ },
121
+ "livemode": false,
122
+ "metadata": {
123
+ },
124
+ "next_payment_attempt": null,
125
+ "number": "EE1DF78D-0001",
126
+ "on_behalf_of": null,
127
+ "paid": true,
128
+ "paid_out_of_band": false,
129
+ "payment_intent": "pi_000000000000000000000000",
130
+ "payment_settings": {
131
+ "payment_method_options": null,
132
+ "payment_method_types": null
133
+ },
134
+ "period_end": 1648320012,
135
+ "period_start": 1648320012,
136
+ "post_payment_credit_notes_amount": 0,
137
+ "pre_payment_credit_notes_amount": 0,
138
+ "quote": null,
139
+ "receipt_number": null,
140
+ "starting_balance": 0,
141
+ "statement_descriptor": null,
142
+ "status": "paid",
143
+ "status_transitions": {
144
+ "finalized_at": 1648320013,
145
+ "marked_uncollectible_at": null,
146
+ "paid_at": 1648320013,
147
+ "voided_at": null
148
+ },
149
+ "subscription": null,
150
+ "subtotal": 2000,
151
+ "tax": null,
152
+ "test_clock": null,
153
+ "total": 2000,
154
+ "total_discount_amounts": [
155
+
156
+ ],
157
+ "total_tax_amounts": [
158
+
159
+ ],
160
+ "transfer_data": null,
161
+ "webhooks_delivered_at": 1648320013
162
+ }
163
+ },
164
+ "livemode": false,
165
+ "pending_webhooks": 3,
166
+ "request": {
167
+ "id": "req_00000000000000",
168
+ "idempotency_key": "e8a4b753-6e77-4c7f-ac7b-a43e50ee2605"
169
+ },
170
+ "type": "invoice.paid"
171
+ }