mock_chargebee 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (125) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +18 -0
  3. data/Gemfile +2 -0
  4. data/LICENSE +21 -0
  5. data/README.md +2 -0
  6. data/lib/mock_chargebee/environment.rb +13 -0
  7. data/lib/mock_chargebee/errors.rb +15 -0
  8. data/lib/mock_chargebee/fixtures/coupon.json +18 -0
  9. data/lib/mock_chargebee/fixtures/customer.json +35 -0
  10. data/lib/mock_chargebee/fixtures/subscription.json +29 -0
  11. data/lib/mock_chargebee/fixtures/subscription_cancel_response.json +140 -0
  12. data/lib/mock_chargebee/fixtures/subscription_create_response.json +138 -0
  13. data/lib/mock_chargebee/fixtures/subscription_reactivate_response.json +110 -0
  14. data/lib/mock_chargebee/fixtures/webhooks/addon_created.json +32 -0
  15. data/lib/mock_chargebee/fixtures/webhooks/addon_deleted.json +29 -0
  16. data/lib/mock_chargebee/fixtures/webhooks/addon_updated.json +32 -0
  17. data/lib/mock_chargebee/fixtures/webhooks/authorization_succeeded.json +37 -0
  18. data/lib/mock_chargebee/fixtures/webhooks/authorization_voided.json +1 -0
  19. data/lib/mock_chargebee/fixtures/webhooks/card_added.json +1 -0
  20. data/lib/mock_chargebee/fixtures/webhooks/card_deleted.json +1 -0
  21. data/lib/mock_chargebee/fixtures/webhooks/card_expired.json +1 -0
  22. data/lib/mock_chargebee/fixtures/webhooks/card_expiry_reminder.json +1 -0
  23. data/lib/mock_chargebee/fixtures/webhooks/card_updated.json +1 -0
  24. data/lib/mock_chargebee/fixtures/webhooks/coupon_codes_added.json +1 -0
  25. data/lib/mock_chargebee/fixtures/webhooks/coupon_codes_deleted.json +1 -0
  26. data/lib/mock_chargebee/fixtures/webhooks/coupon_codes_updated.json +1 -0
  27. data/lib/mock_chargebee/fixtures/webhooks/coupon_created.json +1 -0
  28. data/lib/mock_chargebee/fixtures/webhooks/coupon_deleted.json +1 -0
  29. data/lib/mock_chargebee/fixtures/webhooks/coupon_set_created.json +1 -0
  30. data/lib/mock_chargebee/fixtures/webhooks/coupon_set_deleted.json +1 -0
  31. data/lib/mock_chargebee/fixtures/webhooks/coupon_set_updated.json +1 -0
  32. data/lib/mock_chargebee/fixtures/webhooks/coupon_updated.json +1 -0
  33. data/lib/mock_chargebee/fixtures/webhooks/credit_note_created.json +1 -0
  34. data/lib/mock_chargebee/fixtures/webhooks/credit_note_deleted.json +1 -0
  35. data/lib/mock_chargebee/fixtures/webhooks/credit_note_updated.json +1 -0
  36. data/lib/mock_chargebee/fixtures/webhooks/customer_changed.json +1 -0
  37. data/lib/mock_chargebee/fixtures/webhooks/customer_created.json +1 -0
  38. data/lib/mock_chargebee/fixtures/webhooks/customer_deleted.json +1 -0
  39. data/lib/mock_chargebee/fixtures/webhooks/customer_moved_in.json +1 -0
  40. data/lib/mock_chargebee/fixtures/webhooks/customer_moved_out.json +1 -0
  41. data/lib/mock_chargebee/fixtures/webhooks/gift_cancelled.json +1 -0
  42. data/lib/mock_chargebee/fixtures/webhooks/gift_claimed.json +1 -0
  43. data/lib/mock_chargebee/fixtures/webhooks/gift_expired.json +1 -0
  44. data/lib/mock_chargebee/fixtures/webhooks/gift_scheduled.json +1 -0
  45. data/lib/mock_chargebee/fixtures/webhooks/gift_unclaimed.json +1 -0
  46. data/lib/mock_chargebee/fixtures/webhooks/invoice_deleted.json +1 -0
  47. data/lib/mock_chargebee/fixtures/webhooks/invoice_generated.json +1 -0
  48. data/lib/mock_chargebee/fixtures/webhooks/invoice_updated.json +1 -0
  49. data/lib/mock_chargebee/fixtures/webhooks/order_cancelled.json +1 -0
  50. data/lib/mock_chargebee/fixtures/webhooks/order_created.json +1 -0
  51. data/lib/mock_chargebee/fixtures/webhooks/order_delivered.json +1 -0
  52. data/lib/mock_chargebee/fixtures/webhooks/order_ready_to_process.json +1 -0
  53. data/lib/mock_chargebee/fixtures/webhooks/order_ready_to_ship.json +1 -0
  54. data/lib/mock_chargebee/fixtures/webhooks/order_returned.json +1 -0
  55. data/lib/mock_chargebee/fixtures/webhooks/order_updated.json +1 -0
  56. data/lib/mock_chargebee/fixtures/webhooks/payment_failed.json +1 -0
  57. data/lib/mock_chargebee/fixtures/webhooks/payment_initiated.json +1 -0
  58. data/lib/mock_chargebee/fixtures/webhooks/payment_intent_created.json +1 -0
  59. data/lib/mock_chargebee/fixtures/webhooks/payment_intent_updated.json +1 -0
  60. data/lib/mock_chargebee/fixtures/webhooks/payment_refunded.json +1 -0
  61. data/lib/mock_chargebee/fixtures/webhooks/payment_source_added.json +1 -0
  62. data/lib/mock_chargebee/fixtures/webhooks/payment_source_deleted.json +1 -0
  63. data/lib/mock_chargebee/fixtures/webhooks/payment_source_updated.json +1 -0
  64. data/lib/mock_chargebee/fixtures/webhooks/payment_succeeded.json +1 -0
  65. data/lib/mock_chargebee/fixtures/webhooks/pending_invoice_created.json +1 -0
  66. data/lib/mock_chargebee/fixtures/webhooks/pending_invoice_updated.json +1 -0
  67. data/lib/mock_chargebee/fixtures/webhooks/plan_created.json +37 -0
  68. data/lib/mock_chargebee/fixtures/webhooks/plan_deleted.json +1 -0
  69. data/lib/mock_chargebee/fixtures/webhooks/plan_updated.json +39 -0
  70. data/lib/mock_chargebee/fixtures/webhooks/promotional_credits_added.json +1 -0
  71. data/lib/mock_chargebee/fixtures/webhooks/promotional_credits_deducted.json +1 -0
  72. data/lib/mock_chargebee/fixtures/webhooks/refund_initiated.json +1 -0
  73. data/lib/mock_chargebee/fixtures/webhooks/subscription_activated.json +1 -0
  74. data/lib/mock_chargebee/fixtures/webhooks/subscription_cancellation_reminder.json +1 -0
  75. data/lib/mock_chargebee/fixtures/webhooks/subscription_cancellation_scheduled.json +1 -0
  76. data/lib/mock_chargebee/fixtures/webhooks/subscription_cancelled.json +1 -0
  77. data/lib/mock_chargebee/fixtures/webhooks/subscription_changed.json +1 -0
  78. data/lib/mock_chargebee/fixtures/webhooks/subscription_changes_scheduled.json +1 -0
  79. data/lib/mock_chargebee/fixtures/webhooks/subscription_created.json +1 -0
  80. data/lib/mock_chargebee/fixtures/webhooks/subscription_deleted.json +1 -0
  81. data/lib/mock_chargebee/fixtures/webhooks/subscription_pause_scheduled.json +1 -0
  82. data/lib/mock_chargebee/fixtures/webhooks/subscription_paused.json +1 -0
  83. data/lib/mock_chargebee/fixtures/webhooks/subscription_reactivated.json +1 -0
  84. data/lib/mock_chargebee/fixtures/webhooks/subscription_renewal_reminder.json +1 -0
  85. data/lib/mock_chargebee/fixtures/webhooks/subscription_renewed.json +1 -0
  86. data/lib/mock_chargebee/fixtures/webhooks/subscription_resumed.json +1 -0
  87. data/lib/mock_chargebee/fixtures/webhooks/subscription_resumption_scheduled.json +1 -0
  88. data/lib/mock_chargebee/fixtures/webhooks/subscription_scheduled_cancellation_removed.json +1 -0
  89. data/lib/mock_chargebee/fixtures/webhooks/subscription_scheduled_changes_removed.json +1 -0
  90. data/lib/mock_chargebee/fixtures/webhooks/subscription_scheduled_pause_removed.json +1 -0
  91. data/lib/mock_chargebee/fixtures/webhooks/subscription_scheduled_resumption_removed.json +1 -0
  92. data/lib/mock_chargebee/fixtures/webhooks/subscription_shipping_address_updated.json +1 -0
  93. data/lib/mock_chargebee/fixtures/webhooks/subscription_started.json +1 -0
  94. data/lib/mock_chargebee/fixtures/webhooks/subscription_trial_end_reminder.json +1 -0
  95. data/lib/mock_chargebee/fixtures/webhooks/transaction_created.json +1 -0
  96. data/lib/mock_chargebee/fixtures/webhooks/transaction_deleted.json +1 -0
  97. data/lib/mock_chargebee/fixtures/webhooks/transaction_updated.json +1 -0
  98. data/lib/mock_chargebee/fixtures/webhooks/unbilled_charges_created.json +1 -0
  99. data/lib/mock_chargebee/fixtures/webhooks/unbilled_charges_deleted.json +1 -0
  100. data/lib/mock_chargebee/fixtures/webhooks/unbilled_charges_invoiced.json +1 -0
  101. data/lib/mock_chargebee/fixtures/webhooks/unbilled_charges_voided.json +1 -0
  102. data/lib/mock_chargebee/fixtures/webhooks/virtual_bank_account_added.json +1 -0
  103. data/lib/mock_chargebee/fixtures/webhooks/virtual_bank_account_deleted.json +1 -0
  104. data/lib/mock_chargebee/fixtures/webhooks/virtual_bank_account_updated.json +1 -0
  105. data/lib/mock_chargebee/models/base.rb +24 -0
  106. data/lib/mock_chargebee/models/coupon.rb +25 -0
  107. data/lib/mock_chargebee/models/customer.rb +23 -0
  108. data/lib/mock_chargebee/models/subscription.rb +68 -0
  109. data/lib/mock_chargebee/repositories.rb +25 -0
  110. data/lib/mock_chargebee/request.rb +19 -0
  111. data/lib/mock_chargebee/request_handlers/base.rb +37 -0
  112. data/lib/mock_chargebee/request_handlers/coupons.rb +15 -0
  113. data/lib/mock_chargebee/request_handlers/customers.rb +26 -0
  114. data/lib/mock_chargebee/request_handlers/subscriptions.rb +43 -0
  115. data/lib/mock_chargebee/services/apply_coupons.rb +40 -0
  116. data/lib/mock_chargebee/util.rb +48 -0
  117. data/lib/mock_chargebee/validations/base.rb +11 -0
  118. data/lib/mock_chargebee/validations/coupons.rb +11 -0
  119. data/lib/mock_chargebee/validations/subscriptions.rb +11 -0
  120. data/lib/mock_chargebee/validations/webhooks.rb +15 -0
  121. data/lib/mock_chargebee/version.rb +5 -0
  122. data/lib/mock_chargebee/webhook.rb +26 -0
  123. data/lib/mock_chargebee.rb +43 -0
  124. data/mock_chargebee.gemspec +29 -0
  125. metadata +250 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 9ea9ad089b2df70e2e589e8cf239942cfc95b4658a5bae0b924b2ca0a9d029a9
4
+ data.tar.gz: cfabdd90e45cd358e124b05083ad159005a914433e155debf33e9fbc94e93b76
5
+ SHA512:
6
+ metadata.gz: 8e91583896f1df4e4e665efdd0bf96291c3d6156586f4dd7db950576b89adfdccc02c334d8680cdca76abbdc153ff57a6a78fc210b56aa089a9b9048ad054393
7
+ data.tar.gz: 59e6a9d614a6cdbfc39c407156a934d81929f561d04e99d8d7519822a57ef0f5b838fb9ba1c2ec1f5ee13c631011bd89261c3ae171af8dbd2b139a1f32d0cbd9
data/.gitignore ADDED
@@ -0,0 +1,18 @@
1
+ .DS_Store
2
+ .idea
3
+ *.log
4
+ tmp/
5
+ *.gem
6
+ *.rbc
7
+
8
+ ## Documentation cache and generated files:
9
+ /.yardoc/
10
+ /_yardoc/
11
+ /doc/
12
+ /rdoc/
13
+
14
+ # for a library or gem, you might want to ignore these files since the code is
15
+ # intended to run in multiple environments; otherwise, check them in:
16
+ Gemfile.lock
17
+ .ruby-version
18
+ .ruby-gemset
data/Gemfile ADDED
@@ -0,0 +1,2 @@
1
+ source "https://rubygems.org"
2
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2020 Bonusly
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,2 @@
1
+ # mock_chargebee
2
+ MockChargebee is a drop in mocking library for testing with Chargebee.
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module MockChargebee
4
+ class Environment
5
+ API_VERSION = "v2"
6
+
7
+ attr_reader :repositories
8
+
9
+ def initialize
10
+ @repositories = Repositories.new
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module MockChargebee
4
+ class MissingRequestHandler < StandardError
5
+ def initialize(resource_name)
6
+ super("MockChargebee::RequestHandlers::#{resource_name.capitalize} not found. Expected /request_handlers/#{resource_name}.rb to define it.")
7
+ end
8
+ end
9
+
10
+ class InvalidEventAttribute < StandardError
11
+ def initialize(attribute)
12
+ super("Attribute #{attribute} is not allowed on Chargebee events")
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,18 @@
1
+ {
2
+ "addon_constraint": "not_applicable",
3
+ "apply_discount_on": "not_applicable",
4
+ "apply_on": "invoice_amount",
5
+ "created_at": 1517505786,
6
+ "currency_code": "USD",
7
+ "discount_amount": 500,
8
+ "discount_type": "fixed_amount",
9
+ "duration_type": "forever",
10
+ "id": "sample_offer",
11
+ "name": "Sample Offer",
12
+ "object": "coupon",
13
+ "plan_constraint": "not_applicable",
14
+ "redemptions": 0,
15
+ "resource_version": 1517505786000,
16
+ "status": "active",
17
+ "updated_at": 1517505786
18
+ }
@@ -0,0 +1,35 @@
1
+ {
2
+ "allow_direct_debit": false,
3
+ "auto_collection": "on",
4
+ "billing_address": {
5
+ "city": "Walnut",
6
+ "country": "US",
7
+ "first_name": "John",
8
+ "last_name": "Doe",
9
+ "line1": "PO Box 9999",
10
+ "object": "billing_address",
11
+ "state": "California",
12
+ "state_code": "CA",
13
+ "validation_status": "not_validated",
14
+ "zip": "91789"
15
+ },
16
+ "card_status": "no_card",
17
+ "created_at": 1517505731,
18
+ "deleted": false,
19
+ "email": "john@test.com",
20
+ "excess_payments": 0,
21
+ "first_name": "John",
22
+ "id": "__test__KyVnHhSBWl7eY2bl",
23
+ "last_name": "Doe",
24
+ "locale": "fr-CA",
25
+ "net_term_days": 0,
26
+ "object": "customer",
27
+ "pii_cleared": "active",
28
+ "preferred_currency_code": "USD",
29
+ "promotional_credits": 0,
30
+ "refundable_credits": 0,
31
+ "resource_version": 1517505731000,
32
+ "taxability": "taxable",
33
+ "unbilled_charges": 0,
34
+ "updated_at": 1517505731
35
+ }
@@ -0,0 +1,29 @@
1
+ {
2
+ "activated_at": 1517505643,
3
+ "auto_collection": "off",
4
+ "billing_period": 1,
5
+ "billing_period_unit": "month",
6
+ "created_at": 1517505643,
7
+ "currency_code": "USD",
8
+ "current_term_end": 1519924843,
9
+ "current_term_start": 1517505643,
10
+ "customer_id": "__test__KyVnHhSBWkkwI2Tn",
11
+ "deleted": false,
12
+ "due_invoices_count": 1,
13
+ "due_since": 1517505643,
14
+ "has_scheduled_changes": false,
15
+ "id": "__test__KyVnHhSBWkkwI2Tn",
16
+ "mrr": 0,
17
+ "next_billing_at": 1519924843,
18
+ "object": "subscription",
19
+ "plan_amount": 895,
20
+ "plan_free_quantity": 0,
21
+ "plan_id": "no_trial",
22
+ "plan_quantity": 1,
23
+ "plan_unit_price": 895,
24
+ "resource_version": 1517505643000,
25
+ "started_at": 1517505643,
26
+ "status": "active",
27
+ "total_dues": 895,
28
+ "updated_at": 1517505643
29
+ }
@@ -0,0 +1,140 @@
1
+ {
2
+ "card": {
3
+ "card_type": "american_express",
4
+ "created_at": 1517505621,
5
+ "customer_id": "__test__KyVnHhSBWkf9f2RK",
6
+ "expiry_month": 2,
7
+ "expiry_year": 2022,
8
+ "funding_type": "not_known",
9
+ "gateway": "chargebee",
10
+ "gateway_account_id": "gw___test__KyVnGlSBWkdgV1e9",
11
+ "iin": "378282",
12
+ "last4": "0005",
13
+ "masked_number": "***********0005",
14
+ "object": "card",
15
+ "payment_source_id": "pm___test__KyVnHhSBWkfAz2RM",
16
+ "resource_version": 1517505621000,
17
+ "status": "valid",
18
+ "updated_at": 1517505621
19
+ },
20
+ "credit_notes": [
21
+ {
22
+ "allocations": [],
23
+ "amount_allocated": 0,
24
+ "amount_available": 895,
25
+ "amount_refunded": 0,
26
+ "base_currency_code": "USD",
27
+ "create_reason_code": "Subscription Cancellation",
28
+ "currency_code": "USD",
29
+ "customer_id": "__test__KyVnHhSBWkf9f2RK",
30
+ "date": 1517505621,
31
+ "deleted": false,
32
+ "exchange_rate": 1,
33
+ "fractional_correction": 0,
34
+ "id": "__demo_cn__1",
35
+ "line_item_discounts": [],
36
+ "line_item_taxes": [],
37
+ "line_items": [
38
+ {
39
+ "amount": 895,
40
+ "customer_id": "__test__KyVnHhSBWkf9f2RK",
41
+ "date_from": 1517505621,
42
+ "date_to": 1519924821,
43
+ "description": "No Trial - Prorated Credits for 01-Feb-2018 - 01-Mar-2018",
44
+ "discount_amount": 0,
45
+ "entity_id": "no_trial",
46
+ "entity_type": "plan",
47
+ "id": "li___test__KyVnHhSBWkfHJ2Ra",
48
+ "is_taxed": false,
49
+ "item_level_discount_amount": 0,
50
+ "object": "line_item",
51
+ "pricing_model": "per_unit",
52
+ "quantity": 1,
53
+ "subscription_id": "__test__KyVnHhSBWkf9f2RK",
54
+ "tax_amount": 0,
55
+ "tax_exempt_reason": "tax_not_configured",
56
+ "unit_amount": 895
57
+ }
58
+ ],
59
+ "linked_refunds": [],
60
+ "object": "credit_note",
61
+ "price_type": "tax_exclusive",
62
+ "reason_code": "subscription_cancellation",
63
+ "reference_invoice_id": "__demo_inv__3",
64
+ "resource_version": 1517505622000,
65
+ "round_off_amount": 0,
66
+ "status": "refund_due",
67
+ "sub_total": 895,
68
+ "subscription_id": "__test__KyVnHhSBWkf9f2RK",
69
+ "taxes": [],
70
+ "total": 895,
71
+ "type": "refundable",
72
+ "updated_at": 1517505622
73
+ }
74
+ ],
75
+ "customer": {
76
+ "allow_direct_debit": false,
77
+ "auto_collection": "on",
78
+ "balances": [
79
+ {
80
+ "balance_currency_code": "USD",
81
+ "currency_code": "USD",
82
+ "excess_payments": 0,
83
+ "object": "customer_balance",
84
+ "promotional_credits": 0,
85
+ "refundable_credits": 895,
86
+ "unbilled_charges": 0
87
+ }
88
+ ],
89
+ "card_status": "valid",
90
+ "created_at": 1517505621,
91
+ "deleted": false,
92
+ "excess_payments": 0,
93
+ "id": "__test__KyVnHhSBWkf9f2RK",
94
+ "net_term_days": 0,
95
+ "object": "customer",
96
+ "payment_method": {
97
+ "gateway": "chargebee",
98
+ "gateway_account_id": "gw___test__KyVnGlSBWkdgV1e9",
99
+ "object": "payment_method",
100
+ "reference_id": "tok___test__KyVnHhSBWkfAq2RL",
101
+ "status": "valid",
102
+ "type": "card"
103
+ },
104
+ "pii_cleared": "active",
105
+ "preferred_currency_code": "USD",
106
+ "primary_payment_source_id": "pm___test__KyVnHhSBWkfAz2RM",
107
+ "promotional_credits": 0,
108
+ "refundable_credits": 895,
109
+ "resource_version": 1517505622000,
110
+ "taxability": "taxable",
111
+ "unbilled_charges": 0,
112
+ "updated_at": 1517505622
113
+ },
114
+ "subscription": {
115
+ "activated_at": 1517505621,
116
+ "billing_period": 1,
117
+ "billing_period_unit": "month",
118
+ "cancelled_at": 1517505621,
119
+ "created_at": 1517505621,
120
+ "currency_code": "USD",
121
+ "current_term_end": 1517505621,
122
+ "current_term_start": 1517505621,
123
+ "customer_id": "__test__KyVnHhSBWkf9f2RK",
124
+ "deleted": false,
125
+ "due_invoices_count": 0,
126
+ "has_scheduled_changes": false,
127
+ "id": "__test__KyVnHhSBWkf9f2RK",
128
+ "mrr": 0,
129
+ "object": "subscription",
130
+ "plan_amount": 895,
131
+ "plan_free_quantity": 0,
132
+ "plan_id": "no_trial",
133
+ "plan_quantity": 1,
134
+ "plan_unit_price": 895,
135
+ "resource_version": 1517505622000,
136
+ "started_at": 1517505621,
137
+ "status": "cancelled",
138
+ "updated_at": 1517505622
139
+ }
140
+ }
@@ -0,0 +1,138 @@
1
+ {
2
+ "customer": {
3
+ "allow_direct_debit": false,
4
+ "auto_collection": "on",
5
+ "billing_address": {
6
+ "city": "Walnut",
7
+ "country": "US",
8
+ "first_name": "John",
9
+ "last_name": "Doe",
10
+ "line1": "PO Box 9999",
11
+ "object": "billing_address",
12
+ "state": "California",
13
+ "state_code": "CA",
14
+ "validation_status": "not_validated",
15
+ "zip": "91789"
16
+ },
17
+ "card_status": "no_card",
18
+ "created_at": 1517505643,
19
+ "deleted": false,
20
+ "email": "john@user.com",
21
+ "excess_payments": 0,
22
+ "first_name": "John",
23
+ "id": "__test__KyVnHhSBWkkwI2Tn",
24
+ "last_name": "Doe",
25
+ "net_term_days": 0,
26
+ "object": "customer",
27
+ "pii_cleared": "active",
28
+ "preferred_currency_code": "USD",
29
+ "promotional_credits": 0,
30
+ "refundable_credits": 0,
31
+ "resource_version": 1517505643000,
32
+ "taxability": "taxable",
33
+ "unbilled_charges": 0,
34
+ "updated_at": 1517505643
35
+ },
36
+ "invoice": {
37
+ "adjustment_credit_notes": [],
38
+ "amount_adjusted": 0,
39
+ "amount_due": 895,
40
+ "amount_paid": 0,
41
+ "amount_to_collect": 895,
42
+ "applied_credits": [],
43
+ "base_currency_code": "USD",
44
+ "billing_address": {
45
+ "city": "Walnut",
46
+ "country": "US",
47
+ "first_name": "John",
48
+ "last_name": "Doe",
49
+ "line1": "PO Box 9999",
50
+ "object": "billing_address",
51
+ "state": "California",
52
+ "state_code": "CA",
53
+ "validation_status": "not_validated",
54
+ "zip": "91789"
55
+ },
56
+ "credits_applied": 0,
57
+ "currency_code": "USD",
58
+ "customer_id": "__test__KyVnHhSBWkkwI2Tn",
59
+ "date": 1517505643,
60
+ "deleted": false,
61
+ "due_date": 1517505643,
62
+ "dunning_attempts": [],
63
+ "exchange_rate": 1,
64
+ "first_invoice": true,
65
+ "has_advance_charges": false,
66
+ "id": "__demo_inv__11",
67
+ "is_gifted": false,
68
+ "issued_credit_notes": [],
69
+ "line_items": [
70
+ {
71
+ "amount": 895,
72
+ "customer_id": "__test__KyVnHhSBWkkwI2Tn",
73
+ "date_from": 1517505643,
74
+ "date_to": 1519924843,
75
+ "description": "No Trial",
76
+ "discount_amount": 0,
77
+ "entity_id": "no_trial",
78
+ "entity_type": "plan",
79
+ "id": "li___test__KyVnHhSBWkkxu2Tp",
80
+ "is_taxed": false,
81
+ "item_level_discount_amount": 0,
82
+ "object": "line_item",
83
+ "pricing_model": "per_unit",
84
+ "quantity": 1,
85
+ "subscription_id": "__test__KyVnHhSBWkkwI2Tn",
86
+ "tax_amount": 0,
87
+ "tax_exempt_reason": "tax_not_configured",
88
+ "unit_amount": 895
89
+ }
90
+ ],
91
+ "linked_orders": [],
92
+ "linked_payments": [],
93
+ "net_term_days": 0,
94
+ "new_sales_amount": 895,
95
+ "object": "invoice",
96
+ "price_type": "tax_exclusive",
97
+ "recurring": true,
98
+ "resource_version": 1517505643000,
99
+ "round_off_amount": 0,
100
+ "status": "payment_due",
101
+ "sub_total": 895,
102
+ "subscription_id": "__test__KyVnHhSBWkkwI2Tn",
103
+ "tax": 0,
104
+ "term_finalized": true,
105
+ "total": 895,
106
+ "updated_at": 1517505643,
107
+ "write_off_amount": 0
108
+ },
109
+ "subscription": {
110
+ "activated_at": 1517505643,
111
+ "auto_collection": "off",
112
+ "billing_period": 1,
113
+ "billing_period_unit": "month",
114
+ "created_at": 1517505643,
115
+ "currency_code": "USD",
116
+ "current_term_end": 1519924843,
117
+ "current_term_start": 1517505643,
118
+ "customer_id": "__test__KyVnHhSBWkkwI2Tn",
119
+ "deleted": false,
120
+ "due_invoices_count": 1,
121
+ "due_since": 1517505643,
122
+ "has_scheduled_changes": false,
123
+ "id": "__test__KyVnHhSBWkkwI2Tn",
124
+ "mrr": 0,
125
+ "next_billing_at": 1519924843,
126
+ "object": "subscription",
127
+ "plan_amount": 895,
128
+ "plan_free_quantity": 0,
129
+ "plan_id": "no_trial",
130
+ "plan_quantity": 1,
131
+ "plan_unit_price": 895,
132
+ "resource_version": 1517505643000,
133
+ "started_at": 1517505643,
134
+ "status": "active",
135
+ "total_dues": 895,
136
+ "updated_at": 1517505643
137
+ }
138
+ }
@@ -0,0 +1,110 @@
1
+ {
2
+ "customer": {
3
+ "allow_direct_debit": false,
4
+ "auto_collection": "off",
5
+ "card_status": "no_card",
6
+ "created_at": 1517505669,
7
+ "deleted": false,
8
+ "excess_payments": 0,
9
+ "id": "__test__KyVnHhSBWkrVS2Wn",
10
+ "net_term_days": 0,
11
+ "object": "customer",
12
+ "pii_cleared": "active",
13
+ "preferred_currency_code": "USD",
14
+ "promotional_credits": 0,
15
+ "refundable_credits": 0,
16
+ "resource_version": 1517505669000,
17
+ "taxability": "taxable",
18
+ "unbilled_charges": 0,
19
+ "updated_at": 1517505669
20
+ },
21
+ "invoice": {
22
+ "adjustment_credit_notes": [],
23
+ "amount_adjusted": 0,
24
+ "amount_due": 895,
25
+ "amount_paid": 0,
26
+ "amount_to_collect": 895,
27
+ "applied_credits": [],
28
+ "base_currency_code": "USD",
29
+ "credits_applied": 0,
30
+ "currency_code": "USD",
31
+ "customer_id": "__test__KyVnHhSBWkrVS2Wn",
32
+ "date": 1517505669,
33
+ "deleted": false,
34
+ "due_date": 1517505669,
35
+ "dunning_attempts": [],
36
+ "exchange_rate": 1,
37
+ "first_invoice": false,
38
+ "has_advance_charges": false,
39
+ "id": "__demo_inv__23",
40
+ "is_gifted": false,
41
+ "issued_credit_notes": [],
42
+ "line_items": [
43
+ {
44
+ "amount": 895,
45
+ "customer_id": "__test__KyVnHhSBWkrVS2Wn",
46
+ "date_from": 1517505669,
47
+ "date_to": 1519924869,
48
+ "description": "No Trial",
49
+ "discount_amount": 0,
50
+ "entity_id": "no_trial",
51
+ "entity_type": "plan",
52
+ "id": "li___test__KyVnHhSBWkrbQ2Ww",
53
+ "is_taxed": false,
54
+ "item_level_discount_amount": 0,
55
+ "object": "line_item",
56
+ "pricing_model": "per_unit",
57
+ "quantity": 1,
58
+ "subscription_id": "__test__KyVnHhSBWkrVS2Wn",
59
+ "tax_amount": 0,
60
+ "tax_exempt_reason": "tax_not_configured",
61
+ "unit_amount": 895
62
+ }
63
+ ],
64
+ "linked_orders": [],
65
+ "linked_payments": [],
66
+ "net_term_days": 0,
67
+ "object": "invoice",
68
+ "price_type": "tax_exclusive",
69
+ "recurring": true,
70
+ "resource_version": 1517505669000,
71
+ "round_off_amount": 0,
72
+ "status": "payment_due",
73
+ "sub_total": 895,
74
+ "subscription_id": "__test__KyVnHhSBWkrVS2Wn",
75
+ "tax": 0,
76
+ "term_finalized": true,
77
+ "total": 895,
78
+ "updated_at": 1517505669,
79
+ "write_off_amount": 0
80
+ },
81
+ "subscription": {
82
+ "activated_at": 1517505669,
83
+ "billing_period": 1,
84
+ "billing_period_unit": "month",
85
+ "created_at": 1517505669,
86
+ "currency_code": "USD",
87
+ "current_term_end": 1519924869,
88
+ "current_term_start": 1517505669,
89
+ "customer_id": "__test__KyVnHhSBWkrVS2Wn",
90
+ "deleted": false,
91
+ "due_invoices_count": 2,
92
+ "due_since": 1517505669,
93
+ "has_scheduled_changes": false,
94
+ "id": "__test__KyVnHhSBWkrVS2Wn",
95
+ "mrr": 0,
96
+ "next_billing_at": 1519924869,
97
+ "object": "subscription",
98
+ "plan_amount": 895,
99
+ "plan_free_quantity": 0,
100
+ "plan_id": "no_trial",
101
+ "plan_quantity": 1,
102
+ "plan_unit_price": 895,
103
+ "remaining_billing_cycles": 3,
104
+ "resource_version": 1517505669000,
105
+ "started_at": 1517505669,
106
+ "status": "active",
107
+ "total_dues": 1790,
108
+ "updated_at": 1517505669
109
+ }
110
+ }
@@ -0,0 +1,32 @@
1
+ {
2
+ "id": "ev_16CHTnSAx18XW55o",
3
+ "occurred_at": 1600439999,
4
+ "source": "admin_console",
5
+ "user": "user@example.com",
6
+ "object": "event",
7
+ "api_version": "v2",
8
+ "content": {
9
+ "addon": {
10
+ "id": "rewards-prepayment",
11
+ "name": "Rewards Prepayment",
12
+ "pricing_model": "per_unit",
13
+ "charge_type": "non_recurring",
14
+ "price": 100,
15
+ "period_unit": "not_applicable",
16
+ "unit": "dollar prepaid",
17
+ "status": "active",
18
+ "enabled_in_portal": true,
19
+ "is_shippable": false,
20
+ "updated_at": 1600439999,
21
+ "resource_version": 1600439999650,
22
+ "object": "addon",
23
+ "currency_code": "USD",
24
+ "taxable": true,
25
+ "type": "quantity",
26
+ "show_description_in_invoices": false,
27
+ "show_description_in_quotes": false
28
+ }
29
+ },
30
+ "event_type": "addon_created",
31
+ "webhook_status": "not_configured"
32
+ }
@@ -0,0 +1,29 @@
1
+ {
2
+ "id": "ev_XpbG6hnQqGFm2n3O",
3
+ "occurred_at": 1341085213,
4
+ "source": "api",
5
+ "user": "full_access_key_v1",
6
+ "object": "event",
7
+ "api_version": "v2",
8
+ "content": {
9
+ "addon": {
10
+ "id": "support",
11
+ "name": "Support",
12
+ "description": "This is addon added when support is needed",
13
+ "type": "quantity",
14
+ "charge_type": "recurring",
15
+ "price": 1000,
16
+ "period": 1,
17
+ "period_unit": "month",
18
+ "status": "deleted",
19
+ "enabled_in_portal": true,
20
+ "updated_at": 1341085213,
21
+ "resource_version": 1341085213000,
22
+ "object": "addon",
23
+ "currency_code": "USD",
24
+ "taxable": true
25
+ }
26
+ },
27
+ "event_type": "addon_deleted",
28
+ "webhook_status": "not_configured"
29
+ }
@@ -0,0 +1,32 @@
1
+ {
2
+ "id": "ev_169yOTSAx20HH5s3",
3
+ "occurred_at": 1600440206,
4
+ "source": "admin_console",
5
+ "user": "user@example.com",
6
+ "object": "event",
7
+ "api_version": "v2",
8
+ "content": {
9
+ "addon": {
10
+ "id": "setup-and-training-fee",
11
+ "name": "Setup and Training Fee",
12
+ "invoice_name": "Setup and Training Fee",
13
+ "pricing_model": "flat_fee",
14
+ "charge_type": "non_recurring",
15
+ "price": 50000,
16
+ "period_unit": "not_applicable",
17
+ "status": "active",
18
+ "enabled_in_portal": true,
19
+ "is_shippable": false,
20
+ "updated_at": 1600440206,
21
+ "resource_version": 1600440206218,
22
+ "object": "addon",
23
+ "currency_code": "USD",
24
+ "taxable": true,
25
+ "type": "on_off",
26
+ "show_description_in_invoices": false,
27
+ "show_description_in_quotes": false
28
+ }
29
+ },
30
+ "event_type": "addon_updated",
31
+ "webhook_status": "not_configured"
32
+ }