stripe-ruby-mock 3.0.1 → 3.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.github/workflows/rspec_tests.yml +38 -0
- data/.rspec +2 -1
- data/CHANGELOG.md +62 -15
- data/Gemfile +1 -0
- data/README.md +5 -3
- data/lib/stripe_mock/api/client.rb +1 -1
- data/lib/stripe_mock/api/instance.rb +1 -1
- data/lib/stripe_mock/api/webhooks.rb +66 -25
- data/lib/stripe_mock/client.rb +2 -1
- data/lib/stripe_mock/data/list.rb +31 -6
- data/lib/stripe_mock/data.rb +201 -30
- data/lib/stripe_mock/instance.rb +12 -3
- data/lib/stripe_mock/request_handlers/account_links.rb +15 -0
- data/lib/stripe_mock/request_handlers/accounts.rb +17 -6
- data/lib/stripe_mock/request_handlers/charges.rb +11 -4
- data/lib/stripe_mock/request_handlers/checkout_session.rb +179 -0
- data/lib/stripe_mock/request_handlers/customers.rb +22 -13
- data/lib/stripe_mock/request_handlers/ephemeral_key.rb +1 -1
- data/lib/stripe_mock/request_handlers/events.rb +30 -3
- data/lib/stripe_mock/request_handlers/express_login_links.rb +15 -0
- data/lib/stripe_mock/request_handlers/helpers/coupon_helpers.rb +1 -0
- data/lib/stripe_mock/request_handlers/helpers/subscription_helpers.rb +36 -12
- data/lib/stripe_mock/request_handlers/invoices.rb +10 -4
- data/lib/stripe_mock/request_handlers/payment_intents.rb +13 -2
- data/lib/stripe_mock/request_handlers/payment_methods.rb +11 -4
- data/lib/stripe_mock/request_handlers/prices.rb +62 -0
- data/lib/stripe_mock/request_handlers/promotion_codes.rb +43 -0
- data/lib/stripe_mock/request_handlers/refunds.rb +13 -2
- data/lib/stripe_mock/request_handlers/setup_intents.rb +16 -9
- data/lib/stripe_mock/request_handlers/sources.rb +12 -6
- data/lib/stripe_mock/request_handlers/subscriptions.rb +120 -21
- data/lib/stripe_mock/request_handlers/tokens.rb +6 -4
- data/lib/stripe_mock/request_handlers/transfers.rb +12 -1
- data/lib/stripe_mock/request_handlers/validators/param_validators.rb +33 -4
- data/lib/stripe_mock/server.rb +2 -2
- data/lib/stripe_mock/test_strategies/base.rb +62 -10
- data/lib/stripe_mock/version.rb +1 -1
- data/lib/stripe_mock/webhook_fixtures/account.updated.json +1 -1
- data/lib/stripe_mock/webhook_fixtures/balance.available.json +27 -15
- data/lib/stripe_mock/webhook_fixtures/charge.captured.json +143 -0
- data/lib/stripe_mock/webhook_fixtures/charge.dispute.created.json +63 -16
- data/lib/stripe_mock/webhook_fixtures/charge.failed.json +49 -120
- data/lib/stripe_mock/webhook_fixtures/charge.refund.updated.json +35 -0
- data/lib/stripe_mock/webhook_fixtures/charge.refunded.json +145 -50
- data/lib/stripe_mock/webhook_fixtures/charge.succeeded.json +114 -43
- data/lib/stripe_mock/webhook_fixtures/checkout.session.completed.json +79 -0
- data/lib/stripe_mock/webhook_fixtures/checkout.session.completed.payment_mode.json +53 -0
- data/lib/stripe_mock/webhook_fixtures/checkout.session.completed.setup_mode.json +45 -0
- data/lib/stripe_mock/webhook_fixtures/customer.created.json +37 -46
- data/lib/stripe_mock/webhook_fixtures/customer.deleted.json +36 -32
- data/lib/stripe_mock/webhook_fixtures/customer.source.created.json +31 -22
- data/lib/stripe_mock/webhook_fixtures/customer.source.updated.json +36 -25
- data/lib/stripe_mock/webhook_fixtures/customer.subscription.created.json +135 -47
- data/lib/stripe_mock/webhook_fixtures/customer.subscription.deleted.json +134 -45
- data/lib/stripe_mock/webhook_fixtures/customer.subscription.updated.json +135 -56
- data/lib/stripe_mock/webhook_fixtures/customer.updated.json +38 -47
- data/lib/stripe_mock/webhook_fixtures/invoice.created.json +176 -49
- data/lib/stripe_mock/webhook_fixtures/invoice.finalized.json +171 -0
- data/lib/stripe_mock/webhook_fixtures/invoice.paid.json +171 -0
- data/lib/stripe_mock/webhook_fixtures/invoice.payment_action_required.json +171 -0
- data/lib/stripe_mock/webhook_fixtures/invoice.payment_failed.json +149 -83
- data/lib/stripe_mock/webhook_fixtures/invoice.payment_succeeded.json +149 -90
- data/lib/stripe_mock/webhook_fixtures/invoice.upcoming.json +70 -0
- data/lib/stripe_mock/webhook_fixtures/invoice.updated.json +178 -50
- data/lib/stripe_mock/webhook_fixtures/invoiceitem.created.json +87 -13
- data/lib/stripe_mock/webhook_fixtures/invoiceitem.updated.json +88 -14
- data/lib/stripe_mock/webhook_fixtures/mandate.updated.json +34 -0
- data/lib/stripe_mock/webhook_fixtures/payment_intent.amount_capturable_updated.json +170 -0
- data/lib/stripe_mock/webhook_fixtures/payment_intent.canceled.json +73 -0
- data/lib/stripe_mock/webhook_fixtures/payment_intent.created.json +86 -0
- data/lib/stripe_mock/webhook_fixtures/payment_intent.payment_failed.json +225 -0
- data/lib/stripe_mock/webhook_fixtures/payment_intent.processing.json +162 -0
- data/lib/stripe_mock/webhook_fixtures/payment_intent.requires_action.json +191 -0
- data/lib/stripe_mock/webhook_fixtures/payment_intent.succeeded.json +196 -0
- data/lib/stripe_mock/webhook_fixtures/payment_link.created.json +47 -0
- data/lib/stripe_mock/webhook_fixtures/payment_link.updated.json +50 -0
- data/lib/stripe_mock/webhook_fixtures/payment_method.attached.json +63 -0
- data/lib/stripe_mock/webhook_fixtures/payment_method.detached.json +62 -0
- data/lib/stripe_mock/webhook_fixtures/payout.created.json +40 -0
- data/lib/stripe_mock/webhook_fixtures/payout.paid.json +40 -0
- data/lib/stripe_mock/webhook_fixtures/payout.updated.json +46 -0
- data/lib/stripe_mock/webhook_fixtures/plan.created.json +30 -13
- data/lib/stripe_mock/webhook_fixtures/plan.deleted.json +30 -13
- data/lib/stripe_mock/webhook_fixtures/plan.updated.json +34 -14
- data/lib/stripe_mock/webhook_fixtures/price.created.json +42 -0
- data/lib/stripe_mock/webhook_fixtures/price.deleted.json +42 -0
- data/lib/stripe_mock/webhook_fixtures/price.updated.json +48 -0
- data/lib/stripe_mock/webhook_fixtures/product.created.json +19 -13
- data/lib/stripe_mock/webhook_fixtures/product.deleted.json +20 -14
- data/lib/stripe_mock/webhook_fixtures/product.updated.json +24 -15
- data/lib/stripe_mock/webhook_fixtures/quote.accepted.json +92 -0
- data/lib/stripe_mock/webhook_fixtures/quote.canceled.json +92 -0
- data/lib/stripe_mock/webhook_fixtures/quote.created.json +92 -0
- data/lib/stripe_mock/webhook_fixtures/quote.finalized.json +92 -0
- data/lib/stripe_mock/webhook_fixtures/setup_intent.canceled.json +46 -0
- data/lib/stripe_mock/webhook_fixtures/setup_intent.created.json +51 -0
- data/lib/stripe_mock/webhook_fixtures/setup_intent.setup_failed.json +100 -0
- data/lib/stripe_mock/webhook_fixtures/setup_intent.succeeded.json +46 -0
- data/lib/stripe_mock/webhook_fixtures/subscription_schedule.canceled.json +119 -0
- data/lib/stripe_mock/webhook_fixtures/subscription_schedule.created.json +114 -0
- data/lib/stripe_mock/webhook_fixtures/subscription_schedule.released.json +111 -0
- data/lib/stripe_mock/webhook_fixtures/subscription_schedule.updated.json +125 -0
- data/lib/stripe_mock/webhook_fixtures/tax_rate.created.json +32 -0
- data/lib/stripe_mock/webhook_fixtures/tax_rate.updated.json +37 -0
- data/lib/stripe_mock.rb +7 -1
- data/spec/instance_spec.rb +7 -7
- data/spec/integration_examples/completing_checkout_sessions_example.rb +37 -0
- data/spec/list_spec.rb +23 -0
- data/spec/readme_spec.rb +1 -1
- data/spec/server_spec.rb +4 -2
- data/spec/shared_stripe_examples/account_examples.rb +9 -1
- data/spec/shared_stripe_examples/account_link_examples.rb +16 -0
- data/spec/shared_stripe_examples/balance_examples.rb +6 -0
- data/spec/shared_stripe_examples/card_token_examples.rb +17 -21
- data/spec/shared_stripe_examples/checkout_session_examples.rb +99 -0
- data/spec/shared_stripe_examples/customer_examples.rb +11 -13
- data/spec/shared_stripe_examples/express_login_link_examples.rb +12 -0
- data/spec/shared_stripe_examples/invoice_examples.rb +29 -8
- data/spec/shared_stripe_examples/payment_intent_examples.rb +74 -0
- data/spec/shared_stripe_examples/payment_method_examples.rb +336 -67
- data/spec/shared_stripe_examples/price_examples.rb +223 -0
- data/spec/shared_stripe_examples/product_examples.rb +1 -9
- data/spec/shared_stripe_examples/promotion_code_examples.rb +68 -0
- data/spec/shared_stripe_examples/refund_examples.rb +13 -0
- data/spec/shared_stripe_examples/setup_intent_examples.rb +17 -0
- data/spec/shared_stripe_examples/subscription_examples.rb +327 -9
- data/spec/shared_stripe_examples/transfer_examples.rb +10 -1
- data/spec/shared_stripe_examples/webhook_event_examples.rb +51 -5
- data/spec/spec_helper.rb +4 -0
- data/spec/stripe_mock_spec.rb +2 -2
- data/spec/support/stripe_examples.rb +8 -2
- data/stripe-ruby-mock.gemspec +7 -2
- metadata +72 -15
- data/.travis.yml +0 -28
- data/lib/stripe_mock/request_handlers/checkout.rb +0 -15
- data/spec/shared_stripe_examples/checkout_examples.rb +0 -19
@@ -1,105 +1,171 @@
|
|
1
1
|
{
|
2
|
-
"
|
3
|
-
"livemode": false,
|
4
|
-
"id": "evt_00000000000000",
|
5
|
-
"type": "invoice.payment_failed",
|
2
|
+
"id": "evt_000000000000000000000000",
|
6
3
|
"object": "event",
|
4
|
+
"api_version": "2020-08-27",
|
5
|
+
"created": 1648320009,
|
7
6
|
"data": {
|
8
7
|
"object": {
|
9
|
-
"
|
10
|
-
"
|
11
|
-
"
|
12
|
-
"
|
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": 0,
|
15
|
+
"amount_remaining": 2000,
|
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": 1648320007,
|
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,
|
13
56
|
"lines": {
|
14
57
|
"object": "list",
|
15
|
-
"count": 3,
|
16
|
-
"url": "/v1/invoices/in_00000000000000/lines",
|
17
58
|
"data": [
|
18
59
|
{
|
19
|
-
"id": "
|
60
|
+
"id": "il_000000000000000000000000",
|
20
61
|
"object": "line_item",
|
21
|
-
"
|
22
|
-
"livemode": false,
|
23
|
-
"amount": 19000,
|
62
|
+
"amount": 2000,
|
24
63
|
"currency": "usd",
|
25
|
-
"
|
26
|
-
"
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
"
|
31
|
-
|
32
|
-
|
33
|
-
"
|
34
|
-
},
|
35
|
-
{
|
36
|
-
"id": "ii_00000000000001",
|
37
|
-
"object": "line_item",
|
38
|
-
"type": "invoiceitem",
|
64
|
+
"description": "(created by Stripe CLI)",
|
65
|
+
"discount_amounts": [
|
66
|
+
|
67
|
+
],
|
68
|
+
"discountable": true,
|
69
|
+
"discounts": [
|
70
|
+
|
71
|
+
],
|
72
|
+
"invoice_item": "ii_000000000000000000000000",
|
39
73
|
"livemode": false,
|
40
|
-
"
|
41
|
-
"currency": "usd",
|
42
|
-
"proration": true,
|
43
|
-
"period": {
|
44
|
-
"start": 1393765661,
|
45
|
-
"end": 1393765661
|
74
|
+
"metadata": {
|
46
75
|
},
|
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
76
|
"period": {
|
61
|
-
"
|
62
|
-
"
|
77
|
+
"end": 1648320006,
|
78
|
+
"start": 1648320006
|
63
79
|
},
|
64
|
-
"
|
65
|
-
"
|
66
|
-
"
|
67
|
-
"
|
68
|
-
"
|
69
|
-
"
|
80
|
+
"plan": null,
|
81
|
+
"price": {
|
82
|
+
"id": "price_000000000000000000000000",
|
83
|
+
"object": "price",
|
84
|
+
"active": false,
|
85
|
+
"billing_scheme": "per_unit",
|
86
|
+
"created": 1648320006,
|
70
87
|
"currency": "usd",
|
71
|
-
"id": "platinum",
|
72
|
-
"object": "plan",
|
73
88
|
"livemode": false,
|
74
|
-
"
|
75
|
-
"
|
76
|
-
|
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
|
77
105
|
},
|
78
|
-
"
|
79
|
-
"
|
106
|
+
"quantity": 1,
|
107
|
+
"subscription": null,
|
108
|
+
"tax_amounts": [
|
109
|
+
|
110
|
+
],
|
111
|
+
"tax_rates": [
|
112
|
+
|
113
|
+
],
|
114
|
+
"type": "invoiceitem"
|
80
115
|
}
|
81
|
-
]
|
116
|
+
],
|
117
|
+
"has_more": false,
|
118
|
+
"total_count": 1,
|
119
|
+
"url": "/v1/invoices/in_000000000000000000000000/lines"
|
82
120
|
},
|
83
|
-
"subtotal": 30000,
|
84
|
-
"total": 30000,
|
85
|
-
"customer": "cus_00000000000000",
|
86
|
-
"object": "invoice",
|
87
|
-
"attempted": true,
|
88
|
-
"closed": false,
|
89
|
-
"paid": false,
|
90
121
|
"livemode": false,
|
91
|
-
"
|
92
|
-
|
93
|
-
"
|
122
|
+
"metadata": {
|
123
|
+
},
|
124
|
+
"next_payment_attempt": null,
|
125
|
+
"number": "C93E45D7-0001",
|
126
|
+
"on_behalf_of": null,
|
127
|
+
"paid": false,
|
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": 1648320007,
|
135
|
+
"period_start": 1648320007,
|
136
|
+
"post_payment_credit_notes_amount": 0,
|
137
|
+
"pre_payment_credit_notes_amount": 0,
|
138
|
+
"quote": null,
|
139
|
+
"receipt_number": null,
|
94
140
|
"starting_balance": 0,
|
95
|
-
"
|
96
|
-
"
|
97
|
-
"
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
141
|
+
"statement_descriptor": null,
|
142
|
+
"status": "open",
|
143
|
+
"status_transitions": {
|
144
|
+
"finalized_at": 1648320008,
|
145
|
+
"marked_uncollectible_at": null,
|
146
|
+
"paid_at": null,
|
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": null
|
103
162
|
}
|
104
|
-
}
|
105
|
-
|
163
|
+
},
|
164
|
+
"livemode": false,
|
165
|
+
"pending_webhooks": 3,
|
166
|
+
"request": {
|
167
|
+
"id": "req_00000000000000",
|
168
|
+
"idempotency_key": "01a6e155-8da6-4fce-981d-0957a39bb139"
|
169
|
+
},
|
170
|
+
"type": "invoice.payment_failed"
|
171
|
+
}
|
@@ -1,112 +1,171 @@
|
|
1
1
|
{
|
2
|
-
"
|
3
|
-
"livemode": false,
|
4
|
-
"id": "evt_00000000000000",
|
5
|
-
"type": "invoice.payment_succeeded",
|
2
|
+
"id": "evt_000000000000000000000000",
|
6
3
|
"object": "event",
|
4
|
+
"api_version": "2020-08-27",
|
5
|
+
"created": 1648320015,
|
7
6
|
"data": {
|
8
7
|
"object": {
|
9
|
-
"id": "
|
8
|
+
"id": "in_000000000000000000000000",
|
10
9
|
"object": "invoice",
|
11
|
-
"
|
12
|
-
"
|
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,
|
13
17
|
"attempt_count": 1,
|
14
18
|
"attempted": true,
|
15
|
-
"
|
16
|
-
"
|
17
|
-
|
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,
|
18
30
|
"customer": "cus_00000000000000",
|
19
|
-
"
|
20
|
-
"
|
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)",
|
21
46
|
"discount": null,
|
47
|
+
"discounts": [
|
48
|
+
|
49
|
+
],
|
50
|
+
"due_date": null,
|
22
51
|
"ending_balance": 0,
|
23
|
-
"
|
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,
|
24
56
|
"lines": {
|
25
|
-
"
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
"
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
"
|
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,
|
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",
|
79
73
|
"livemode": false,
|
80
|
-
"metadata": {
|
81
|
-
|
82
|
-
"
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
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,
|
91
118
|
"total_count": 1,
|
92
|
-
"
|
93
|
-
"url": "/v1/invoices/in_18EcOcLrgDIZ7iq8zsDkunZ0/lines"
|
119
|
+
"url": "/v1/invoices/in_000000000000000000000000/lines"
|
94
120
|
},
|
95
121
|
"livemode": false,
|
96
|
-
"metadata": {
|
122
|
+
"metadata": {
|
123
|
+
},
|
97
124
|
"next_payment_attempt": null,
|
125
|
+
"number": "EE1DF78D-0001",
|
126
|
+
"on_behalf_of": null,
|
98
127
|
"paid": true,
|
99
|
-
"
|
100
|
-
"
|
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,
|
101
139
|
"receipt_number": null,
|
102
140
|
"starting_balance": 0,
|
103
141
|
"statement_descriptor": null,
|
104
|
-
"
|
105
|
-
"
|
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,
|
106
151
|
"tax": null,
|
107
|
-
"
|
108
|
-
"total":
|
109
|
-
"
|
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
|
110
162
|
}
|
111
|
-
}
|
112
|
-
|
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.payment_succeeded"
|
171
|
+
}
|
@@ -0,0 +1,70 @@
|
|
1
|
+
{
|
2
|
+
"created": 1326853478,
|
3
|
+
"livemode": false,
|
4
|
+
"id": "evt_00000000000000",
|
5
|
+
"type": "invoice.upcoming",
|
6
|
+
"status": "draft",
|
7
|
+
"object": "event",
|
8
|
+
"data": {
|
9
|
+
"object": {
|
10
|
+
"created": 1380674206,
|
11
|
+
"period_start": 1378082075,
|
12
|
+
"period_end": 1380674075,
|
13
|
+
"lines": {
|
14
|
+
"count": 1,
|
15
|
+
"object": "list",
|
16
|
+
"url": "/v1/invoices/upcoming/lines?customer=cus_00000000000000",
|
17
|
+
"data": [
|
18
|
+
{
|
19
|
+
"id": "su_2hksGtIPylSBg2",
|
20
|
+
"object": "line_item",
|
21
|
+
"type": "subscription",
|
22
|
+
"livemode": true,
|
23
|
+
"amount": 100,
|
24
|
+
"currency": "usd",
|
25
|
+
"proration": false,
|
26
|
+
"period": {
|
27
|
+
"start": 1383759042,
|
28
|
+
"end": 1386351042
|
29
|
+
},
|
30
|
+
"quantity": 1,
|
31
|
+
"plan": {
|
32
|
+
"interval": "month",
|
33
|
+
"amount": 100,
|
34
|
+
"currency": "usd",
|
35
|
+
"id": "fkx0AFo",
|
36
|
+
"object": "plan",
|
37
|
+
"livemode": false,
|
38
|
+
"interval_count": 1,
|
39
|
+
"trial_period_days": null,
|
40
|
+
"product": "pr_00000000000000",
|
41
|
+
"metadata": {}
|
42
|
+
},
|
43
|
+
"description": null,
|
44
|
+
"metadata": null
|
45
|
+
}
|
46
|
+
]
|
47
|
+
},
|
48
|
+
"subtotal": 1000,
|
49
|
+
"total": 1000,
|
50
|
+
"customer": "cus_00000000000000",
|
51
|
+
"object": "invoice",
|
52
|
+
"attempted": false,
|
53
|
+
"closed": false,
|
54
|
+
"paid": false,
|
55
|
+
"livemode": false,
|
56
|
+
"attempt_count": 0,
|
57
|
+
"amount_due": 1000,
|
58
|
+
"currency": "usd",
|
59
|
+
"starting_balance": 0,
|
60
|
+
"ending_balance": 0,
|
61
|
+
"next_payment_attempt": null,
|
62
|
+
"charge": null,
|
63
|
+
"discount": null,
|
64
|
+
"application_fee": null,
|
65
|
+
"subscription": "sub_00000000000000",
|
66
|
+
"metadata": {},
|
67
|
+
"description": null
|
68
|
+
}
|
69
|
+
}
|
70
|
+
}
|