stripe-ruby-mock 3.1.0.rc3 → 4.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (125) 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 +36 -0
  5. data/Gemfile +0 -5
  6. data/README.md +6 -4
  7. data/lib/stripe_mock/api/client.rb +1 -1
  8. data/lib/stripe_mock/api/webhooks.rb +65 -26
  9. data/lib/stripe_mock/data.rb +80 -11
  10. data/lib/stripe_mock/instance.rb +7 -3
  11. data/lib/stripe_mock/request_handlers/accounts.rb +17 -6
  12. data/lib/stripe_mock/request_handlers/charges.rb +25 -1
  13. data/lib/stripe_mock/request_handlers/checkout_session.rb +158 -1
  14. data/lib/stripe_mock/request_handlers/customers.rb +12 -1
  15. data/lib/stripe_mock/request_handlers/events.rb +30 -3
  16. data/lib/stripe_mock/request_handlers/helpers/coupon_helpers.rb +1 -0
  17. data/lib/stripe_mock/request_handlers/helpers/search_helpers.rb +67 -0
  18. data/lib/stripe_mock/request_handlers/helpers/subscription_helpers.rb +28 -9
  19. data/lib/stripe_mock/request_handlers/invoices.rb +16 -2
  20. data/lib/stripe_mock/request_handlers/payment_intents.rb +23 -3
  21. data/lib/stripe_mock/request_handlers/payment_methods.rb +5 -1
  22. data/lib/stripe_mock/request_handlers/prices.rb +31 -4
  23. data/lib/stripe_mock/request_handlers/products.rb +14 -5
  24. data/lib/stripe_mock/request_handlers/promotion_codes.rb +43 -0
  25. data/lib/stripe_mock/request_handlers/refunds.rb +13 -2
  26. data/lib/stripe_mock/request_handlers/setup_intents.rb +16 -9
  27. data/lib/stripe_mock/request_handlers/subscriptions.rb +103 -5
  28. data/lib/stripe_mock/request_handlers/transfers.rb +12 -1
  29. data/lib/stripe_mock/request_handlers/validators/param_validators.rb +5 -4
  30. data/lib/stripe_mock/test_strategies/base.rb +51 -24
  31. data/lib/stripe_mock/version.rb +1 -1
  32. data/lib/stripe_mock/webhook_fixtures/account.updated.json +1 -1
  33. data/lib/stripe_mock/webhook_fixtures/balance.available.json +26 -20
  34. data/lib/stripe_mock/webhook_fixtures/charge.captured.json +143 -0
  35. data/lib/stripe_mock/webhook_fixtures/charge.dispute.created.json +63 -16
  36. data/lib/stripe_mock/webhook_fixtures/charge.failed.json +49 -120
  37. data/lib/stripe_mock/webhook_fixtures/charge.refund.updated.json +35 -0
  38. data/lib/stripe_mock/webhook_fixtures/charge.refunded.json +145 -50
  39. data/lib/stripe_mock/webhook_fixtures/charge.succeeded.json +114 -43
  40. data/lib/stripe_mock/webhook_fixtures/checkout.session.completed.json +79 -0
  41. data/lib/stripe_mock/webhook_fixtures/checkout.session.completed.payment_mode.json +53 -0
  42. data/lib/stripe_mock/webhook_fixtures/checkout.session.completed.setup_mode.json +45 -0
  43. data/lib/stripe_mock/webhook_fixtures/customer.created.json +37 -46
  44. data/lib/stripe_mock/webhook_fixtures/customer.deleted.json +36 -32
  45. data/lib/stripe_mock/webhook_fixtures/customer.source.created.json +31 -22
  46. data/lib/stripe_mock/webhook_fixtures/customer.source.updated.json +36 -25
  47. data/lib/stripe_mock/webhook_fixtures/customer.subscription.created.json +135 -47
  48. data/lib/stripe_mock/webhook_fixtures/customer.subscription.deleted.json +134 -45
  49. data/lib/stripe_mock/webhook_fixtures/customer.subscription.updated.json +135 -56
  50. data/lib/stripe_mock/webhook_fixtures/customer.updated.json +38 -47
  51. data/lib/stripe_mock/webhook_fixtures/invoice.created.json +176 -49
  52. data/lib/stripe_mock/webhook_fixtures/invoice.finalized.json +171 -0
  53. data/lib/stripe_mock/webhook_fixtures/invoice.paid.json +171 -0
  54. data/lib/stripe_mock/webhook_fixtures/invoice.payment_action_required.json +171 -0
  55. data/lib/stripe_mock/webhook_fixtures/invoice.payment_failed.json +149 -83
  56. data/lib/stripe_mock/webhook_fixtures/invoice.payment_succeeded.json +149 -90
  57. data/lib/stripe_mock/webhook_fixtures/invoice.upcoming.json +70 -0
  58. data/lib/stripe_mock/webhook_fixtures/invoice.updated.json +178 -50
  59. data/lib/stripe_mock/webhook_fixtures/invoiceitem.created.json +87 -13
  60. data/lib/stripe_mock/webhook_fixtures/invoiceitem.updated.json +88 -14
  61. data/lib/stripe_mock/webhook_fixtures/mandate.updated.json +34 -0
  62. data/lib/stripe_mock/webhook_fixtures/payment_intent.amount_capturable_updated.json +170 -0
  63. data/lib/stripe_mock/webhook_fixtures/payment_intent.canceled.json +73 -0
  64. data/lib/stripe_mock/webhook_fixtures/payment_intent.created.json +86 -0
  65. data/lib/stripe_mock/webhook_fixtures/payment_intent.payment_failed.json +118 -79
  66. data/lib/stripe_mock/webhook_fixtures/payment_intent.processing.json +162 -0
  67. data/lib/stripe_mock/webhook_fixtures/payment_intent.requires_action.json +191 -0
  68. data/lib/stripe_mock/webhook_fixtures/payment_intent.succeeded.json +85 -53
  69. data/lib/stripe_mock/webhook_fixtures/payment_link.created.json +47 -0
  70. data/lib/stripe_mock/webhook_fixtures/payment_link.updated.json +50 -0
  71. data/lib/stripe_mock/webhook_fixtures/payment_method.attached.json +63 -0
  72. data/lib/stripe_mock/webhook_fixtures/payment_method.detached.json +62 -0
  73. data/lib/stripe_mock/webhook_fixtures/payout.created.json +40 -0
  74. data/lib/stripe_mock/webhook_fixtures/payout.paid.json +40 -0
  75. data/lib/stripe_mock/webhook_fixtures/payout.updated.json +46 -0
  76. data/lib/stripe_mock/webhook_fixtures/plan.created.json +30 -13
  77. data/lib/stripe_mock/webhook_fixtures/plan.deleted.json +30 -13
  78. data/lib/stripe_mock/webhook_fixtures/plan.updated.json +34 -14
  79. data/lib/stripe_mock/webhook_fixtures/price.created.json +42 -0
  80. data/lib/stripe_mock/webhook_fixtures/price.deleted.json +42 -0
  81. data/lib/stripe_mock/webhook_fixtures/price.updated.json +48 -0
  82. data/lib/stripe_mock/webhook_fixtures/product.created.json +19 -13
  83. data/lib/stripe_mock/webhook_fixtures/product.deleted.json +20 -14
  84. data/lib/stripe_mock/webhook_fixtures/product.updated.json +24 -15
  85. data/lib/stripe_mock/webhook_fixtures/quote.accepted.json +92 -0
  86. data/lib/stripe_mock/webhook_fixtures/quote.canceled.json +92 -0
  87. data/lib/stripe_mock/webhook_fixtures/quote.created.json +92 -0
  88. data/lib/stripe_mock/webhook_fixtures/quote.finalized.json +92 -0
  89. data/lib/stripe_mock/webhook_fixtures/setup_intent.canceled.json +46 -0
  90. data/lib/stripe_mock/webhook_fixtures/setup_intent.created.json +51 -0
  91. data/lib/stripe_mock/webhook_fixtures/setup_intent.setup_failed.json +100 -0
  92. data/lib/stripe_mock/webhook_fixtures/setup_intent.succeeded.json +46 -0
  93. data/lib/stripe_mock/webhook_fixtures/subscription_schedule.canceled.json +119 -0
  94. data/lib/stripe_mock/webhook_fixtures/subscription_schedule.created.json +114 -0
  95. data/lib/stripe_mock/webhook_fixtures/subscription_schedule.released.json +111 -0
  96. data/lib/stripe_mock/webhook_fixtures/subscription_schedule.updated.json +125 -0
  97. data/lib/stripe_mock/webhook_fixtures/tax_rate.created.json +32 -0
  98. data/lib/stripe_mock/webhook_fixtures/tax_rate.updated.json +37 -0
  99. data/lib/stripe_mock.rb +4 -1
  100. data/spec/instance_spec.rb +3 -1
  101. data/spec/integration_examples/completing_checkout_sessions_example.rb +37 -0
  102. data/spec/readme_spec.rb +1 -1
  103. data/spec/shared_stripe_examples/account_examples.rb +9 -1
  104. data/spec/shared_stripe_examples/bank_token_examples.rb +5 -7
  105. data/spec/shared_stripe_examples/charge_examples.rb +97 -0
  106. data/spec/shared_stripe_examples/checkout_session_examples.rb +99 -0
  107. data/spec/shared_stripe_examples/customer_examples.rb +56 -0
  108. data/spec/shared_stripe_examples/invoice_examples.rb +107 -1
  109. data/spec/shared_stripe_examples/payment_intent_examples.rb +136 -0
  110. data/spec/shared_stripe_examples/payment_method_examples.rb +32 -27
  111. data/spec/shared_stripe_examples/price_examples.rb +111 -2
  112. data/spec/shared_stripe_examples/product_examples.rb +68 -0
  113. data/spec/shared_stripe_examples/promotion_code_examples.rb +68 -0
  114. data/spec/shared_stripe_examples/refund_examples.rb +13 -0
  115. data/spec/shared_stripe_examples/setup_intent_examples.rb +17 -0
  116. data/spec/shared_stripe_examples/subscription_examples.rb +276 -6
  117. data/spec/shared_stripe_examples/transfer_examples.rb +10 -1
  118. data/spec/shared_stripe_examples/webhook_event_examples.rb +51 -5
  119. data/spec/spec_helper.rb +1 -1
  120. data/spec/support/stripe_examples.rb +3 -1
  121. data/stripe-ruby-mock.gemspec +3 -4
  122. metadata +59 -29
  123. data/.travis.yml +0 -25
  124. data/lib/stripe_mock/request_handlers/checkout.rb +0 -15
  125. data/spec/shared_stripe_examples/checkout_examples.rb +0 -47
@@ -0,0 +1,92 @@
1
+ {
2
+ "id": "evt_000000000000000000000000",
3
+ "object": "event",
4
+ "api_version": "2020-08-27",
5
+ "created": 1648320086,
6
+ "data": {
7
+ "object": {
8
+ "id": "qt_000000000000000000000000",
9
+ "object": "quote",
10
+ "amount_subtotal": 15000,
11
+ "amount_total": 15000,
12
+ "application_fee_amount": null,
13
+ "application_fee_percent": null,
14
+ "automatic_tax": {
15
+ "enabled": false,
16
+ "status": null
17
+ },
18
+ "collection_method": "charge_automatically",
19
+ "computed": {
20
+ "recurring": {
21
+ "amount_subtotal": 15000,
22
+ "amount_total": 15000,
23
+ "interval": "month",
24
+ "interval_count": 1,
25
+ "total_details": {
26
+ "amount_discount": 0,
27
+ "amount_shipping": 0,
28
+ "amount_tax": 0
29
+ }
30
+ },
31
+ "upfront": {
32
+ "amount_subtotal": 15000,
33
+ "amount_total": 15000,
34
+ "total_details": {
35
+ "amount_discount": 0,
36
+ "amount_shipping": 0,
37
+ "amount_tax": 0
38
+ }
39
+ }
40
+ },
41
+ "created": 1648320085,
42
+ "currency": "usd",
43
+ "customer": "cus_00000000000000",
44
+ "default_tax_rates": [
45
+
46
+ ],
47
+ "description": "(created by Stripe CLI)",
48
+ "discounts": [
49
+
50
+ ],
51
+ "expires_at": 1650912085,
52
+ "footer": null,
53
+ "from_quote": null,
54
+ "header": null,
55
+ "invoice": null,
56
+ "invoice_settings": {
57
+ "days_until_due": null
58
+ },
59
+ "livemode": false,
60
+ "metadata": {
61
+ },
62
+ "number": null,
63
+ "on_behalf_of": null,
64
+ "status": "draft",
65
+ "status_transitions": {
66
+ "accepted_at": null,
67
+ "canceled_at": null,
68
+ "finalized_at": null
69
+ },
70
+ "subscription": null,
71
+ "subscription_data": {
72
+ "effective_date": null,
73
+ "trial_period_days": null
74
+ },
75
+ "subscription_schedule": null,
76
+ "test_clock": null,
77
+ "total_details": {
78
+ "amount_discount": 0,
79
+ "amount_shipping": 0,
80
+ "amount_tax": 0
81
+ },
82
+ "transfer_data": null
83
+ }
84
+ },
85
+ "livemode": false,
86
+ "pending_webhooks": 2,
87
+ "request": {
88
+ "id": "req_00000000000000",
89
+ "idempotency_key": "444b105e-dba9-4779-b9aa-80bdc9b9a354"
90
+ },
91
+ "type": "quote.created"
92
+ }
@@ -0,0 +1,92 @@
1
+ {
2
+ "id": "evt_000000000000000000000000",
3
+ "object": "event",
4
+ "api_version": "2020-08-27",
5
+ "created": 1648320086,
6
+ "data": {
7
+ "object": {
8
+ "id": "qt_000000000000000000000000",
9
+ "object": "quote",
10
+ "amount_subtotal": 15000,
11
+ "amount_total": 15000,
12
+ "application_fee_amount": null,
13
+ "application_fee_percent": null,
14
+ "automatic_tax": {
15
+ "enabled": false,
16
+ "status": null
17
+ },
18
+ "collection_method": "charge_automatically",
19
+ "computed": {
20
+ "recurring": {
21
+ "amount_subtotal": 15000,
22
+ "amount_total": 15000,
23
+ "interval": "month",
24
+ "interval_count": 1,
25
+ "total_details": {
26
+ "amount_discount": 0,
27
+ "amount_shipping": 0,
28
+ "amount_tax": 0
29
+ }
30
+ },
31
+ "upfront": {
32
+ "amount_subtotal": 15000,
33
+ "amount_total": 15000,
34
+ "total_details": {
35
+ "amount_discount": 0,
36
+ "amount_shipping": 0,
37
+ "amount_tax": 0
38
+ }
39
+ }
40
+ },
41
+ "created": 1648320085,
42
+ "currency": "usd",
43
+ "customer": "cus_00000000000000",
44
+ "default_tax_rates": [
45
+
46
+ ],
47
+ "description": "(created by Stripe CLI)",
48
+ "discounts": [
49
+
50
+ ],
51
+ "expires_at": 1650912085,
52
+ "footer": null,
53
+ "from_quote": null,
54
+ "header": null,
55
+ "invoice": null,
56
+ "invoice_settings": {
57
+ "days_until_due": null
58
+ },
59
+ "livemode": false,
60
+ "metadata": {
61
+ },
62
+ "number": "QT-013268C5-0001-1",
63
+ "on_behalf_of": null,
64
+ "status": "open",
65
+ "status_transitions": {
66
+ "accepted_at": null,
67
+ "canceled_at": null,
68
+ "finalized_at": 1648320086
69
+ },
70
+ "subscription": null,
71
+ "subscription_data": {
72
+ "effective_date": null,
73
+ "trial_period_days": null
74
+ },
75
+ "subscription_schedule": null,
76
+ "test_clock": null,
77
+ "total_details": {
78
+ "amount_discount": 0,
79
+ "amount_shipping": 0,
80
+ "amount_tax": 0
81
+ },
82
+ "transfer_data": null
83
+ }
84
+ },
85
+ "livemode": false,
86
+ "pending_webhooks": 2,
87
+ "request": {
88
+ "id": "req_00000000000000",
89
+ "idempotency_key": "1aa55aab-a2f3-4b60-9755-bd8ab903d387"
90
+ },
91
+ "type": "quote.finalized"
92
+ }
@@ -0,0 +1,46 @@
1
+ {
2
+ "id": "evt_000000000000000000000000",
3
+ "object": "event",
4
+ "api_version": "2020-08-27",
5
+ "created": 1648320088,
6
+ "data": {
7
+ "object": {
8
+ "id": "seti_000000000000000000000000",
9
+ "object": "setup_intent",
10
+ "application": null,
11
+ "cancellation_reason": "requested_by_customer",
12
+ "client_secret": "seti_000000000000000000000000_secret_0000000000000000000000000000000",
13
+ "created": 1648320088,
14
+ "customer": null,
15
+ "description": "(created by Stripe CLI)",
16
+ "last_setup_error": null,
17
+ "latest_attempt": null,
18
+ "livemode": false,
19
+ "mandate": null,
20
+ "metadata": {
21
+ },
22
+ "next_action": null,
23
+ "on_behalf_of": null,
24
+ "payment_method": null,
25
+ "payment_method_options": {
26
+ "card": {
27
+ "mandate_options": null,
28
+ "request_three_d_secure": "automatic"
29
+ }
30
+ },
31
+ "payment_method_types": [
32
+ "card"
33
+ ],
34
+ "single_use_mandate": null,
35
+ "status": "canceled",
36
+ "usage": "off_session"
37
+ }
38
+ },
39
+ "livemode": false,
40
+ "pending_webhooks": 2,
41
+ "request": {
42
+ "id": "req_00000000000000",
43
+ "idempotency_key": "6bc9d964-51d3-47d2-82b2-127b3c5c27cd"
44
+ },
45
+ "type": "setup_intent.canceled"
46
+ }
@@ -0,0 +1,51 @@
1
+ {
2
+ "id": "evt_000000000000000000000000",
3
+ "object": "event",
4
+ "api_version": "2020-08-27",
5
+ "created": 1648321932,
6
+ "data": {
7
+ "object": {
8
+ "id": "seti_000000000000000000000000",
9
+ "object": "setup_intent",
10
+ "application": null,
11
+ "cancellation_reason": null,
12
+ "client_secret": "seti_000000000000000000000000_secret_0000000000000000000000000000000",
13
+ "created": 1648321931,
14
+ "customer": null,
15
+ "description": null,
16
+ "last_setup_error": null,
17
+ "latest_attempt": null,
18
+ "livemode": false,
19
+ "mandate": null,
20
+ "metadata": {
21
+ },
22
+ "next_action": null,
23
+ "on_behalf_of": null,
24
+ "payment_method": "pm_000000000000000000000000",
25
+ "payment_method_options": {
26
+ "acss_debit": {
27
+ "currency": "cad",
28
+ "mandate_options": {
29
+ "interval_description": "First day of every month",
30
+ "payment_schedule": "interval",
31
+ "transaction_type": "personal"
32
+ },
33
+ "verification_method": "automatic"
34
+ }
35
+ },
36
+ "payment_method_types": [
37
+ "acss_debit"
38
+ ],
39
+ "single_use_mandate": null,
40
+ "status": "requires_confirmation",
41
+ "usage": "off_session"
42
+ }
43
+ },
44
+ "livemode": false,
45
+ "pending_webhooks": 1,
46
+ "request": {
47
+ "id": null,
48
+ "idempotency_key": null
49
+ },
50
+ "type": "setup_intent.created"
51
+ }
@@ -0,0 +1,100 @@
1
+ {
2
+ "id": "evt_000000000000000000000000",
3
+ "object": "event",
4
+ "api_version": "2020-08-27",
5
+ "created": 1648320091,
6
+ "data": {
7
+ "object": {
8
+ "id": "seti_000000000000000000000000",
9
+ "object": "setup_intent",
10
+ "application": null,
11
+ "cancellation_reason": null,
12
+ "client_secret": "seti_000000000000000000000000_secret_0000000000000000000000000000000",
13
+ "created": 1648320090,
14
+ "customer": null,
15
+ "description": "(created by Stripe CLI)",
16
+ "last_setup_error": {
17
+ "code": "card_declined",
18
+ "decline_code": "generic_decline",
19
+ "doc_url": "https://stripe.com/docs/error-codes/card-declined",
20
+ "message": "Your card was declined.",
21
+ "payment_method": {
22
+ "id": "pm_000000000000000000000000",
23
+ "object": "payment_method",
24
+ "billing_details": {
25
+ "address": {
26
+ "city": null,
27
+ "country": null,
28
+ "line1": null,
29
+ "line2": null,
30
+ "postal_code": null,
31
+ "state": null
32
+ },
33
+ "email": null,
34
+ "name": null,
35
+ "phone": null
36
+ },
37
+ "card": {
38
+ "brand": "visa",
39
+ "checks": {
40
+ "address_line1_check": null,
41
+ "address_postal_code_check": null,
42
+ "cvc_check": null
43
+ },
44
+ "country": "US",
45
+ "exp_month": 3,
46
+ "exp_year": 2023,
47
+ "fingerprint": "kMzSwhaalD1uR96R",
48
+ "funding": "credit",
49
+ "generated_from": null,
50
+ "last4": "0002",
51
+ "networks": {
52
+ "available": [
53
+ "visa"
54
+ ],
55
+ "preferred": null
56
+ },
57
+ "three_d_secure_usage": {
58
+ "supported": true
59
+ },
60
+ "wallet": null
61
+ },
62
+ "created": 1648320090,
63
+ "customer": null,
64
+ "livemode": false,
65
+ "metadata": {
66
+ },
67
+ "type": "card"
68
+ },
69
+ "type": "card_error"
70
+ },
71
+ "latest_attempt": "setatt_000000000000000000000000",
72
+ "livemode": false,
73
+ "mandate": null,
74
+ "metadata": {
75
+ },
76
+ "next_action": null,
77
+ "on_behalf_of": null,
78
+ "payment_method": null,
79
+ "payment_method_options": {
80
+ "card": {
81
+ "mandate_options": null,
82
+ "request_three_d_secure": "automatic"
83
+ }
84
+ },
85
+ "payment_method_types": [
86
+ "card"
87
+ ],
88
+ "single_use_mandate": null,
89
+ "status": "requires_payment_method",
90
+ "usage": "off_session"
91
+ }
92
+ },
93
+ "livemode": false,
94
+ "pending_webhooks": 2,
95
+ "request": {
96
+ "id": "req_00000000000000",
97
+ "idempotency_key": "bc94842b-7374-410e-8aa2-935b8cc1250c"
98
+ },
99
+ "type": "setup_intent.setup_failed"
100
+ }
@@ -0,0 +1,46 @@
1
+ {
2
+ "id": "evt_000000000000000000000000",
3
+ "object": "event",
4
+ "api_version": "2020-08-27",
5
+ "created": 1648320093,
6
+ "data": {
7
+ "object": {
8
+ "id": "seti_000000000000000000000000",
9
+ "object": "setup_intent",
10
+ "application": null,
11
+ "cancellation_reason": null,
12
+ "client_secret": "seti_000000000000000000000000_secret_0000000000000000000000000000000",
13
+ "created": 1648320092,
14
+ "customer": null,
15
+ "description": "(created by Stripe CLI)",
16
+ "last_setup_error": null,
17
+ "latest_attempt": "setatt_000000000000000000000000",
18
+ "livemode": false,
19
+ "mandate": null,
20
+ "metadata": {
21
+ },
22
+ "next_action": null,
23
+ "on_behalf_of": null,
24
+ "payment_method": "pm_000000000000000000000000",
25
+ "payment_method_options": {
26
+ "card": {
27
+ "mandate_options": null,
28
+ "request_three_d_secure": "automatic"
29
+ }
30
+ },
31
+ "payment_method_types": [
32
+ "card"
33
+ ],
34
+ "single_use_mandate": null,
35
+ "status": "succeeded",
36
+ "usage": "off_session"
37
+ }
38
+ },
39
+ "livemode": false,
40
+ "pending_webhooks": 2,
41
+ "request": {
42
+ "id": "req_00000000000000",
43
+ "idempotency_key": "229fd8b7-d019-4b8b-91a9-920460d48a61"
44
+ },
45
+ "type": "setup_intent.succeeded"
46
+ }
@@ -0,0 +1,119 @@
1
+ {
2
+ "id": "evt_000000000000000000000000",
3
+ "object": "event",
4
+ "api_version": "2020-08-27",
5
+ "created": 1648320097,
6
+ "data": {
7
+ "object": {
8
+ "id": "sub_sched_000000000000000000000000",
9
+ "object": "subscription_schedule",
10
+ "canceled_at": 1648320097,
11
+ "completed_at": null,
12
+ "created": 1648320096,
13
+ "current_phase": null,
14
+ "customer": "cus_00000000000000",
15
+ "default_settings": {
16
+ "application_fee_percent": null,
17
+ "automatic_tax": {
18
+ "enabled": false
19
+ },
20
+ "billing_cycle_anchor": "automatic",
21
+ "billing_thresholds": null,
22
+ "collection_method": "charge_automatically",
23
+ "default_payment_method": null,
24
+ "default_source": null,
25
+ "invoice_settings": null,
26
+ "transfer_data": null
27
+ },
28
+ "end_behavior": "release",
29
+ "livemode": false,
30
+ "metadata": {
31
+ },
32
+ "phases": [
33
+ {
34
+ "add_invoice_items": [
35
+
36
+ ],
37
+ "application_fee_percent": null,
38
+ "billing_cycle_anchor": null,
39
+ "billing_thresholds": null,
40
+ "collection_method": null,
41
+ "coupon": null,
42
+ "default_payment_method": null,
43
+ "default_tax_rates": [
44
+
45
+ ],
46
+ "end_date": 1650998496,
47
+ "invoice_settings": null,
48
+ "items": [
49
+ {
50
+ "billing_thresholds": null,
51
+ "plan": "price_000000000000000000000000",
52
+ "price": "price_000000000000000000000000",
53
+ "quantity": 1,
54
+ "tax_rates": [
55
+
56
+ ]
57
+ }
58
+ ],
59
+ "proration_behavior": "create_prorations",
60
+ "start_date": 1648320096,
61
+ "transfer_data": null,
62
+ "trial_end": null
63
+ },
64
+ {
65
+ "add_invoice_items": [
66
+
67
+ ],
68
+ "application_fee_percent": null,
69
+ "billing_cycle_anchor": null,
70
+ "billing_thresholds": null,
71
+ "collection_method": null,
72
+ "coupon": null,
73
+ "default_payment_method": null,
74
+ "default_tax_rates": [
75
+
76
+ ],
77
+ "end_date": 1653590496,
78
+ "invoice_settings": null,
79
+ "items": [
80
+ {
81
+ "billing_thresholds": null,
82
+ "plan": "price_000000000000000000000000",
83
+ "price": "price_000000000000000000000000",
84
+ "quantity": 2,
85
+ "tax_rates": [
86
+
87
+ ]
88
+ }
89
+ ],
90
+ "proration_behavior": "create_prorations",
91
+ "start_date": 1650998496,
92
+ "transfer_data": null,
93
+ "trial_end": null
94
+ }
95
+ ],
96
+ "released_at": null,
97
+ "released_subscription": null,
98
+ "renewal_interval": null,
99
+ "status": "canceled",
100
+ "subscription": "sub_000000000000000000000000",
101
+ "test_clock": null
102
+ },
103
+ "previous_attributes": {
104
+ "canceled_at": null,
105
+ "current_phase": {
106
+ "end_date": 1650998496,
107
+ "start_date": 1648320096
108
+ },
109
+ "status": "active"
110
+ }
111
+ },
112
+ "livemode": false,
113
+ "pending_webhooks": 2,
114
+ "request": {
115
+ "id": "req_00000000000000",
116
+ "idempotency_key": "27f56452-b979-42fb-8bc1-219db1e65979"
117
+ },
118
+ "type": "subscription_schedule.canceled"
119
+ }
@@ -0,0 +1,114 @@
1
+ {
2
+ "id": "evt_000000000000000000000000",
3
+ "object": "event",
4
+ "api_version": "2020-08-27",
5
+ "created": 1648320110,
6
+ "data": {
7
+ "object": {
8
+ "id": "sub_sched_000000000000000000000000",
9
+ "object": "subscription_schedule",
10
+ "canceled_at": null,
11
+ "completed_at": null,
12
+ "created": 1648320110,
13
+ "current_phase": {
14
+ "end_date": 1650998510,
15
+ "start_date": 1648320110
16
+ },
17
+ "customer": "cus_00000000000000",
18
+ "default_settings": {
19
+ "application_fee_percent": null,
20
+ "automatic_tax": {
21
+ "enabled": false
22
+ },
23
+ "billing_cycle_anchor": "automatic",
24
+ "billing_thresholds": null,
25
+ "collection_method": "charge_automatically",
26
+ "default_payment_method": null,
27
+ "default_source": null,
28
+ "invoice_settings": null,
29
+ "transfer_data": null
30
+ },
31
+ "end_behavior": "release",
32
+ "livemode": false,
33
+ "metadata": {
34
+ },
35
+ "phases": [
36
+ {
37
+ "add_invoice_items": [
38
+
39
+ ],
40
+ "application_fee_percent": null,
41
+ "billing_cycle_anchor": null,
42
+ "billing_thresholds": null,
43
+ "collection_method": null,
44
+ "coupon": null,
45
+ "default_payment_method": null,
46
+ "default_tax_rates": [
47
+
48
+ ],
49
+ "end_date": 1650998510,
50
+ "invoice_settings": null,
51
+ "items": [
52
+ {
53
+ "billing_thresholds": null,
54
+ "plan": "price_000000000000000000000000",
55
+ "price": "price_000000000000000000000000",
56
+ "quantity": 1,
57
+ "tax_rates": [
58
+
59
+ ]
60
+ }
61
+ ],
62
+ "proration_behavior": "create_prorations",
63
+ "start_date": 1648320110,
64
+ "transfer_data": null,
65
+ "trial_end": null
66
+ },
67
+ {
68
+ "add_invoice_items": [
69
+
70
+ ],
71
+ "application_fee_percent": null,
72
+ "billing_cycle_anchor": null,
73
+ "billing_thresholds": null,
74
+ "collection_method": null,
75
+ "coupon": null,
76
+ "default_payment_method": null,
77
+ "default_tax_rates": [
78
+
79
+ ],
80
+ "end_date": 1653590510,
81
+ "invoice_settings": null,
82
+ "items": [
83
+ {
84
+ "billing_thresholds": null,
85
+ "plan": "price_000000000000000000000000",
86
+ "price": "price_000000000000000000000000",
87
+ "quantity": 2,
88
+ "tax_rates": [
89
+
90
+ ]
91
+ }
92
+ ],
93
+ "proration_behavior": "create_prorations",
94
+ "start_date": 1650998510,
95
+ "transfer_data": null,
96
+ "trial_end": null
97
+ }
98
+ ],
99
+ "released_at": null,
100
+ "released_subscription": null,
101
+ "renewal_interval": null,
102
+ "status": "active",
103
+ "subscription": "sub_000000000000000000000000",
104
+ "test_clock": null
105
+ }
106
+ },
107
+ "livemode": false,
108
+ "pending_webhooks": 2,
109
+ "request": {
110
+ "id": "req_00000000000000",
111
+ "idempotency_key": "af06a7d9-5408-4f65-8379-59a93874d04c"
112
+ },
113
+ "type": "subscription_schedule.created"
114
+ }