maxio-advanced-billing-sdk 4.0.0 → 5.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +45 -45
- data/lib/advanced_billing/configuration.rb +2 -2
- data/lib/advanced_billing/controllers/advance_invoice_controller.rb +24 -24
- data/lib/advanced_billing/controllers/api_exports_controller.rb +57 -57
- data/lib/advanced_billing/controllers/base_controller.rb +10 -10
- data/lib/advanced_billing/controllers/billing_portal_controller.rb +33 -32
- data/lib/advanced_billing/controllers/component_price_points_controller.rb +60 -60
- data/lib/advanced_billing/controllers/components_controller.rb +110 -107
- data/lib/advanced_billing/controllers/coupons_controller.rb +89 -89
- data/lib/advanced_billing/controllers/custom_fields_controller.rb +76 -76
- data/lib/advanced_billing/controllers/customers_controller.rb +45 -41
- data/lib/advanced_billing/controllers/events_based_billing_segments_controller.rb +53 -53
- data/lib/advanced_billing/controllers/events_controller.rb +16 -15
- data/lib/advanced_billing/controllers/insights_controller.rb +17 -17
- data/lib/advanced_billing/controllers/invoices_controller.rb +99 -99
- data/lib/advanced_billing/controllers/offers_controller.rb +18 -15
- data/lib/advanced_billing/controllers/payment_profiles_controller.rb +107 -104
- data/lib/advanced_billing/controllers/product_families_controller.rb +26 -26
- data/lib/advanced_billing/controllers/product_price_points_controller.rb +62 -62
- data/lib/advanced_billing/controllers/products_controller.rb +37 -37
- data/lib/advanced_billing/controllers/proforma_invoices_controller.rb +61 -61
- data/lib/advanced_billing/controllers/reason_codes_controller.rb +35 -35
- data/lib/advanced_billing/controllers/referral_codes_controller.rb +9 -8
- data/lib/advanced_billing/controllers/sales_commissions_controller.rb +13 -13
- data/lib/advanced_billing/controllers/sites_controller.rb +11 -10
- data/lib/advanced_billing/controllers/subscription_components_controller.rb +170 -161
- data/lib/advanced_billing/controllers/subscription_group_invoice_account_controller.rb +23 -23
- data/lib/advanced_billing/controllers/subscription_group_status_controller.rb +21 -21
- data/lib/advanced_billing/controllers/subscription_groups_controller.rb +54 -54
- data/lib/advanced_billing/controllers/subscription_invoice_account_controller.rb +37 -37
- data/lib/advanced_billing/controllers/subscription_notes_controller.rb +20 -16
- data/lib/advanced_billing/controllers/subscription_products_controller.rb +20 -18
- data/lib/advanced_billing/controllers/subscription_status_controller.rb +74 -74
- data/lib/advanced_billing/controllers/subscriptions_controller.rb +163 -160
- data/lib/advanced_billing/controllers/webhooks_controller.rb +45 -44
- data/lib/advanced_billing/exceptions/component_allocation_error_exception.rb +15 -15
- data/lib/advanced_billing/exceptions/component_price_point_error_exception.rb +15 -15
- data/lib/advanced_billing/exceptions/customer_error_response_exception.rb +15 -15
- data/lib/advanced_billing/exceptions/error_array_map_response_exception.rb +15 -15
- data/lib/advanced_billing/exceptions/error_list_response_exception.rb +15 -15
- data/lib/advanced_billing/exceptions/error_string_map_response_exception.rb +15 -15
- data/lib/advanced_billing/exceptions/event_based_billing_list_segments_errors_exception.rb +15 -15
- data/lib/advanced_billing/exceptions/event_based_billing_segment_errors_exception.rb +15 -15
- data/lib/advanced_billing/exceptions/event_based_billing_segment_exception.rb +15 -15
- data/lib/advanced_billing/exceptions/product_price_point_error_response_exception.rb +15 -15
- data/lib/advanced_billing/exceptions/proforma_bad_request_error_response_exception.rb +15 -15
- data/lib/advanced_billing/exceptions/refund_prepayment_base_errors_response_exception.rb +15 -15
- data/lib/advanced_billing/exceptions/single_error_response_exception.rb +15 -15
- data/lib/advanced_billing/exceptions/single_string_error_response_exception.rb +15 -15
- data/lib/advanced_billing/exceptions/subscription_add_coupon_error_exception.rb +15 -15
- data/lib/advanced_billing/exceptions/subscription_component_allocation_error_exception.rb +15 -15
- data/lib/advanced_billing/exceptions/subscription_group_create_error_response_exception.rb +15 -15
- data/lib/advanced_billing/exceptions/subscription_group_signup_error_response_exception.rb +15 -15
- data/lib/advanced_billing/exceptions/subscription_group_update_error_response_exception.rb +15 -15
- data/lib/advanced_billing/exceptions/subscription_remove_coupon_errors_exception.rb +15 -15
- data/lib/advanced_billing/exceptions/subscriptions_mrr_error_response_exception.rb +15 -15
- data/lib/advanced_billing/exceptions/too_many_management_link_requests_error_exception.rb +15 -15
- data/lib/advanced_billing/models/activate_event_based_component.rb +84 -0
- data/lib/advanced_billing/models/{current_vault.rb → all_vaults.rb} +28 -7
- data/lib/advanced_billing/models/allocation.rb +1 -0
- data/lib/advanced_billing/models/allocation_preview_item.rb +1 -0
- data/lib/advanced_billing/models/apple_pay_payment_profile.rb +232 -0
- data/lib/advanced_billing/models/apple_pay_vault.rb +20 -0
- data/lib/advanced_billing/models/bank_account_attributes.rb +2 -0
- data/lib/advanced_billing/models/bank_account_payment_profile.rb +25 -20
- data/lib/advanced_billing/models/bank_account_vault.rb +19 -9
- data/lib/advanced_billing/models/change_invoice_status_event_data.rb +6 -6
- data/lib/advanced_billing/models/component.rb +1 -0
- data/lib/advanced_billing/models/component_custom_price.rb +33 -14
- data/lib/advanced_billing/models/component_price_point_item.rb +3 -1
- data/lib/advanced_billing/models/create_component_price_point.rb +3 -1
- data/lib/advanced_billing/models/create_customer.rb +11 -1
- data/lib/advanced_billing/models/create_metafield.rb +2 -1
- data/lib/advanced_billing/models/create_or_update_product.rb +7 -4
- data/lib/advanced_billing/models/create_payment_profile.rb +1 -1
- data/lib/advanced_billing/models/create_prepaid_usage_component_price_point.rb +6 -5
- data/lib/advanced_billing/models/create_product_price_point.rb +5 -3
- data/lib/advanced_billing/models/create_subscription.rb +27 -25
- data/lib/advanced_billing/models/credit_card_payment_profile.rb +17 -16
- data/lib/advanced_billing/models/credit_card_vault.rb +117 -0
- data/lib/advanced_billing/models/credit_note.rb +2 -2
- data/lib/advanced_billing/models/customer.rb +11 -1
- data/lib/advanced_billing/models/customer_attributes.rb +12 -1
- data/lib/advanced_billing/models/ebb_component.rb +1 -0
- data/lib/advanced_billing/models/{extended_interval_unit.rb → expiration_interval_unit.rb} +4 -4
- data/lib/advanced_billing/models/full_subscription_group_response.rb +65 -50
- data/lib/advanced_billing/models/get_one_time_token_payment_profile.rb +1 -1
- data/lib/advanced_billing/models/invoice.rb +19 -9
- data/lib/advanced_billing/models/invoice_consolidation_level.rb +2 -2
- data/lib/advanced_billing/models/invoice_refund.rb +13 -1
- data/lib/advanced_billing/models/invoice_status.rb +2 -2
- data/lib/advanced_billing/models/invoice_tax.rb +29 -0
- data/lib/advanced_billing/models/invoice_tax_component_breakout.rb +101 -1
- data/lib/advanced_billing/models/issue_invoice_event_data.rb +6 -6
- data/lib/advanced_billing/models/metered_component.rb +4 -3
- data/lib/advanced_billing/models/offer_item.rb +3 -1
- data/lib/advanced_billing/models/on_off_component.rb +3 -2
- data/lib/advanced_billing/models/paid_invoice.rb +2 -2
- data/lib/advanced_billing/models/pay_pal_vault.rb +29 -0
- data/lib/advanced_billing/models/payment_profile_attributes.rb +5 -5
- data/lib/advanced_billing/models/payment_profile_response.rb +3 -3
- data/lib/advanced_billing/models/payment_type.rb +4 -1
- data/lib/advanced_billing/models/paypal_payment_profile.rb +242 -0
- data/lib/advanced_billing/models/prepaid_usage_component.rb +5 -4
- data/lib/advanced_billing/models/product.rb +2 -2
- data/lib/advanced_billing/models/product_price_point.rb +2 -2
- data/lib/advanced_billing/models/proforma_invoice.rb +6 -6
- data/lib/advanced_billing/models/quantity_based_component.rb +4 -3
- data/lib/advanced_billing/models/refund_invoice_event_data.rb +4 -4
- data/lib/advanced_billing/models/resent_invitation.rb +36 -0
- data/lib/advanced_billing/models/subscription.rb +13 -10
- data/lib/advanced_billing/models/subscription_component.rb +1 -0
- data/lib/advanced_billing/models/subscription_component_subscription.rb +26 -20
- data/lib/advanced_billing/models/subscription_custom_price.rb +5 -2
- data/lib/advanced_billing/models/subscription_group_bank_account.rb +2 -0
- data/lib/advanced_billing/models/subscription_group_credit_card.rb +1 -1
- data/lib/advanced_billing/models/subscription_group_signup_response.rb +39 -30
- data/lib/advanced_billing/models/subscription_state.rb +30 -30
- data/lib/advanced_billing/models/tax_configuration.rb +1 -2
- data/lib/advanced_billing/models/update_component_price_point.rb +3 -1
- data/lib/advanced_billing/models/update_customer.rb +12 -1
- data/lib/advanced_billing/models/update_payment_profile.rb +1 -1
- data/lib/advanced_billing/utilities/file_wrapper.rb +9 -9
- data/lib/advanced_billing/utilities/union_type_lookup.rb +17 -3
- data/lib/advanced_billing.rb +10 -4
- metadata +16 -10
@@ -13,19 +13,20 @@ module AdvancedBilling
|
|
13
13
|
# identifier for the customer from your own app, i.e. the customer’s ID.
|
14
14
|
# This allows you to retrieve a given customer via a piece of shared
|
15
15
|
# information. Alternatively, you may choose to leave `reference` blank, and
|
16
|
-
# store
|
16
|
+
# store Advanced Billing’s unique ID for the customer, which is in the `id`
|
17
17
|
# attribute.
|
18
18
|
# Full documentation on how to locate, create and edit Customers in the
|
19
|
-
#
|
20
|
-
# [here](https://
|
19
|
+
# Advanced Billing UI can be located
|
20
|
+
# [here](https://maxio.zendesk.com/hc/en-us/articles/24252190590093-Customer
|
21
|
+
# -Details).
|
21
22
|
# ## Required Country Format
|
22
|
-
#
|
23
|
+
# Advanced Billing requires that you use the ISO Standard Country codes when
|
23
24
|
# formatting country attribute of the customer.
|
24
25
|
# Countries should be formatted as 2 characters. For more information,
|
25
26
|
# please see the following wikipedia article on
|
26
27
|
# [ISO_3166-1.](http://en.wikipedia.org/wiki/ISO_3166-1#Current_codes)
|
27
28
|
# ## Required State Format
|
28
|
-
#
|
29
|
+
# Advanced Billing requires that you use the ISO Standard State codes when
|
29
30
|
# formatting state attribute of the customer.
|
30
31
|
# + US States (2 characters):
|
31
32
|
# [ISO_3166-2](https://en.wikipedia.org/wiki/ISO_3166-2:US)
|
@@ -35,11 +36,11 @@ module AdvancedBilling
|
|
35
36
|
# click on the link in the “ISO 3166-2 codes” column next to country you
|
36
37
|
# wish to populate.
|
37
38
|
# ## Locale
|
38
|
-
#
|
39
|
-
# deliver invoices in any required language.
|
39
|
+
# Advanced Billing allows you to attribute a language/region to your
|
40
|
+
# customer to deliver invoices in any required language.
|
40
41
|
# For more: [Customer
|
41
|
-
# Locale](https://
|
42
|
-
#
|
42
|
+
# Locale](https://maxio.zendesk.com/hc/en-us/articles/24286672013709-Custome
|
43
|
+
# r-Locale)
|
43
44
|
# @param [CreateCustomerRequest] body Optional parameter: Example:
|
44
45
|
# @return [CustomerResponse] response from the API call
|
45
46
|
def create_customer(body: nil)
|
@@ -53,12 +54,12 @@ module AdvancedBilling
|
|
53
54
|
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
54
55
|
.auth(Single.new('BasicAuth')))
|
55
56
|
.response(new_response_handler
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
57
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
58
|
+
.deserialize_into(CustomerResponse.method(:from_hash))
|
59
|
+
.local_error_template('422',
|
60
|
+
'HTTP Response Not OK. Status code: {$statusCode}.'\
|
61
|
+
' Response: \'{$response.body}\'.',
|
62
|
+
CustomerErrorResponseException))
|
62
63
|
.execute
|
63
64
|
end
|
64
65
|
|
@@ -68,7 +69,7 @@ module AdvancedBilling
|
|
68
69
|
# of customers that matches the search query.
|
69
70
|
# Common use cases are:
|
70
71
|
# + Search by an email
|
71
|
-
# + Search by
|
72
|
+
# + Search by an Advanced Billing ID
|
72
73
|
# + Search by an organization
|
73
74
|
# + Search by a reference value from your application
|
74
75
|
# + Search by a first or last name
|
@@ -129,15 +130,16 @@ module AdvancedBilling
|
|
129
130
|
.header_param(new_parameter('application/json', key: 'accept'))
|
130
131
|
.auth(Single.new('BasicAuth')))
|
131
132
|
.response(new_response_handler
|
132
|
-
|
133
|
-
|
134
|
-
|
133
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
134
|
+
.deserialize_into(CustomerResponse.method(:from_hash))
|
135
|
+
.is_response_array(true))
|
135
136
|
.execute
|
136
137
|
end
|
137
138
|
|
138
|
-
# This method allows to retrieve the Customer properties by
|
139
|
-
#
|
140
|
-
# @param [Integer] id Required parameter: The
|
139
|
+
# This method allows to retrieve the Customer properties by Advanced
|
140
|
+
# Billing-generated Customer ID.
|
141
|
+
# @param [Integer] id Required parameter: The Advanced Billing id of the
|
142
|
+
# customer
|
141
143
|
# @return [CustomerResponse] response from the API call
|
142
144
|
def read_customer(id)
|
143
145
|
new_api_call_builder
|
@@ -150,13 +152,14 @@ module AdvancedBilling
|
|
150
152
|
.header_param(new_parameter('application/json', key: 'accept'))
|
151
153
|
.auth(Single.new('BasicAuth')))
|
152
154
|
.response(new_response_handler
|
153
|
-
|
154
|
-
|
155
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
156
|
+
.deserialize_into(CustomerResponse.method(:from_hash)))
|
155
157
|
.execute
|
156
158
|
end
|
157
159
|
|
158
160
|
# This method allows to update the Customer.
|
159
|
-
# @param [Integer] id Required parameter: The
|
161
|
+
# @param [Integer] id Required parameter: The Advanced Billing id of the
|
162
|
+
# customer
|
160
163
|
# @param [UpdateCustomerRequest] body Optional parameter: Example:
|
161
164
|
# @return [CustomerResponse] response from the API call
|
162
165
|
def update_customer(id,
|
@@ -174,20 +177,21 @@ module AdvancedBilling
|
|
174
177
|
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
175
178
|
.auth(Single.new('BasicAuth')))
|
176
179
|
.response(new_response_handler
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
180
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
181
|
+
.deserialize_into(CustomerResponse.method(:from_hash))
|
182
|
+
.local_error_template('404',
|
183
|
+
'Not Found:\'{$response.body}\'',
|
184
|
+
APIException)
|
185
|
+
.local_error_template('422',
|
186
|
+
'HTTP Response Not OK. Status code: {$statusCode}.'\
|
187
|
+
' Response: \'{$response.body}\'.',
|
188
|
+
CustomerErrorResponseException))
|
186
189
|
.execute
|
187
190
|
end
|
188
191
|
|
189
192
|
# This method allows you to delete the Customer.
|
190
|
-
# @param [Integer] id Required parameter: The
|
193
|
+
# @param [Integer] id Required parameter: The Advanced Billing id of the
|
194
|
+
# customer
|
191
195
|
# @return [void] response from the API call
|
192
196
|
def delete_customer(id)
|
193
197
|
new_api_call_builder
|
@@ -199,7 +203,7 @@ module AdvancedBilling
|
|
199
203
|
.should_encode(true))
|
200
204
|
.auth(Single.new('BasicAuth')))
|
201
205
|
.response(new_response_handler
|
202
|
-
|
206
|
+
.is_response_void(true))
|
203
207
|
.execute
|
204
208
|
end
|
205
209
|
|
@@ -217,8 +221,8 @@ module AdvancedBilling
|
|
217
221
|
.header_param(new_parameter('application/json', key: 'accept'))
|
218
222
|
.auth(Single.new('BasicAuth')))
|
219
223
|
.response(new_response_handler
|
220
|
-
|
221
|
-
|
224
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
225
|
+
.deserialize_into(CustomerResponse.method(:from_hash)))
|
222
226
|
.execute
|
223
227
|
end
|
224
228
|
|
@@ -237,9 +241,9 @@ module AdvancedBilling
|
|
237
241
|
.header_param(new_parameter('application/json', key: 'accept'))
|
238
242
|
.auth(Single.new('BasicAuth')))
|
239
243
|
.response(new_response_handler
|
240
|
-
|
241
|
-
|
242
|
-
|
244
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
245
|
+
.deserialize_into(SubscriptionResponse.method(:from_hash))
|
246
|
+
.is_response_array(true))
|
243
247
|
.execute
|
244
248
|
end
|
245
249
|
end
|
@@ -37,15 +37,15 @@ module AdvancedBilling
|
|
37
37
|
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
38
38
|
.auth(Single.new('BasicAuth')))
|
39
39
|
.response(new_response_handler
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
40
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
41
|
+
.deserialize_into(SegmentResponse.method(:from_hash))
|
42
|
+
.local_error_template('404',
|
43
|
+
'Not Found:\'{$response.body}\'',
|
44
|
+
APIException)
|
45
|
+
.local_error_template('422',
|
46
|
+
'HTTP Response Not OK. Status code: {$statusCode}.'\
|
47
|
+
' Response: \'{$response.body}\'.',
|
48
|
+
EventBasedBillingSegmentErrorsException))
|
49
49
|
.execute
|
50
50
|
end
|
51
51
|
|
@@ -92,15 +92,15 @@ module AdvancedBilling
|
|
92
92
|
.auth(Single.new('BasicAuth'))
|
93
93
|
.array_serialization_format(ArraySerializationFormat::CSV))
|
94
94
|
.response(new_response_handler
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
95
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
96
|
+
.deserialize_into(ListSegmentsResponse.method(:from_hash))
|
97
|
+
.local_error_template('404',
|
98
|
+
'Not Found:\'{$response.body}\'',
|
99
|
+
APIException)
|
100
|
+
.local_error_template('422',
|
101
|
+
'HTTP Response Not OK. Status code: {$statusCode}.'\
|
102
|
+
' Response: \'{$response.body}\'.',
|
103
|
+
EventBasedBillingListSegmentsErrorsException))
|
104
104
|
.execute
|
105
105
|
end
|
106
106
|
|
@@ -138,15 +138,15 @@ module AdvancedBilling
|
|
138
138
|
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
139
139
|
.auth(Single.new('BasicAuth')))
|
140
140
|
.response(new_response_handler
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
141
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
142
|
+
.deserialize_into(SegmentResponse.method(:from_hash))
|
143
|
+
.local_error_template('404',
|
144
|
+
'Not Found:\'{$response.body}\'',
|
145
|
+
APIException)
|
146
|
+
.local_error_template('422',
|
147
|
+
'HTTP Response Not OK. Status code: {$statusCode}.'\
|
148
|
+
' Response: \'{$response.body}\'.',
|
149
|
+
EventBasedBillingSegmentErrorsException))
|
150
150
|
.execute
|
151
151
|
end
|
152
152
|
|
@@ -177,14 +177,14 @@ module AdvancedBilling
|
|
177
177
|
.should_encode(true))
|
178
178
|
.auth(Single.new('BasicAuth')))
|
179
179
|
.response(new_response_handler
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
180
|
+
.is_response_void(true)
|
181
|
+
.local_error_template('404',
|
182
|
+
'Not Found:\'{$response.body}\'',
|
183
|
+
APIException)
|
184
|
+
.local_error_template('422',
|
185
|
+
'HTTP Response Not OK. Status code: {$statusCode}.'\
|
186
|
+
' Response: \'{$response.body}\'.',
|
187
|
+
APIException))
|
188
188
|
.execute
|
189
189
|
end
|
190
190
|
|
@@ -221,15 +221,15 @@ module AdvancedBilling
|
|
221
221
|
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
222
222
|
.auth(Single.new('BasicAuth')))
|
223
223
|
.response(new_response_handler
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
224
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
225
|
+
.deserialize_into(ListSegmentsResponse.method(:from_hash))
|
226
|
+
.local_error_template('404',
|
227
|
+
'Not Found:\'{$response.body}\'',
|
228
|
+
APIException)
|
229
|
+
.local_error_template('422',
|
230
|
+
'HTTP Response Not OK. Status code: {$statusCode}.'\
|
231
|
+
' Response: \'{$response.body}\'.',
|
232
|
+
EventBasedBillingSegmentException))
|
233
233
|
.execute
|
234
234
|
end
|
235
235
|
|
@@ -266,15 +266,15 @@ module AdvancedBilling
|
|
266
266
|
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
267
267
|
.auth(Single.new('BasicAuth')))
|
268
268
|
.response(new_response_handler
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
269
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
270
|
+
.deserialize_into(ListSegmentsResponse.method(:from_hash))
|
271
|
+
.local_error_template('404',
|
272
|
+
'Not Found:\'{$response.body}\'',
|
273
|
+
APIException)
|
274
|
+
.local_error_template('422',
|
275
|
+
'HTTP Response Not OK. Status code: {$statusCode}.'\
|
276
|
+
' Response: \'{$response.body}\'.',
|
277
|
+
EventBasedBillingSegmentException))
|
278
278
|
.execute
|
279
279
|
end
|
280
280
|
end
|
@@ -7,13 +7,14 @@ module AdvancedBilling
|
|
7
7
|
# EventsController
|
8
8
|
class EventsController < BaseController
|
9
9
|
# ## Events Intro
|
10
|
-
#
|
11
|
-
# information is **especially** useful to track down issues that
|
12
|
-
# subscriptions are not created due to errors.
|
13
|
-
# Within the
|
14
|
-
# documentation on how to record view Events / Site Activty
|
15
|
-
# UI can be located
|
16
|
-
# [here](https://
|
10
|
+
# Advanced Billing Events include various activity that happens around a
|
11
|
+
# Site. This information is **especially** useful to track down issues that
|
12
|
+
# arise when subscriptions are not created due to errors.
|
13
|
+
# Within the Advanced Billing UI, "Events" are referred to as "Site
|
14
|
+
# Activity". Full documentation on how to record view Events / Site Activty
|
15
|
+
# in the Advanced Billing UI can be located
|
16
|
+
# [here](https://maxio.zendesk.com/hc/en-us/articles/24250671733517-Site-Act
|
17
|
+
# ivity).
|
17
18
|
# ## List Events for a Site
|
18
19
|
# This method will retrieve a list of events for a site. Use query string
|
19
20
|
# filters to narrow down results. You may use the `key` filter as part of
|
@@ -126,9 +127,9 @@ module AdvancedBilling
|
|
126
127
|
.auth(Single.new('BasicAuth'))
|
127
128
|
.array_serialization_format(ArraySerializationFormat::CSV))
|
128
129
|
.response(new_response_handler
|
129
|
-
|
130
|
-
|
131
|
-
|
130
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
131
|
+
.deserialize_into(EventResponse.method(:from_hash))
|
132
|
+
.is_response_array(true))
|
132
133
|
.execute
|
133
134
|
end
|
134
135
|
|
@@ -175,9 +176,9 @@ module AdvancedBilling
|
|
175
176
|
.auth(Single.new('BasicAuth'))
|
176
177
|
.array_serialization_format(ArraySerializationFormat::CSV))
|
177
178
|
.response(new_response_handler
|
178
|
-
|
179
|
-
|
180
|
-
|
179
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
180
|
+
.deserialize_into(EventResponse.method(:from_hash))
|
181
|
+
.is_response_array(true))
|
181
182
|
.execute
|
182
183
|
end
|
183
184
|
|
@@ -218,8 +219,8 @@ module AdvancedBilling
|
|
218
219
|
.auth(Single.new('BasicAuth'))
|
219
220
|
.array_serialization_format(ArraySerializationFormat::CSV))
|
220
221
|
.response(new_response_handler
|
221
|
-
|
222
|
-
|
222
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
223
|
+
.deserialize_into(CountResponse.method(:from_hash)))
|
223
224
|
.execute
|
224
225
|
end
|
225
226
|
end
|
@@ -24,8 +24,8 @@ module AdvancedBilling
|
|
24
24
|
.header_param(new_parameter('application/json', key: 'accept'))
|
25
25
|
.auth(Single.new('BasicAuth')))
|
26
26
|
.response(new_response_handler
|
27
|
-
|
28
|
-
|
27
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
28
|
+
.deserialize_into(SiteSummary.method(:from_hash)))
|
29
29
|
.execute
|
30
30
|
end
|
31
31
|
|
@@ -48,16 +48,16 @@ module AdvancedBilling
|
|
48
48
|
.header_param(new_parameter('application/json', key: 'accept'))
|
49
49
|
.auth(Single.new('BasicAuth')))
|
50
50
|
.response(new_response_handler
|
51
|
-
|
52
|
-
|
51
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
52
|
+
.deserialize_into(MRRResponse.method(:from_hash)))
|
53
53
|
.execute
|
54
54
|
end
|
55
55
|
|
56
56
|
# This endpoint returns your site's MRR movements.
|
57
57
|
# ## Understanding MRR movements
|
58
58
|
# This endpoint will aid in accessing your site's [MRR
|
59
|
-
# Report](https://
|
60
|
-
# data.
|
59
|
+
# Report](https://maxio.zendesk.com/hc/en-us/articles/24285894587021-MRR-Ana
|
60
|
+
# lytics) data.
|
61
61
|
# Whenever a subscription event occurs that causes your site's MRR to change
|
62
62
|
# (such as a signup or upgrade), we record an MRR movement. These records
|
63
63
|
# are accessible via the MRR Movements endpoint.
|
@@ -66,9 +66,9 @@ module AdvancedBilling
|
|
66
66
|
# configuration at the time of the movement.
|
67
67
|
# ### Plan & Usage Breakouts
|
68
68
|
# In the MRR Report UI, we support a setting to [include or
|
69
|
-
# exclude](https://
|
70
|
-
#
|
71
|
-
# APIs, responses include `plan` and `usage` breakouts.
|
69
|
+
# exclude](https://maxio.zendesk.com/hc/en-us/articles/24285894587021-MRR-An
|
70
|
+
# alytics#displaying-component-based-metered-usage-in-mrr) usage revenue. In
|
71
|
+
# the MRR APIs, responses include `plan` and `usage` breakouts.
|
72
72
|
# Plan includes revenue from:
|
73
73
|
# * Products
|
74
74
|
# * Quantity-Based Components
|
@@ -105,8 +105,8 @@ module AdvancedBilling
|
|
105
105
|
.header_param(new_parameter('application/json', key: 'accept'))
|
106
106
|
.auth(Single.new('BasicAuth')))
|
107
107
|
.response(new_response_handler
|
108
|
-
|
109
|
-
|
108
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
109
|
+
.deserialize_into(ListMRRResponse.method(:from_hash)))
|
110
110
|
.execute
|
111
111
|
end
|
112
112
|
|
@@ -148,12 +148,12 @@ module AdvancedBilling
|
|
148
148
|
.auth(Single.new('BasicAuth'))
|
149
149
|
.array_serialization_format(ArraySerializationFormat::CSV))
|
150
150
|
.response(new_response_handler
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
151
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
152
|
+
.deserialize_into(SubscriptionMRRResponse.method(:from_hash))
|
153
|
+
.local_error_template('400',
|
154
|
+
'HTTP Response Not OK. Status code: {$statusCode}.'\
|
155
|
+
' Response: \'{$response.body}\'.',
|
156
|
+
SubscriptionsMrrErrorResponseException))
|
157
157
|
.execute
|
158
158
|
end
|
159
159
|
end
|