stripe_model_callbacks 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (121) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +14 -0
  3. data/app/models/stripe_model_callbacks/application_record.rb +17 -0
  4. data/app/services/stripe_model_callbacks/account/external_account/updated_service.rb +1 -1
  5. data/app/services/stripe_model_callbacks/attributes_assigner_service.rb +1 -1
  6. data/app/services/stripe_model_callbacks/base_service.rb +33 -1
  7. data/app/services/stripe_model_callbacks/charge/dispute_updated_service.rb +1 -1
  8. data/app/services/stripe_model_callbacks/charge/updated_service.rb +1 -1
  9. data/app/services/stripe_model_callbacks/configure_service.rb +52 -24
  10. data/app/services/stripe_model_callbacks/coupon/sync_all.rb +9 -0
  11. data/app/services/stripe_model_callbacks/coupon/updated_service.rb +1 -1
  12. data/app/services/stripe_model_callbacks/customer/bank_account/deleted_service.rb +1 -1
  13. data/app/services/stripe_model_callbacks/customer/deleted_service.rb +1 -1
  14. data/app/services/stripe_model_callbacks/customer/discount_updated_service.rb +1 -1
  15. data/app/services/stripe_model_callbacks/customer/source_updated_service.rb +1 -1
  16. data/app/services/stripe_model_callbacks/customer/subscription/updated_service.rb +1 -1
  17. data/app/services/stripe_model_callbacks/customer/updated_service.rb +1 -1
  18. data/app/services/stripe_model_callbacks/invoice/updated_service.rb +1 -1
  19. data/app/services/stripe_model_callbacks/invoice_item/updated_service.rb +1 -1
  20. data/app/services/stripe_model_callbacks/notifier_service.rb +1 -1
  21. data/app/services/stripe_model_callbacks/order/updated_service.rb +1 -1
  22. data/app/services/stripe_model_callbacks/payout/updated_service.rb +1 -1
  23. data/app/services/stripe_model_callbacks/plan/sync_all.rb +9 -0
  24. data/app/services/stripe_model_callbacks/plan/updated_service.rb +1 -1
  25. data/app/services/stripe_model_callbacks/price/updated_service.rb +14 -0
  26. data/app/services/stripe_model_callbacks/product/updated_service.rb +1 -1
  27. data/app/services/stripe_model_callbacks/recipient/updated_service.rb +1 -1
  28. data/app/services/stripe_model_callbacks/refund/updated_service.rb +1 -1
  29. data/app/services/stripe_model_callbacks/review/updated_service.rb +1 -1
  30. data/app/services/stripe_model_callbacks/sku/updated_service.rb +1 -1
  31. data/app/services/stripe_model_callbacks/source/updated_service.rb +1 -1
  32. data/app/services/stripe_model_callbacks/subscription/state_checker_service.rb +2 -2
  33. data/app/services/stripe_model_callbacks/subscription_schedule/updated_service.rb +46 -0
  34. data/app/services/stripe_model_callbacks/sync_everything.rb +8 -0
  35. data/app/services/stripe_model_callbacks/sync_from_stripe.rb +29 -0
  36. data/app/services/stripe_model_callbacks/tax_rate/updated_service.rb +27 -0
  37. data/app/services/stripe_model_callbacks/transfer/updated_service.rb +1 -1
  38. data/db/migrate/20200317160513_add_auto_advance_and_billing_reason_to_stripe_invoices.rb +6 -0
  39. data/db/migrate/20200317160602_add_status_and_status_transitions_to_stripe_invoices.rb +10 -0
  40. data/db/migrate/20200317180115_add_product_type_to_products.rb +5 -0
  41. data/db/migrate/20200317181224_rename_stripe_invoices_application_fee_to_application_fee_amount.rb +6 -0
  42. data/db/migrate/20200320105158_make_stripe_invoices_forgive_optional.rb +5 -0
  43. data/db/migrate/20200320114859_make_stripe_invoice_closed_optional.rb +5 -0
  44. data/db/migrate/20200323143634_add_amount_paid_and_remaining_and_invoice_url_and_pdf.rb +11 -0
  45. data/db/migrate/20200331074940_add_unit_label_to_stripe_products.rb +5 -0
  46. data/db/migrate/20200331075241_add_metered_info_to_stripe_plans.rb +9 -0
  47. data/db/migrate/20200513131105_create_stripe_subscription_schedules.rb +31 -0
  48. data/db/migrate/20200513131120_create_stripe_subscription_schedule_phases.rb +21 -0
  49. data/db/migrate/20200513131640_create_stripe_subscription_schedule_phase_plans.rb +13 -0
  50. data/db/migrate/20200514132247_add_stripe_id_uniq_to_stripe_invoices.rb +8 -0
  51. data/db/migrate/20200520152604_change_stripe_subscription_schedule_phase_id_to_bigint.rb +27 -0
  52. data/db/migrate/20200529144649_add_latest_invoice_id_to_stripe_subscription.rb +5 -0
  53. data/db/migrate/20201223173035_rename_stripe_subscriptions_start_to_start_date.rb +5 -0
  54. data/db/migrate/20201223202117_create_stripe_tax_rates.rb +15 -0
  55. data/db/migrate/20201224120534_create_stripe_subscription_default_tax_rates.rb +9 -0
  56. data/db/migrate/20201224122058_create_stripe_prices.rb +26 -0
  57. data/db/migrate/20201224123838_add_stripe_price_to_stripe_subscription_items.rb +6 -0
  58. data/lib/stripe_model_callbacks/configuration.rb +1 -1
  59. data/lib/stripe_model_callbacks/factories/stripe_coupons.rb +16 -0
  60. data/lib/stripe_model_callbacks/factories/stripe_plans.rb +3 -1
  61. data/lib/stripe_model_callbacks/factories/stripe_prices.rb +3 -0
  62. data/lib/stripe_model_callbacks/factories/stripe_products.rb +13 -0
  63. data/lib/stripe_model_callbacks/factories/stripe_subscription_default_tax_rates.rb +6 -0
  64. data/lib/stripe_model_callbacks/factories/stripe_subscription_schedule.rb.rb +5 -0
  65. data/lib/stripe_model_callbacks/factories/stripe_subscription_schedule_phase_plan.rb +5 -0
  66. data/lib/stripe_model_callbacks/factories/stripe_subscription_schedule_phases.rb +5 -0
  67. data/lib/stripe_model_callbacks/factories/stripe_subscriptions.rb +1 -1
  68. data/lib/stripe_model_callbacks/factories/stripe_tax_rates.rb +5 -0
  69. data/lib/stripe_model_callbacks/fixtures/stripe_events/customer/customer.subscription.created.2020-12-24.json +112 -0
  70. data/lib/stripe_model_callbacks/fixtures/stripe_events/customer/customer.subscription.created.json +1 -0
  71. data/lib/stripe_model_callbacks/fixtures/stripe_events/customer/customer.subscription.deleted.json +2 -2
  72. data/lib/stripe_model_callbacks/fixtures/stripe_events/customer/customer.subscription.updated.json +1 -1
  73. data/lib/stripe_model_callbacks/fixtures/stripe_events/customer/customer.updated.json +1 -1
  74. data/lib/stripe_model_callbacks/fixtures/stripe_events/invoice/invoice.created.json +13 -3
  75. data/lib/stripe_model_callbacks/fixtures/stripe_events/invoice/invoice.payment_failed.json +14 -4
  76. data/lib/stripe_model_callbacks/fixtures/stripe_events/invoice/invoice.payment_succeeded.json +23 -4
  77. data/lib/stripe_model_callbacks/fixtures/stripe_events/invoice/invoice.sent.json +13 -3
  78. data/lib/stripe_model_callbacks/fixtures/stripe_events/invoice/invoice.upcoming.json +13 -3
  79. data/lib/stripe_model_callbacks/fixtures/stripe_events/invoice/invoice.updated.json +13 -3
  80. data/lib/stripe_model_callbacks/fixtures/stripe_events/invoice/invoice.voided.json +152 -0
  81. data/lib/stripe_model_callbacks/fixtures/stripe_events/plan/plan.created.json +7 -2
  82. data/lib/stripe_model_callbacks/fixtures/stripe_events/price/price.created.json +37 -0
  83. data/lib/stripe_model_callbacks/fixtures/stripe_events/price/price.deleted.json +37 -0
  84. data/lib/stripe_model_callbacks/fixtures/stripe_events/price/price.updated.json +40 -0
  85. data/lib/stripe_model_callbacks/fixtures/stripe_events/product/product.created.json +1 -0
  86. data/lib/stripe_model_callbacks/fixtures/stripe_events/subscription_schedule/subscription_schedule.canceled.json +81 -0
  87. data/lib/stripe_model_callbacks/fixtures/stripe_events/subscription_schedule/subscription_schedule.created.json +77 -0
  88. data/lib/stripe_model_callbacks/fixtures/stripe_events/subscription_schedule/subscription_schedule.updated.json +87 -0
  89. data/lib/stripe_model_callbacks/fixtures/stripe_events/tax_rate/tax_rate.created.json +26 -0
  90. data/lib/stripe_model_callbacks/fixtures/stripe_events/tax_rate/tax_rate.updated.json +29 -0
  91. data/lib/stripe_model_callbacks/models/stripe_bank_account.rb +1 -0
  92. data/lib/stripe_model_callbacks/models/stripe_card.rb +2 -1
  93. data/lib/stripe_model_callbacks/models/stripe_charge.rb +3 -0
  94. data/lib/stripe_model_callbacks/models/stripe_coupon.rb +1 -0
  95. data/lib/stripe_model_callbacks/models/stripe_customer.rb +4 -2
  96. data/lib/stripe_model_callbacks/models/stripe_discount.rb +10 -3
  97. data/lib/stripe_model_callbacks/models/stripe_dispute.rb +1 -0
  98. data/lib/stripe_model_callbacks/models/stripe_invoice.rb +62 -7
  99. data/lib/stripe_model_callbacks/models/stripe_invoice_item.rb +2 -0
  100. data/lib/stripe_model_callbacks/models/stripe_order.rb +1 -0
  101. data/lib/stripe_model_callbacks/models/stripe_order_item.rb +1 -0
  102. data/lib/stripe_model_callbacks/models/stripe_payout.rb +2 -1
  103. data/lib/stripe_model_callbacks/models/stripe_plan.rb +4 -1
  104. data/lib/stripe_model_callbacks/models/stripe_price.rb +27 -0
  105. data/lib/stripe_model_callbacks/models/stripe_product.rb +17 -7
  106. data/lib/stripe_model_callbacks/models/stripe_recipient.rb +1 -0
  107. data/lib/stripe_model_callbacks/models/stripe_refund.rb +1 -0
  108. data/lib/stripe_model_callbacks/models/stripe_review.rb +1 -0
  109. data/lib/stripe_model_callbacks/models/stripe_sku.rb +13 -6
  110. data/lib/stripe_model_callbacks/models/stripe_source.rb +4 -2
  111. data/lib/stripe_model_callbacks/models/stripe_subscription.rb +56 -6
  112. data/lib/stripe_model_callbacks/models/stripe_subscription_default_tax_rate.rb +4 -0
  113. data/lib/stripe_model_callbacks/models/stripe_subscription_item.rb +19 -1
  114. data/lib/stripe_model_callbacks/models/stripe_subscription_schedule.rb +94 -0
  115. data/lib/stripe_model_callbacks/models/stripe_subscription_schedule_phase.rb +67 -0
  116. data/lib/stripe_model_callbacks/models/stripe_subscription_schedule_phase_plan.rb +37 -0
  117. data/lib/stripe_model_callbacks/models/stripe_tax_rate.rb +22 -0
  118. data/lib/stripe_model_callbacks/models/stripe_transfer.rb +1 -0
  119. data/lib/stripe_model_callbacks/version.rb +1 -1
  120. data/lib/stripe_model_callbacks.rb +1 -0
  121. metadata +90 -13
@@ -11,13 +11,17 @@
11
11
  "object": {
12
12
  "id": "in_00000000000000",
13
13
  "object": "invoice",
14
- "amount_due": 0,
15
- "application_fee": null,
14
+ "amount_due": 3500,
15
+ "amount_paid": 0,
16
+ "amount_remaining": 3500,
17
+ "application_fee_amount": null,
16
18
  "attempt_count": 0,
17
19
  "attempted": true,
20
+ "auto_advance": true,
18
21
  "billing": "charge_automatically",
22
+ "billing_reason": "subscription_create",
19
23
  "charge": null,
20
- "closed": false,
24
+ "collection_method": "charge_automatically",
21
25
  "currency": "usd",
22
26
  "customer": "cus_00000000000000",
23
27
  "date": 1517847362,
@@ -25,7 +29,6 @@
25
29
  "discount": null,
26
30
  "due_date": null,
27
31
  "ending_balance": null,
28
- "forgiven": false,
29
32
  "lines": {
30
33
  "data": [
31
34
  {
@@ -79,6 +82,13 @@
79
82
  "receipt_number": null,
80
83
  "starting_balance": 0,
81
84
  "statement_descriptor": null,
85
+ "status": "uncollectible",
86
+ "status_transitions": {
87
+ "finalized_at": 1561806335,
88
+ "marked_uncollectible_at": null,
89
+ "paid_at": null,
90
+ "voided_at": null
91
+ },
82
92
  "subscription": null,
83
93
  "subtotal": 0,
84
94
  "tax": null,
@@ -8,12 +8,16 @@
8
8
  "id": "in_1BrsEhAT5SYrvIfdlmd9sZns",
9
9
  "object": "invoice",
10
10
  "amount_due": 10000,
11
- "application_fee": null,
11
+ "amount_paid": 10000,
12
+ "amount_remaining": 0,
13
+ "application_fee_amount": null,
12
14
  "attempt_count": 0,
13
15
  "attempted": true,
16
+ "auto_advance": false,
14
17
  "billing": "charge_automatically",
18
+ "billing_reason": "subscription_create",
15
19
  "charge": "ch_1BrsEhAT5SYrvIfdDOd8ifsb",
16
- "closed": true,
20
+ "collection_method": "charge_automatically",
17
21
  "currency": "dkk",
18
22
  "customer": "cus_CGNFgjPGtHlvXI",
19
23
  "date": 1517768947,
@@ -21,7 +25,8 @@
21
25
  "discount": null,
22
26
  "due_date": null,
23
27
  "ending_balance": 0,
24
- "forgiven": false,
28
+ "hosted_invoice_url": "https://pay.stripe.com/invoice/XX/invst_YY",
29
+ "invoice_pdf": "https://pay.stripe.com/invoice/XX/invst_YY/pdf",
25
30
  "lines": {
26
31
  "object": "list",
27
32
  "data": [
@@ -76,6 +81,13 @@
76
81
  "receipt_number": null,
77
82
  "starting_balance": 0,
78
83
  "statement_descriptor": null,
84
+ "status": "draft",
85
+ "status_transitions": {
86
+ "finalized_at": 1561806335,
87
+ "marked_uncollectible_at": null,
88
+ "paid_at": 1561806337,
89
+ "voided_at": null
90
+ },
79
91
  "subscription": "sub_CGP2EtRzfVystw",
80
92
  "subtotal": 10000,
81
93
  "tax": null,
@@ -101,7 +113,7 @@
101
113
  "id": "in_1BrsEhAT5SYrvIfdlmd9sZns",
102
114
  "object": "invoice",
103
115
  "amount_due": 10000,
104
- "application_fee": null,
116
+ "application_fee_amount": null,
105
117
  "attempt_count": 0,
106
118
  "attempted": true,
107
119
  "billing": "charge_automatically",
@@ -169,6 +181,13 @@
169
181
  "receipt_number": null,
170
182
  "starting_balance": 0,
171
183
  "statement_descriptor": null,
184
+ "status": "draft",
185
+ "status_transitions": {
186
+ "finalized_at": 1561806335,
187
+ "marked_uncollectible_at": null,
188
+ "paid_at": 1561806337,
189
+ "voided_at": null
190
+ },
172
191
  "subscription": "sub_CGP2EtRzfVystw",
173
192
  "subtotal": 10000,
174
193
  "tax": null,
@@ -12,12 +12,16 @@
12
12
  "id": "in_00000000000000",
13
13
  "object": "invoice",
14
14
  "amount_due": 3500,
15
- "application_fee": null,
15
+ "amount_paid": 3500,
16
+ "amount_remaining": 0,
17
+ "application_fee_amount": null,
16
18
  "attempt_count": 1,
17
19
  "attempted": true,
20
+ "auto_advance": false,
18
21
  "billing": "charge_automatically",
22
+ "billing_reason": "subscription_create",
19
23
  "charge": "ch_00000000000000",
20
- "closed": true,
24
+ "collection_method": "charge_automatically",
21
25
  "currency": "dkk",
22
26
  "customer": "cus_00000000000000",
23
27
  "date": 1517763745,
@@ -25,7 +29,6 @@
25
29
  "discount": null,
26
30
  "due_date": null,
27
31
  "ending_balance": 0,
28
- "forgiven": false,
29
32
  "lines": {
30
33
  "data": [
31
34
  {
@@ -79,6 +82,13 @@
79
82
  "receipt_number": null,
80
83
  "starting_balance": 0,
81
84
  "statement_descriptor": null,
85
+ "status": "draft",
86
+ "status_transitions": {
87
+ "finalized_at": 1561806335,
88
+ "marked_uncollectible_at": null,
89
+ "paid_at": null,
90
+ "voided_at": null
91
+ },
82
92
  "subscription": "sub_00000000000000",
83
93
  "subtotal": 3500,
84
94
  "tax": null,
@@ -12,12 +12,16 @@
12
12
  "id": null,
13
13
  "object": "invoice",
14
14
  "amount_due": 3500,
15
- "application_fee": null,
15
+ "amount_paid": 0,
16
+ "amount_remaining": 3500,
17
+ "application_fee_amount": null,
16
18
  "attempt_count": 1,
17
19
  "attempted": true,
20
+ "auto_advance": false,
18
21
  "billing": "charge_automatically",
22
+ "billing_reason": "subscription_create",
19
23
  "charge": "ch_00000000000000",
20
- "closed": true,
24
+ "collection_method": "charge_automatically",
21
25
  "currency": "dkk",
22
26
  "customer": "cus_00000000000000",
23
27
  "date": 1517763745,
@@ -25,7 +29,6 @@
25
29
  "discount": null,
26
30
  "due_date": null,
27
31
  "ending_balance": 0,
28
- "forgiven": false,
29
32
  "lines": {
30
33
  "data": [
31
34
  {
@@ -79,6 +82,13 @@
79
82
  "receipt_number": null,
80
83
  "starting_balance": 0,
81
84
  "statement_descriptor": null,
85
+ "status": "draft",
86
+ "status_transitions": {
87
+ "finalized_at": 1561806335,
88
+ "marked_uncollectible_at": null,
89
+ "paid_at": null,
90
+ "voided_at": null
91
+ },
82
92
  "subscription": "sub_00000000000000",
83
93
  "subtotal": 3500,
84
94
  "tax": null,
@@ -12,12 +12,16 @@
12
12
  "id": "in_00000000000000",
13
13
  "object": "invoice",
14
14
  "amount_due": 3500,
15
- "application_fee": null,
15
+ "amount_paid": 3500,
16
+ "amount_remaining": 0,
17
+ "application_fee_amount": null,
16
18
  "attempt_count": 1,
17
19
  "attempted": true,
20
+ "auto_advance": false,
18
21
  "billing": "charge_automatically",
22
+ "billing_reason": "subscription_create",
19
23
  "charge": "ch_00000000000000",
20
- "closed": true,
24
+ "collection_method": "charge_automatically",
21
25
  "currency": "dkk",
22
26
  "customer": "cus_00000000000000",
23
27
  "date": 1517763745,
@@ -25,7 +29,6 @@
25
29
  "discount": null,
26
30
  "due_date": null,
27
31
  "ending_balance": 0,
28
- "forgiven": false,
29
32
  "lines": {
30
33
  "data": [
31
34
  {
@@ -79,6 +82,13 @@
79
82
  "receipt_number": null,
80
83
  "starting_balance": 0,
81
84
  "statement_descriptor": null,
85
+ "status": "draft",
86
+ "status_transitions": {
87
+ "finalized_at": null,
88
+ "marked_uncollectible_at": null,
89
+ "paid_at": null,
90
+ "voided_at": null
91
+ },
82
92
  "subscription": "sub_00000000000000",
83
93
  "subtotal": 3500,
84
94
  "tax": null,
@@ -0,0 +1,152 @@
1
+ {
2
+ "id": "evt_1Gdef4mO8fmPV4sd2LN",
3
+ "object": "event",
4
+ "api_version": "2019-05-16",
5
+ "created": 1591006273,
6
+ "data": {
7
+ "object": {
8
+ "id": "in_00000000000000",
9
+ "object": "invoice",
10
+ "account_country": "DK",
11
+ "account_name": "CCC",
12
+ "amount_due": 6250,
13
+ "amount_paid": 0,
14
+ "amount_remaining": 6250,
15
+ "application_fee_amount": null,
16
+ "attempt_count": 0,
17
+ "attempted": true,
18
+ "auto_advance": false,
19
+ "billing": "charge_automatically",
20
+ "billing_reason": "subscription_create",
21
+ "charge": null,
22
+ "collection_method": "charge_automatically",
23
+ "created": 1591006261,
24
+ "currency": "eur",
25
+ "custom_fields": null,
26
+ "customer": "cus_00000000000000",
27
+ "customer_address": {
28
+ "city": "eee V",
29
+ "country": "DK",
30
+ "line1": "dddd 2",
31
+ "line2": "Street 15, 3.",
32
+ "postal_code": "1620",
33
+ "state": null
34
+ },
35
+ "customer_email": "test@example.com",
36
+ "customer_name": "Company 2",
37
+ "customer_phone": null,
38
+ "customer_shipping": null,
39
+ "customer_tax_exempt": "none",
40
+ "customer_tax_ids": [
41
+ ],
42
+ "default_payment_method": null,
43
+ "default_source": null,
44
+ "default_tax_rates": [
45
+ {
46
+ "id": "txr_1Gn1g6xwdsmO8fm1rgTtUbj",
47
+ "object": "tax_rate",
48
+ "active": true,
49
+ "created": 1590495282,
50
+ "description": null,
51
+ "display_name": "VAT",
52
+ "inclusive": false,
53
+ "jurisdiction": "Denmark",
54
+ "livemode": false,
55
+ "metadata": {
56
+ },
57
+ "percentage": 25
58
+ }
59
+ ],
60
+ "description": null,
61
+ "discount": null,
62
+ "due_date": null,
63
+ "ending_balance": 0,
64
+ "footer": null,
65
+ "hosted_invoice_url": null,
66
+ "invoice_pdf": null,
67
+ "lines": {
68
+ "data": [
69
+ {
70
+ "id": "sub_CHS7NOE0WD1Jro",
71
+ "object": "line_item",
72
+ "amount": 6000,
73
+ "currency": "dkk",
74
+ "description": "1x Manage translations for your apps (at 60.00 kr)",
75
+ "discountable": true,
76
+ "livemode": true,
77
+ "metadata": {
78
+ },
79
+ "period": {
80
+ "start": 1520430249,
81
+ "end": 1523108649
82
+ },
83
+ "plan": {
84
+ "id": "peak_flow_build",
85
+ "object": "plan",
86
+ "amount": 6000,
87
+ "created": 1517990173,
88
+ "currency": "dkk",
89
+ "interval": "month",
90
+ "interval_count": 1,
91
+ "livemode": false,
92
+ "metadata": {
93
+ },
94
+ "nickname": null,
95
+ "product": "prod_CHMVwyJFgchZEk",
96
+ "trial_period_days": null
97
+ },
98
+ "proration": false,
99
+ "quantity": 1,
100
+ "subscription": null,
101
+ "subscription_item": "si_CHS7VAL80FwJv7",
102
+ "type": "subscription"
103
+ }
104
+ ],
105
+ "has_more": false,
106
+ "object": "list",
107
+ "url": "/v1/invoices/in_1BrqsnAT5SYrvIfdQBWofPKO/lines"
108
+ },
109
+ "livemode": false,
110
+ "metadata": {
111
+ },
112
+ "next_payment_attempt": null,
113
+ "number": "a04598880b-0007",
114
+ "paid": false,
115
+ "payment_intent": "pi_1GpAbhJ3a8kmO8fmXJ4ueqDl",
116
+ "period_end": 1591006261,
117
+ "period_start": 1591006261,
118
+ "post_payment_credit_notes_amount": 0,
119
+ "pre_payment_credit_notes_amount": 0,
120
+ "receipt_number": null,
121
+ "starting_balance": 0,
122
+ "statement_descriptor": null,
123
+ "status": "void",
124
+ "status_transitions": {
125
+ "finalized_at": 1591006261,
126
+ "marked_uncollectible_at": null,
127
+ "paid_at": null,
128
+ "voided_at": 1591006273
129
+ },
130
+ "subscription": "sub_00000000000000",
131
+ "subtotal": 5000,
132
+ "tax": 1250,
133
+ "tax_percent": 25,
134
+ "total": 6250,
135
+ "total_tax_amounts": [
136
+ {
137
+ "amount": 1250,
138
+ "inclusive": false,
139
+ "tax_rate": "txr_1Gn1g6xwdsmO8fm1rgTtUbj"
140
+ }
141
+ ],
142
+ "webhooks_delivered_at": 1591006264
143
+ }
144
+ },
145
+ "livemode": false,
146
+ "pending_webhooks": 2,
147
+ "request": {
148
+ "id": "req_5MnoJ29PUuQf43",
149
+ "idempotency_key": null
150
+ },
151
+ "type": "invoice.voided"
152
+ }
@@ -11,7 +11,11 @@
11
11
  "object": {
12
12
  "id": "peak_00000000000000",
13
13
  "object": "plan",
14
+ "active": true,
15
+ "aggregate_usage": "sum",
14
16
  "amount": 6000,
17
+ "amount_decimal": "6000",
18
+ "billing_scheme": "per_unit",
15
19
  "created": 1517990173,
16
20
  "currency": "dkk",
17
21
  "interval": "month",
@@ -19,9 +23,10 @@
19
23
  "livemode": false,
20
24
  "metadata": {
21
25
  },
22
- "nickname": null,
26
+ "nickname": "number of requests",
23
27
  "product": "prod_00000000000000",
24
- "trial_period_days": null
28
+ "trial_period_days": null,
29
+ "usage_type": "metered"
25
30
  }
26
31
  }
27
32
  }
@@ -0,0 +1,37 @@
1
+ {
2
+ "created": 1326853478,
3
+ "livemode": false,
4
+ "id": "evt_00000000000000",
5
+ "type": "price.created",
6
+ "object": "event",
7
+ "request": null,
8
+ "pending_webhooks": 1,
9
+ "api_version": "2018-02-06",
10
+ "data": {
11
+ "object": {
12
+ "id": "price_00000000000000",
13
+ "object": "price",
14
+ "active": true,
15
+ "billing_scheme": "per_unit",
16
+ "created": 1608814054,
17
+ "currency": "dkk",
18
+ "livemode": false,
19
+ "lookup_key": null,
20
+ "metadata": {
21
+ },
22
+ "nickname": null,
23
+ "product": "prod_00000000000000",
24
+ "recurring": {
25
+ "aggregate_usage": null,
26
+ "interval": "month",
27
+ "interval_count": 1,
28
+ "usage_type": "licensed"
29
+ },
30
+ "tiers_mode": null,
31
+ "transform_quantity": null,
32
+ "type": "recurring",
33
+ "unit_amount": 2000,
34
+ "unit_amount_decimal": "2000"
35
+ }
36
+ }
37
+ }
@@ -0,0 +1,37 @@
1
+ {
2
+ "created": 1326853478,
3
+ "livemode": false,
4
+ "id": "evt_00000000000000",
5
+ "type": "price.deleted",
6
+ "object": "event",
7
+ "request": null,
8
+ "pending_webhooks": 1,
9
+ "api_version": "2018-02-06",
10
+ "data": {
11
+ "object": {
12
+ "id": "price_00000000000000",
13
+ "object": "price",
14
+ "active": true,
15
+ "billing_scheme": "per_unit",
16
+ "created": 1608814075,
17
+ "currency": "dkk",
18
+ "livemode": false,
19
+ "lookup_key": null,
20
+ "metadata": {
21
+ },
22
+ "nickname": null,
23
+ "product": "prod_00000000000000",
24
+ "recurring": {
25
+ "aggregate_usage": null,
26
+ "interval": "month",
27
+ "interval_count": 1,
28
+ "usage_type": "licensed"
29
+ },
30
+ "tiers_mode": null,
31
+ "transform_quantity": null,
32
+ "type": "recurring",
33
+ "unit_amount": 2000,
34
+ "unit_amount_decimal": "2000"
35
+ }
36
+ }
37
+ }
@@ -0,0 +1,40 @@
1
+ {
2
+ "created": 1326853478,
3
+ "livemode": false,
4
+ "id": "evt_00000000000000",
5
+ "type": "price.updated",
6
+ "object": "event",
7
+ "request": null,
8
+ "pending_webhooks": 1,
9
+ "api_version": "2018-02-06",
10
+ "data": {
11
+ "object": {
12
+ "id": "price_00000000000000",
13
+ "object": "price",
14
+ "active": true,
15
+ "billing_scheme": "per_unit",
16
+ "created": 1608814087,
17
+ "currency": "dkk",
18
+ "livemode": false,
19
+ "lookup_key": null,
20
+ "metadata": {
21
+ },
22
+ "nickname": null,
23
+ "product": "prod_00000000000000",
24
+ "recurring": {
25
+ "aggregate_usage": null,
26
+ "interval": "month",
27
+ "interval_count": 1,
28
+ "usage_type": "licensed"
29
+ },
30
+ "tiers_mode": null,
31
+ "transform_quantity": null,
32
+ "type": "recurring",
33
+ "unit_amount": 2000,
34
+ "unit_amount_decimal": "2000"
35
+ },
36
+ "previous_attributes": {
37
+ "name": "Old name"
38
+ }
39
+ }
40
+ }
@@ -41,6 +41,7 @@
41
41
  },
42
42
  "statement_descriptor": null,
43
43
  "type": "service",
44
+ "unit_label": "request",
44
45
  "updated": 1517762945,
45
46
  "url": null
46
47
  }
@@ -0,0 +1,81 @@
1
+ {
2
+ "id": "evt_1GhxvLJ3a8kmO8fmoOLr4v1Z",
3
+ "object": "event",
4
+ "api_version": "2019-05-16",
5
+ "created": 1589289211,
6
+ "data": {
7
+ "object": {
8
+ "id": "sub_sched_1GhwDXJ3a8kmO8fmxeer3WCy",
9
+ "object": "subscription_schedule",
10
+ "billing": "charge_automatically",
11
+ "billing_thresholds": null,
12
+ "canceled_at": 1589289211,
13
+ "collection_method": "charge_automatically",
14
+ "completed_at": null,
15
+ "created": 1589282651,
16
+ "current_phase": null,
17
+ "customer": "cus_HG9JJV3LEHUjhO",
18
+ "default_payment_method": null,
19
+ "default_settings": {
20
+ "billing_thresholds": null,
21
+ "collection_method": "charge_automatically",
22
+ "default_payment_method": null,
23
+ "default_source": null,
24
+ "invoice_settings": null
25
+ },
26
+ "default_source": null,
27
+ "end_behavior": "cancel",
28
+ "invoice_settings": null,
29
+ "livemode": false,
30
+ "metadata": {
31
+ },
32
+ "phases": [
33
+ {
34
+ "add_invoice_items": [
35
+ ],
36
+ "application_fee_percent": null,
37
+ "billing_thresholds": null,
38
+ "collection_method": "charge_automatically",
39
+ "coupon": null,
40
+ "default_payment_method": null,
41
+ "default_tax_rates": [
42
+ ],
43
+ "end_date": 1606780800,
44
+ "invoice_settings": null,
45
+ "plans": [
46
+ {
47
+ "billing_thresholds": null,
48
+ "plan": "plan_HG4dIu1k8KqRWi",
49
+ "price": "plan_HG4dIu1k8KqRWi",
50
+ "quantity": 1,
51
+ "tax_rates": [
52
+ ]
53
+ }
54
+ ],
55
+ "prorate": true,
56
+ "proration_behavior": "create_prorations",
57
+ "start_date": 1590969600,
58
+ "tax_percent": null,
59
+ "trial_end": null
60
+ }
61
+ ],
62
+ "released_at": null,
63
+ "released_subscription": null,
64
+ "renewal_behavior": "cancel",
65
+ "renewal_interval": null,
66
+ "status": "canceled",
67
+ "subscription": null
68
+ },
69
+ "previous_attributes": {
70
+ "canceled_at": null,
71
+ "status": "not_started"
72
+ }
73
+ },
74
+ "livemode": false,
75
+ "pending_webhooks": 2,
76
+ "request": {
77
+ "id": "req_FZViwblmeNHmTw",
78
+ "idempotency_key": null
79
+ },
80
+ "type": "subscription_schedule.canceled"
81
+ }