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,42 +1,46 @@
|
|
1
1
|
{
|
2
|
-
"
|
2
|
+
"id": "evt_000000000000000000000000",
|
3
|
+
"object": "event",
|
4
|
+
"api_version": "2020-08-27",
|
5
|
+
"created": 1648319961,
|
3
6
|
"data": {
|
4
7
|
"object": {
|
5
|
-
"
|
6
|
-
"
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
"address_state": null,
|
13
|
-
"address_zip": null,
|
14
|
-
"address_zip_check": null,
|
15
|
-
"country": "US",
|
16
|
-
"cvc_check": "pass",
|
17
|
-
"exp_month": 12,
|
18
|
-
"exp_year": 2013,
|
19
|
-
"fingerprint": "wXWJT135mEK107G8",
|
20
|
-
"last4": "4242",
|
21
|
-
"name": "1231",
|
22
|
-
"object": "card",
|
23
|
-
"type": "Visa",
|
24
|
-
"brand": "Visa",
|
25
|
-
"funding": "credit"
|
26
|
-
},
|
27
|
-
"created": 1359947599,
|
8
|
+
"id": "cus_00000000000000",
|
9
|
+
"object": "customer",
|
10
|
+
"address": null,
|
11
|
+
"balance": 0,
|
12
|
+
"created": 1648319961,
|
13
|
+
"currency": null,
|
14
|
+
"default_source": null,
|
28
15
|
"delinquent": false,
|
29
|
-
"description":
|
16
|
+
"description": "(created by Stripe CLI)",
|
30
17
|
"discount": null,
|
31
|
-
"email":
|
32
|
-
"
|
18
|
+
"email": null,
|
19
|
+
"invoice_prefix": "D343B0B7",
|
20
|
+
"invoice_settings": {
|
21
|
+
"custom_fields": null,
|
22
|
+
"default_payment_method": null,
|
23
|
+
"footer": null
|
24
|
+
},
|
33
25
|
"livemode": false,
|
34
|
-
"
|
35
|
-
|
26
|
+
"metadata": {
|
27
|
+
},
|
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
|
36
37
|
}
|
37
38
|
},
|
38
|
-
"id": "evt_00000000000000",
|
39
39
|
"livemode": false,
|
40
|
-
"
|
40
|
+
"pending_webhooks": 2,
|
41
|
+
"request": {
|
42
|
+
"id": "req_00000000000000",
|
43
|
+
"idempotency_key": null
|
44
|
+
},
|
41
45
|
"type": "customer.deleted"
|
42
|
-
}
|
46
|
+
}
|
@@ -1,32 +1,41 @@
|
|
1
1
|
{
|
2
|
-
"
|
3
|
-
"livemode": false,
|
4
|
-
"id": "evt_00000000000000",
|
5
|
-
"type": "customer.source.created",
|
2
|
+
"id": "evt_000000000000000000000000",
|
6
3
|
"object": "event",
|
4
|
+
"api_version": "2020-08-27",
|
5
|
+
"created": 1648320107,
|
7
6
|
"data": {
|
8
7
|
"object": {
|
9
|
-
"id": "
|
8
|
+
"id": "card_000000000000000000000000",
|
10
9
|
"object": "card",
|
11
|
-
"
|
12
|
-
"
|
13
|
-
"brand": "Visa",
|
14
|
-
"funding": "credit",
|
15
|
-
"exp_month": 3,
|
16
|
-
"exp_year": 2020,
|
17
|
-
"fingerprint": "wXWJT135mEK107G8",
|
18
|
-
"customer": "cus_VALID",
|
19
|
-
"country": "US",
|
20
|
-
"name": "Testy Tester",
|
10
|
+
"address_city": null,
|
11
|
+
"address_country": null,
|
21
12
|
"address_line1": null,
|
13
|
+
"address_line1_check": null,
|
22
14
|
"address_line2": null,
|
23
|
-
"address_city": null,
|
24
15
|
"address_state": null,
|
25
16
|
"address_zip": null,
|
26
|
-
"
|
27
|
-
"
|
28
|
-
"
|
29
|
-
"
|
17
|
+
"address_zip_check": null,
|
18
|
+
"brand": "Visa",
|
19
|
+
"country": "US",
|
20
|
+
"customer": "cus_00000000000000",
|
21
|
+
"cvc_check": null,
|
22
|
+
"dynamic_last4": null,
|
23
|
+
"exp_month": 3,
|
24
|
+
"exp_year": 2023,
|
25
|
+
"fingerprint": "ZoVSX2dK5igWt2SB",
|
26
|
+
"funding": "credit",
|
27
|
+
"last4": "4242",
|
28
|
+
"metadata": {
|
29
|
+
},
|
30
|
+
"name": null,
|
31
|
+
"tokenization_method": null
|
30
32
|
}
|
31
|
-
}
|
32
|
-
|
33
|
+
},
|
34
|
+
"livemode": false,
|
35
|
+
"pending_webhooks": 2,
|
36
|
+
"request": {
|
37
|
+
"id": "req_00000000000000",
|
38
|
+
"idempotency_key": "381c7773-97ac-4c18-8fbe-e8bff5e6bbad"
|
39
|
+
},
|
40
|
+
"type": "customer.source.created"
|
41
|
+
}
|
@@ -1,36 +1,47 @@
|
|
1
1
|
{
|
2
|
-
"
|
3
|
-
"livemode": false,
|
4
|
-
"id": "evt_00000000000000",
|
5
|
-
"type": "customer.source.updated",
|
2
|
+
"id": "evt_000000000000000000000000",
|
6
3
|
"object": "event",
|
4
|
+
"api_version": "2020-08-27",
|
5
|
+
"created": 1648319966,
|
7
6
|
"data": {
|
8
7
|
"object": {
|
9
|
-
"id": "
|
8
|
+
"id": "card_000000000000000000000000",
|
10
9
|
"object": "card",
|
11
|
-
"
|
12
|
-
"
|
13
|
-
"brand": "Visa",
|
14
|
-
"funding": "credit",
|
15
|
-
"exp_month": 3,
|
16
|
-
"exp_year": 2020,
|
17
|
-
"fingerprint": "wXWJT135mEK107G8",
|
18
|
-
"customer": "cus_VALID",
|
19
|
-
"country": "US",
|
20
|
-
"name": "Testy Tester",
|
10
|
+
"address_city": null,
|
11
|
+
"address_country": null,
|
21
12
|
"address_line1": null,
|
13
|
+
"address_line1_check": null,
|
22
14
|
"address_line2": null,
|
23
|
-
"address_city": null,
|
24
15
|
"address_state": null,
|
25
16
|
"address_zip": null,
|
26
|
-
"
|
27
|
-
"
|
28
|
-
"
|
29
|
-
"
|
17
|
+
"address_zip_check": null,
|
18
|
+
"brand": "Visa",
|
19
|
+
"country": "US",
|
20
|
+
"customer": "cus_00000000000000",
|
21
|
+
"cvc_check": null,
|
22
|
+
"dynamic_last4": null,
|
23
|
+
"exp_month": 3,
|
24
|
+
"exp_year": 2023,
|
25
|
+
"fingerprint": "ZoVSX2dK5igWt2SB",
|
26
|
+
"funding": "credit",
|
27
|
+
"last4": "4242",
|
28
|
+
"metadata": {
|
29
|
+
"foo": "bar"
|
30
|
+
},
|
31
|
+
"name": null,
|
32
|
+
"tokenization_method": null
|
30
33
|
},
|
31
|
-
"previous_attributes":
|
32
|
-
|
33
|
-
|
34
|
+
"previous_attributes": {
|
35
|
+
"metadata": {
|
36
|
+
"foo": null
|
37
|
+
}
|
34
38
|
}
|
35
|
-
}
|
36
|
-
|
39
|
+
},
|
40
|
+
"livemode": false,
|
41
|
+
"pending_webhooks": 2,
|
42
|
+
"request": {
|
43
|
+
"id": "req_00000000000000",
|
44
|
+
"idempotency_key": "0b5b3636-5097-40ba-8839-7013d6090ab7"
|
45
|
+
},
|
46
|
+
"type": "customer.source.updated"
|
47
|
+
}
|
@@ -1,66 +1,154 @@
|
|
1
1
|
{
|
2
|
-
"
|
3
|
-
"livemode": false,
|
4
|
-
"id": "evt_00000000000000",
|
5
|
-
"type": "customer.subscription.created",
|
2
|
+
"id": "evt_000000000000000000000000",
|
6
3
|
"object": "event",
|
4
|
+
"api_version": "2020-08-27",
|
5
|
+
"created": 1648320110,
|
7
6
|
"data": {
|
8
7
|
"object": {
|
9
|
-
"id": "
|
10
|
-
|
11
|
-
|
12
|
-
|
8
|
+
"id": "sub_000000000000000000000000",
|
9
|
+
"object": "subscription",
|
10
|
+
"application_fee_percent": null,
|
11
|
+
"automatic_tax": {
|
12
|
+
"enabled": false
|
13
|
+
},
|
14
|
+
"billing_cycle_anchor": 1648320110,
|
15
|
+
"billing_thresholds": null,
|
16
|
+
"cancel_at": null,
|
17
|
+
"cancel_at_period_end": false,
|
18
|
+
"canceled_at": null,
|
19
|
+
"collection_method": "charge_automatically",
|
20
|
+
"created": 1648320110,
|
21
|
+
"current_period_end": 1650998510,
|
22
|
+
"current_period_start": 1648320110,
|
23
|
+
"customer": "cus_00000000000000",
|
24
|
+
"days_until_due": null,
|
25
|
+
"default_payment_method": null,
|
26
|
+
"default_source": null,
|
27
|
+
"default_tax_rates": [
|
28
|
+
|
29
|
+
],
|
30
|
+
"discount": null,
|
31
|
+
"ended_at": null,
|
32
|
+
"items": {
|
33
|
+
"object": "list",
|
34
|
+
"data": [
|
13
35
|
{
|
14
36
|
"id": "si_00000000000000",
|
15
37
|
"object": "subscription_item",
|
16
|
-
"
|
38
|
+
"billing_thresholds": null,
|
39
|
+
"created": 1648320111,
|
40
|
+
"metadata": {
|
41
|
+
},
|
17
42
|
"plan": {
|
18
|
-
"
|
19
|
-
"product": "pr_00000000000000",
|
20
|
-
"amount": 100,
|
21
|
-
"currency": "usd",
|
22
|
-
"id": "fkx0AFo_00000000000000",
|
43
|
+
"id": "price_000000000000000000000000",
|
23
44
|
"object": "plan",
|
24
|
-
"
|
45
|
+
"active": true,
|
46
|
+
"aggregate_usage": null,
|
47
|
+
"amount": 1500,
|
48
|
+
"amount_decimal": "1500",
|
49
|
+
"billing_scheme": "per_unit",
|
50
|
+
"created": 1648320109,
|
51
|
+
"currency": "usd",
|
52
|
+
"interval": "month",
|
25
53
|
"interval_count": 1,
|
54
|
+
"livemode": false,
|
55
|
+
"metadata": {
|
56
|
+
},
|
57
|
+
"nickname": null,
|
58
|
+
"product": "prod_00000000000000",
|
59
|
+
"tiers_mode": null,
|
60
|
+
"transform_usage": null,
|
26
61
|
"trial_period_days": null,
|
27
|
-
"
|
62
|
+
"usage_type": "licensed"
|
28
63
|
},
|
29
|
-
"
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
"interval": "month",
|
37
|
-
"product": "pr_00000000000001",
|
38
|
-
"amount": 200,
|
39
|
-
"currency": "eur",
|
40
|
-
"id": "fkx0AFo_00000000000001",
|
41
|
-
"object": "plan",
|
64
|
+
"price": {
|
65
|
+
"id": "price_000000000000000000000000",
|
66
|
+
"object": "price",
|
67
|
+
"active": true,
|
68
|
+
"billing_scheme": "per_unit",
|
69
|
+
"created": 1648320109,
|
70
|
+
"currency": "usd",
|
42
71
|
"livemode": false,
|
43
|
-
"
|
44
|
-
"
|
45
|
-
|
72
|
+
"lookup_key": null,
|
73
|
+
"metadata": {
|
74
|
+
},
|
75
|
+
"nickname": null,
|
76
|
+
"product": "prod_00000000000000",
|
77
|
+
"recurring": {
|
78
|
+
"aggregate_usage": null,
|
79
|
+
"interval": "month",
|
80
|
+
"interval_count": 1,
|
81
|
+
"trial_period_days": null,
|
82
|
+
"usage_type": "licensed"
|
83
|
+
},
|
84
|
+
"tax_behavior": "unspecified",
|
85
|
+
"tiers_mode": null,
|
86
|
+
"transform_quantity": null,
|
87
|
+
"type": "recurring",
|
88
|
+
"unit_amount": 1500,
|
89
|
+
"unit_amount_decimal": "1500"
|
46
90
|
},
|
47
|
-
"quantity":
|
91
|
+
"quantity": 1,
|
92
|
+
"subscription": "sub_000000000000000000000000",
|
93
|
+
"tax_rates": [
|
94
|
+
|
95
|
+
]
|
48
96
|
}
|
49
|
-
]
|
97
|
+
],
|
98
|
+
"has_more": false,
|
99
|
+
"total_count": 1,
|
100
|
+
"url": "/v1/subscription_items?subscription=sub_000000000000000000000000"
|
50
101
|
},
|
51
|
-
"
|
52
|
-
"
|
102
|
+
"latest_invoice": "in_000000000000000000000000",
|
103
|
+
"livemode": false,
|
104
|
+
"metadata": {
|
105
|
+
},
|
106
|
+
"next_pending_invoice_item_invoice": null,
|
107
|
+
"pause_collection": null,
|
108
|
+
"payment_settings": {
|
109
|
+
"payment_method_options": null,
|
110
|
+
"payment_method_types": null
|
111
|
+
},
|
112
|
+
"pending_invoice_item_interval": null,
|
113
|
+
"pending_setup_intent": null,
|
114
|
+
"pending_update": null,
|
115
|
+
"plan": {
|
116
|
+
"id": "price_000000000000000000000000",
|
117
|
+
"object": "plan",
|
118
|
+
"active": true,
|
119
|
+
"aggregate_usage": null,
|
120
|
+
"amount": 1500,
|
121
|
+
"amount_decimal": "1500",
|
122
|
+
"billing_scheme": "per_unit",
|
123
|
+
"created": 1648320109,
|
124
|
+
"currency": "usd",
|
125
|
+
"interval": "month",
|
126
|
+
"interval_count": 1,
|
127
|
+
"livemode": false,
|
128
|
+
"metadata": {
|
129
|
+
},
|
130
|
+
"nickname": null,
|
131
|
+
"product": "prod_00000000000000",
|
132
|
+
"tiers_mode": null,
|
133
|
+
"transform_usage": null,
|
134
|
+
"trial_period_days": null,
|
135
|
+
"usage_type": "licensed"
|
136
|
+
},
|
137
|
+
"quantity": 1,
|
138
|
+
"schedule": "sub_sched_000000000000000000000000",
|
139
|
+
"start_date": 1648320110,
|
53
140
|
"status": "active",
|
54
|
-
"
|
55
|
-
"
|
56
|
-
"current_period_start": 1381080557,
|
57
|
-
"current_period_end": 1383758957,
|
58
|
-
"ended_at": null,
|
59
|
-
"trial_start": null,
|
141
|
+
"test_clock": null,
|
142
|
+
"transfer_data": null,
|
60
143
|
"trial_end": null,
|
61
|
-
"
|
62
|
-
"quantity": 1,
|
63
|
-
"application_fee_percent": null
|
144
|
+
"trial_start": null
|
64
145
|
}
|
65
|
-
}
|
66
|
-
|
146
|
+
},
|
147
|
+
"livemode": false,
|
148
|
+
"pending_webhooks": 2,
|
149
|
+
"request": {
|
150
|
+
"id": "req_00000000000000",
|
151
|
+
"idempotency_key": "af06a7d9-5408-4f65-8379-59a93874d04c"
|
152
|
+
},
|
153
|
+
"type": "customer.subscription.created"
|
154
|
+
}
|
@@ -1,65 +1,154 @@
|
|
1
1
|
{
|
2
|
-
"
|
3
|
-
"livemode": false,
|
4
|
-
"id": "evt_00000000000000",
|
5
|
-
"type": "customer.subscription.deleted",
|
2
|
+
"id": "evt_000000000000000000000000",
|
6
3
|
"object": "event",
|
4
|
+
"api_version": "2020-08-27",
|
5
|
+
"created": 1648320097,
|
7
6
|
"data": {
|
8
7
|
"object": {
|
9
|
-
"id": "
|
8
|
+
"id": "sub_000000000000000000000000",
|
9
|
+
"object": "subscription",
|
10
|
+
"application_fee_percent": null,
|
11
|
+
"automatic_tax": {
|
12
|
+
"enabled": false
|
13
|
+
},
|
14
|
+
"billing_cycle_anchor": 1648320096,
|
15
|
+
"billing_thresholds": null,
|
16
|
+
"cancel_at": null,
|
17
|
+
"cancel_at_period_end": false,
|
18
|
+
"canceled_at": 1648320097,
|
19
|
+
"collection_method": "charge_automatically",
|
20
|
+
"created": 1648320096,
|
21
|
+
"current_period_end": 1650998496,
|
22
|
+
"current_period_start": 1648320096,
|
23
|
+
"customer": "cus_00000000000000",
|
24
|
+
"days_until_due": null,
|
25
|
+
"default_payment_method": null,
|
26
|
+
"default_source": null,
|
27
|
+
"default_tax_rates": [
|
28
|
+
|
29
|
+
],
|
30
|
+
"discount": null,
|
31
|
+
"ended_at": 1648320097,
|
10
32
|
"items": {
|
11
33
|
"object": "list",
|
12
|
-
"data": [
|
34
|
+
"data": [
|
35
|
+
{
|
13
36
|
"id": "si_00000000000000",
|
14
37
|
"object": "subscription_item",
|
15
|
-
"
|
38
|
+
"billing_thresholds": null,
|
39
|
+
"created": 1648320096,
|
40
|
+
"metadata": {
|
41
|
+
},
|
16
42
|
"plan": {
|
17
|
-
"
|
18
|
-
"product": "pr_00000000000000",
|
19
|
-
"amount": 100,
|
20
|
-
"currency": "usd",
|
21
|
-
"id": "fkx0AFo_00000000000000",
|
43
|
+
"id": "price_000000000000000000000000",
|
22
44
|
"object": "plan",
|
23
|
-
"
|
45
|
+
"active": true,
|
46
|
+
"aggregate_usage": null,
|
47
|
+
"amount": 1500,
|
48
|
+
"amount_decimal": "1500",
|
49
|
+
"billing_scheme": "per_unit",
|
50
|
+
"created": 1648320095,
|
51
|
+
"currency": "usd",
|
52
|
+
"interval": "month",
|
24
53
|
"interval_count": 1,
|
54
|
+
"livemode": false,
|
55
|
+
"metadata": {
|
56
|
+
},
|
57
|
+
"nickname": null,
|
58
|
+
"product": "prod_00000000000000",
|
59
|
+
"tiers_mode": null,
|
60
|
+
"transform_usage": null,
|
25
61
|
"trial_period_days": null,
|
26
|
-
"
|
62
|
+
"usage_type": "licensed"
|
27
63
|
},
|
28
|
-
"
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
"interval": "month",
|
36
|
-
"product": "pr_00000000000001",
|
37
|
-
"amount": 200,
|
38
|
-
"currency": "eur",
|
39
|
-
"id": "fkx0AFo_00000000000001",
|
40
|
-
"object": "plan",
|
64
|
+
"price": {
|
65
|
+
"id": "price_000000000000000000000000",
|
66
|
+
"object": "price",
|
67
|
+
"active": true,
|
68
|
+
"billing_scheme": "per_unit",
|
69
|
+
"created": 1648320095,
|
70
|
+
"currency": "usd",
|
41
71
|
"livemode": false,
|
42
|
-
"
|
43
|
-
"
|
44
|
-
|
72
|
+
"lookup_key": null,
|
73
|
+
"metadata": {
|
74
|
+
},
|
75
|
+
"nickname": null,
|
76
|
+
"product": "prod_00000000000000",
|
77
|
+
"recurring": {
|
78
|
+
"aggregate_usage": null,
|
79
|
+
"interval": "month",
|
80
|
+
"interval_count": 1,
|
81
|
+
"trial_period_days": null,
|
82
|
+
"usage_type": "licensed"
|
83
|
+
},
|
84
|
+
"tax_behavior": "unspecified",
|
85
|
+
"tiers_mode": null,
|
86
|
+
"transform_quantity": null,
|
87
|
+
"type": "recurring",
|
88
|
+
"unit_amount": 1500,
|
89
|
+
"unit_amount_decimal": "1500"
|
45
90
|
},
|
46
|
-
"quantity":
|
91
|
+
"quantity": 1,
|
92
|
+
"subscription": "sub_000000000000000000000000",
|
93
|
+
"tax_rates": [
|
94
|
+
|
95
|
+
]
|
47
96
|
}
|
48
|
-
]
|
97
|
+
],
|
98
|
+
"has_more": false,
|
99
|
+
"total_count": 1,
|
100
|
+
"url": "/v1/subscription_items?subscription=sub_000000000000000000000000"
|
49
101
|
},
|
50
|
-
"
|
51
|
-
"
|
102
|
+
"latest_invoice": "in_000000000000000000000000",
|
103
|
+
"livemode": false,
|
104
|
+
"metadata": {
|
105
|
+
},
|
106
|
+
"next_pending_invoice_item_invoice": null,
|
107
|
+
"pause_collection": null,
|
108
|
+
"payment_settings": {
|
109
|
+
"payment_method_options": null,
|
110
|
+
"payment_method_types": null
|
111
|
+
},
|
112
|
+
"pending_invoice_item_interval": null,
|
113
|
+
"pending_setup_intent": null,
|
114
|
+
"pending_update": null,
|
115
|
+
"plan": {
|
116
|
+
"id": "price_000000000000000000000000",
|
117
|
+
"object": "plan",
|
118
|
+
"active": true,
|
119
|
+
"aggregate_usage": null,
|
120
|
+
"amount": 1500,
|
121
|
+
"amount_decimal": "1500",
|
122
|
+
"billing_scheme": "per_unit",
|
123
|
+
"created": 1648320095,
|
124
|
+
"currency": "usd",
|
125
|
+
"interval": "month",
|
126
|
+
"interval_count": 1,
|
127
|
+
"livemode": false,
|
128
|
+
"metadata": {
|
129
|
+
},
|
130
|
+
"nickname": null,
|
131
|
+
"product": "prod_00000000000000",
|
132
|
+
"tiers_mode": null,
|
133
|
+
"transform_usage": null,
|
134
|
+
"trial_period_days": null,
|
135
|
+
"usage_type": "licensed"
|
136
|
+
},
|
137
|
+
"quantity": 1,
|
138
|
+
"schedule": "sub_sched_000000000000000000000000",
|
139
|
+
"start_date": 1648320096,
|
52
140
|
"status": "canceled",
|
53
|
-
"
|
54
|
-
"
|
55
|
-
"current_period_start": 1381080564,
|
56
|
-
"current_period_end": 1383758964,
|
57
|
-
"ended_at": 1381021514,
|
58
|
-
"trial_start": null,
|
141
|
+
"test_clock": null,
|
142
|
+
"transfer_data": null,
|
59
143
|
"trial_end": null,
|
60
|
-
"
|
61
|
-
"quantity": 1,
|
62
|
-
"application_fee_percent": null
|
144
|
+
"trial_start": null
|
63
145
|
}
|
64
|
-
}
|
65
|
-
|
146
|
+
},
|
147
|
+
"livemode": false,
|
148
|
+
"pending_webhooks": 3,
|
149
|
+
"request": {
|
150
|
+
"id": "req_00000000000000",
|
151
|
+
"idempotency_key": "27f56452-b979-42fb-8bc1-219db1e65979"
|
152
|
+
},
|
153
|
+
"type": "customer.subscription.deleted"
|
154
|
+
}
|