maxio-advanced-billing-sdk 4.0.0 → 5.1.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 +27 -27
- data/lib/advanced_billing/controllers/api_exports_controller.rb +66 -66
- data/lib/advanced_billing/controllers/base_controller.rb +10 -10
- data/lib/advanced_billing/controllers/billing_portal_controller.rb +37 -36
- data/lib/advanced_billing/controllers/component_price_points_controller.rb +71 -71
- data/lib/advanced_billing/controllers/components_controller.rb +122 -119
- data/lib/advanced_billing/controllers/coupons_controller.rb +103 -103
- data/lib/advanced_billing/controllers/custom_fields_controller.rb +85 -85
- data/lib/advanced_billing/controllers/customers_controller.rb +52 -48
- data/lib/advanced_billing/controllers/events_based_billing_segments_controller.rb +59 -59
- data/lib/advanced_billing/controllers/events_controller.rb +19 -18
- data/lib/advanced_billing/controllers/insights_controller.rb +21 -21
- data/lib/advanced_billing/controllers/invoices_controller.rb +116 -116
- data/lib/advanced_billing/controllers/offers_controller.rb +23 -20
- data/lib/advanced_billing/controllers/payment_profiles_controller.rb +119 -116
- data/lib/advanced_billing/controllers/product_families_controller.rb +30 -30
- data/lib/advanced_billing/controllers/product_price_points_controller.rb +73 -73
- data/lib/advanced_billing/controllers/products_controller.rb +43 -43
- data/lib/advanced_billing/controllers/proforma_invoices_controller.rb +70 -70
- data/lib/advanced_billing/controllers/reason_codes_controller.rb +40 -40
- data/lib/advanced_billing/controllers/referral_codes_controller.rb +10 -9
- data/lib/advanced_billing/controllers/sales_commissions_controller.rb +16 -16
- data/lib/advanced_billing/controllers/sites_controller.rb +14 -13
- data/lib/advanced_billing/controllers/subscription_components_controller.rb +187 -178
- data/lib/advanced_billing/controllers/subscription_group_invoice_account_controller.rb +27 -27
- data/lib/advanced_billing/controllers/subscription_group_status_controller.rb +25 -25
- data/lib/advanced_billing/controllers/subscription_groups_controller.rb +63 -63
- data/lib/advanced_billing/controllers/subscription_invoice_account_controller.rb +43 -43
- data/lib/advanced_billing/controllers/subscription_notes_controller.rb +25 -21
- data/lib/advanced_billing/controllers/subscription_products_controller.rb +22 -20
- data/lib/advanced_billing/controllers/subscription_status_controller.rb +84 -84
- data/lib/advanced_billing/controllers/subscriptions_controller.rb +175 -172
- data/lib/advanced_billing/controllers/webhooks_controller.rb +51 -50
- 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/cancellation_method.rb +4 -1
- 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/list_products_filter.rb +12 -2
- 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
@@ -19,7 +19,7 @@ module AdvancedBilling
|
|
19
19
|
# be in a live state.
|
20
20
|
# @param [String] uid Required parameter: The uid of the subscription
|
21
21
|
# group
|
22
|
-
# @return [void] response from the API call
|
22
|
+
# @return [void] response from the API call.
|
23
23
|
def create_consolidated_proforma_invoice(uid)
|
24
24
|
new_api_call_builder
|
25
25
|
.request(new_request_builder(HttpMethodEnum::POST,
|
@@ -30,11 +30,11 @@ module AdvancedBilling
|
|
30
30
|
.should_encode(true))
|
31
31
|
.auth(Single.new('BasicAuth')))
|
32
32
|
.response(new_response_handler
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
33
|
+
.is_response_void(true)
|
34
|
+
.local_error_template('422',
|
35
|
+
'HTTP Response Not OK. Status code: {$statusCode}.'\
|
36
|
+
' Response: \'{$response.body}\'.',
|
37
|
+
ErrorListResponseException))
|
38
38
|
.execute
|
39
39
|
end
|
40
40
|
|
@@ -58,7 +58,7 @@ module AdvancedBilling
|
|
58
58
|
# payments data
|
59
59
|
# @param [TrueClass | FalseClass] custom_fields Optional parameter: Include
|
60
60
|
# custom fields data
|
61
|
-
# @return [ListProformaInvoicesResponse] response from the API call
|
61
|
+
# @return [ListProformaInvoicesResponse] response from the API call.
|
62
62
|
def list_subscription_group_proforma_invoices(options = {})
|
63
63
|
new_api_call_builder
|
64
64
|
.request(new_request_builder(HttpMethodEnum::GET,
|
@@ -76,11 +76,11 @@ module AdvancedBilling
|
|
76
76
|
.header_param(new_parameter('application/json', key: 'accept'))
|
77
77
|
.auth(Single.new('BasicAuth')))
|
78
78
|
.response(new_response_handler
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
79
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
80
|
+
.deserialize_into(ListProformaInvoicesResponse.method(:from_hash))
|
81
|
+
.local_error_template('404',
|
82
|
+
'Not Found:\'{$response.body}\'',
|
83
|
+
APIException))
|
84
84
|
.execute
|
85
85
|
end
|
86
86
|
|
@@ -89,7 +89,7 @@ module AdvancedBilling
|
|
89
89
|
# Proforma invoices are only available on Relationship Invoicing sites.
|
90
90
|
# @param [String] proforma_invoice_uid Required parameter: The uid of the
|
91
91
|
# proforma invoice
|
92
|
-
# @return [ProformaInvoice] response from the API call
|
92
|
+
# @return [ProformaInvoice] response from the API call.
|
93
93
|
def read_proforma_invoice(proforma_invoice_uid)
|
94
94
|
new_api_call_builder
|
95
95
|
.request(new_request_builder(HttpMethodEnum::GET,
|
@@ -101,11 +101,11 @@ module AdvancedBilling
|
|
101
101
|
.header_param(new_parameter('application/json', key: 'accept'))
|
102
102
|
.auth(Single.new('BasicAuth')))
|
103
103
|
.response(new_response_handler
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
104
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
105
|
+
.deserialize_into(ProformaInvoice.method(:from_hash))
|
106
|
+
.local_error_template('404',
|
107
|
+
'Not Found:\'{$response.body}\'',
|
108
|
+
APIException))
|
109
109
|
.execute
|
110
110
|
end
|
111
111
|
|
@@ -120,7 +120,7 @@ module AdvancedBilling
|
|
120
120
|
# not be prepaid, and must be in a live state.
|
121
121
|
# @param [Integer] subscription_id Required parameter: The Chargify id of
|
122
122
|
# the subscription
|
123
|
-
# @return [ProformaInvoice] response from the API call
|
123
|
+
# @return [ProformaInvoice] response from the API call.
|
124
124
|
def create_proforma_invoice(subscription_id)
|
125
125
|
new_api_call_builder
|
126
126
|
.request(new_request_builder(HttpMethodEnum::POST,
|
@@ -132,12 +132,12 @@ module AdvancedBilling
|
|
132
132
|
.header_param(new_parameter('application/json', key: 'accept'))
|
133
133
|
.auth(Single.new('BasicAuth')))
|
134
134
|
.response(new_response_handler
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
135
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
136
|
+
.deserialize_into(ProformaInvoice.method(:from_hash))
|
137
|
+
.local_error_template('422',
|
138
|
+
'HTTP Response Not OK. Status code: {$statusCode}.'\
|
139
|
+
' Response: \'{$response.body}\'.',
|
140
|
+
ErrorListResponseException))
|
141
141
|
.execute
|
142
142
|
end
|
143
143
|
|
@@ -179,7 +179,7 @@ module AdvancedBilling
|
|
179
179
|
# payments data
|
180
180
|
# @param [TrueClass | FalseClass] custom_fields Optional parameter: Include
|
181
181
|
# custom fields data
|
182
|
-
# @return [ListProformaInvoicesResponse] response from the API call
|
182
|
+
# @return [ListProformaInvoicesResponse] response from the API call.
|
183
183
|
def list_proforma_invoices(options = {})
|
184
184
|
new_api_call_builder
|
185
185
|
.request(new_request_builder(HttpMethodEnum::GET,
|
@@ -203,8 +203,8 @@ module AdvancedBilling
|
|
203
203
|
.header_param(new_parameter('application/json', key: 'accept'))
|
204
204
|
.auth(Single.new('BasicAuth')))
|
205
205
|
.response(new_response_handler
|
206
|
-
|
207
|
-
|
206
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
207
|
+
.deserialize_into(ListProformaInvoicesResponse.method(:from_hash)))
|
208
208
|
.execute
|
209
209
|
end
|
210
210
|
|
@@ -220,7 +220,7 @@ module AdvancedBilling
|
|
220
220
|
# @param [String] proforma_invoice_uid Required parameter: The uid of the
|
221
221
|
# proforma invoice
|
222
222
|
# @param [VoidInvoiceRequest] body Optional parameter: Example:
|
223
|
-
# @return [ProformaInvoice] response from the API call
|
223
|
+
# @return [ProformaInvoice] response from the API call.
|
224
224
|
def void_proforma_invoice(proforma_invoice_uid,
|
225
225
|
body: nil)
|
226
226
|
new_api_call_builder
|
@@ -236,15 +236,15 @@ module AdvancedBilling
|
|
236
236
|
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
237
237
|
.auth(Single.new('BasicAuth')))
|
238
238
|
.response(new_response_handler
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
239
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
240
|
+
.deserialize_into(ProformaInvoice.method(:from_hash))
|
241
|
+
.local_error_template('404',
|
242
|
+
'Not Found:\'{$response.body}\'',
|
243
|
+
APIException)
|
244
|
+
.local_error_template('422',
|
245
|
+
'HTTP Response Not OK. Status code: {$statusCode}.'\
|
246
|
+
' Response: \'{$response.body}\'.',
|
247
|
+
ErrorListResponseException))
|
248
248
|
.execute
|
249
249
|
end
|
250
250
|
|
@@ -267,7 +267,7 @@ module AdvancedBilling
|
|
267
267
|
# subscription's upcoming renewal has changed.
|
268
268
|
# @param [Integer] subscription_id Required parameter: The Chargify id of
|
269
269
|
# the subscription
|
270
|
-
# @return [ProformaInvoice] response from the API call
|
270
|
+
# @return [ProformaInvoice] response from the API call.
|
271
271
|
def preview_proforma_invoice(subscription_id)
|
272
272
|
new_api_call_builder
|
273
273
|
.request(new_request_builder(HttpMethodEnum::POST,
|
@@ -279,15 +279,15 @@ module AdvancedBilling
|
|
279
279
|
.header_param(new_parameter('application/json', key: 'accept'))
|
280
280
|
.auth(Single.new('BasicAuth')))
|
281
281
|
.response(new_response_handler
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
282
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
283
|
+
.deserialize_into(ProformaInvoice.method(:from_hash))
|
284
|
+
.local_error_template('404',
|
285
|
+
'Not Found:\'{$response.body}\'',
|
286
|
+
APIException)
|
287
|
+
.local_error_template('422',
|
288
|
+
'HTTP Response Not OK. Status code: {$statusCode}.'\
|
289
|
+
' Response: \'{$response.body}\'.',
|
290
|
+
ErrorListResponseException))
|
291
291
|
.execute
|
292
292
|
end
|
293
293
|
|
@@ -306,7 +306,7 @@ module AdvancedBilling
|
|
306
306
|
# customer_id to easily find their proforma invoices, since the
|
307
307
|
# subscription_id will always be blank.
|
308
308
|
# @param [CreateSubscriptionRequest] body Optional parameter: Example:
|
309
|
-
# @return [ProformaInvoice] response from the API call
|
309
|
+
# @return [ProformaInvoice] response from the API call.
|
310
310
|
def create_signup_proforma_invoice(body: nil)
|
311
311
|
new_api_call_builder
|
312
312
|
.request(new_request_builder(HttpMethodEnum::POST,
|
@@ -318,16 +318,16 @@ module AdvancedBilling
|
|
318
318
|
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
319
319
|
.auth(Single.new('BasicAuth')))
|
320
320
|
.response(new_response_handler
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
321
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
322
|
+
.deserialize_into(ProformaInvoice.method(:from_hash))
|
323
|
+
.local_error_template('400',
|
324
|
+
'HTTP Response Not OK. Status code: {$statusCode}.'\
|
325
|
+
' Response: \'{$response.body}\'.',
|
326
|
+
ProformaBadRequestErrorResponseException)
|
327
|
+
.local_error_template('422',
|
328
|
+
'HTTP Response Not OK. Status code: {$statusCode}.'\
|
329
|
+
' Response: \'{$response.body}\'.',
|
330
|
+
ErrorArrayMapResponseException))
|
331
331
|
.execute
|
332
332
|
end
|
333
333
|
|
@@ -348,7 +348,7 @@ module AdvancedBilling
|
|
348
348
|
# Choose to include a proforma invoice preview for the first renewal. Use in
|
349
349
|
# query `include=next_proforma_invoice`.
|
350
350
|
# @param [CreateSubscriptionRequest] body Optional parameter: Example:
|
351
|
-
# @return [SignupProformaPreviewResponse] response from the API call
|
351
|
+
# @return [SignupProformaPreviewResponse] response from the API call.
|
352
352
|
def preview_signup_proforma_invoice(include: nil,
|
353
353
|
body: nil)
|
354
354
|
new_api_call_builder
|
@@ -362,16 +362,16 @@ module AdvancedBilling
|
|
362
362
|
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
363
363
|
.auth(Single.new('BasicAuth')))
|
364
364
|
.response(new_response_handler
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
365
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
366
|
+
.deserialize_into(SignupProformaPreviewResponse.method(:from_hash))
|
367
|
+
.local_error_template('400',
|
368
|
+
'HTTP Response Not OK. Status code: {$statusCode}.'\
|
369
|
+
' Response: \'{$response.body}\'.',
|
370
|
+
ProformaBadRequestErrorResponseException)
|
371
|
+
.local_error_template('422',
|
372
|
+
'HTTP Response Not OK. Status code: {$statusCode}.'\
|
373
|
+
' Response: \'{$response.body}\'.',
|
374
|
+
ErrorArrayMapResponseException))
|
375
375
|
.execute
|
376
376
|
end
|
377
377
|
end
|
@@ -9,20 +9,20 @@ module AdvancedBilling
|
|
9
9
|
# # Reason Codes Intro
|
10
10
|
# ReasonCodes are a way to gain a high level view of why your customers are
|
11
11
|
# cancelling the subcription to your product or service.
|
12
|
-
# Add a set of churn reason codes to be displayed in-app and/or the
|
12
|
+
# Add a set of churn reason codes to be displayed in-app and/or the Maxio
|
13
13
|
# Billing Portal. As your subscribers decide to cancel their subscription,
|
14
14
|
# learn why they decided to cancel.
|
15
15
|
# ## Reason Code Documentation
|
16
|
-
# Full documentation on how Reason Codes operate within
|
17
|
-
# located under the following links.
|
16
|
+
# Full documentation on how Reason Codes operate within Advanced Billing can
|
17
|
+
# be located under the following links.
|
18
18
|
# [Churn Reason
|
19
|
-
# Codes](https://
|
20
|
-
#
|
19
|
+
# Codes](https://maxio.zendesk.com/hc/en-us/articles/24286647554701-Churn-Re
|
20
|
+
# ason-Codes)
|
21
21
|
# ## Create Reason Code
|
22
22
|
# This method gives a merchant the option to create a reason codes for a
|
23
23
|
# given Site.
|
24
24
|
# @param [CreateReasonCodeRequest] body Optional parameter: Example:
|
25
|
-
# @return [ReasonCodeResponse] response from the API call
|
25
|
+
# @return [ReasonCodeResponse] response from the API call.
|
26
26
|
def create_reason_code(body: nil)
|
27
27
|
new_api_call_builder
|
28
28
|
.request(new_request_builder(HttpMethodEnum::POST,
|
@@ -34,12 +34,12 @@ module AdvancedBilling
|
|
34
34
|
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
35
35
|
.auth(Single.new('BasicAuth')))
|
36
36
|
.response(new_response_handler
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
37
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
38
|
+
.deserialize_into(ReasonCodeResponse.method(:from_hash))
|
39
|
+
.local_error_template('422',
|
40
|
+
'HTTP Response Not OK. Status code: {$statusCode}.'\
|
41
|
+
' Response: \'{$response.body}\'.',
|
42
|
+
ErrorListResponseException))
|
43
43
|
.execute
|
44
44
|
end
|
45
45
|
|
@@ -56,7 +56,7 @@ module AdvancedBilling
|
|
56
56
|
# many records to fetch in each request. Default value is 20. The maximum
|
57
57
|
# allowed values is 200; any per_page value over 200 will be changed to 200.
|
58
58
|
# Use in query `per_page=200`.
|
59
|
-
# @return [Array[ReasonCodeResponse]] response from the API call
|
59
|
+
# @return [Array[ReasonCodeResponse]] response from the API call.
|
60
60
|
def list_reason_codes(options = {})
|
61
61
|
new_api_call_builder
|
62
62
|
.request(new_request_builder(HttpMethodEnum::GET,
|
@@ -67,17 +67,17 @@ module AdvancedBilling
|
|
67
67
|
.header_param(new_parameter('application/json', key: 'accept'))
|
68
68
|
.auth(Single.new('BasicAuth')))
|
69
69
|
.response(new_response_handler
|
70
|
-
|
71
|
-
|
72
|
-
|
70
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
71
|
+
.deserialize_into(ReasonCodeResponse.method(:from_hash))
|
72
|
+
.is_response_array(true))
|
73
73
|
.execute
|
74
74
|
end
|
75
75
|
|
76
76
|
# This method gives a merchant the option to retrieve a list of a particular
|
77
77
|
# code for a given Site by providing the unique numerical ID of the code.
|
78
|
-
# @param [Integer] reason_code_id Required parameter: The
|
79
|
-
# reason code
|
80
|
-
# @return [ReasonCodeResponse] response from the API call
|
78
|
+
# @param [Integer] reason_code_id Required parameter: The Advanced Billing
|
79
|
+
# id of the reason code
|
80
|
+
# @return [ReasonCodeResponse] response from the API call.
|
81
81
|
def read_reason_code(reason_code_id)
|
82
82
|
new_api_call_builder
|
83
83
|
.request(new_request_builder(HttpMethodEnum::GET,
|
@@ -89,20 +89,20 @@ module AdvancedBilling
|
|
89
89
|
.header_param(new_parameter('application/json', key: 'accept'))
|
90
90
|
.auth(Single.new('BasicAuth')))
|
91
91
|
.response(new_response_handler
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
92
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
93
|
+
.deserialize_into(ReasonCodeResponse.method(:from_hash))
|
94
|
+
.local_error_template('404',
|
95
|
+
'Not Found:\'{$response.body}\'',
|
96
|
+
APIException))
|
97
97
|
.execute
|
98
98
|
end
|
99
99
|
|
100
100
|
# This method gives a merchant the option to update an existing reason code
|
101
101
|
# for a given site.
|
102
|
-
# @param [Integer] reason_code_id Required parameter: The
|
103
|
-
# reason code
|
102
|
+
# @param [Integer] reason_code_id Required parameter: The Advanced Billing
|
103
|
+
# id of the reason code
|
104
104
|
# @param [UpdateReasonCodeRequest] body Optional parameter: Example:
|
105
|
-
# @return [ReasonCodeResponse] response from the API call
|
105
|
+
# @return [ReasonCodeResponse] response from the API call.
|
106
106
|
def update_reason_code(reason_code_id,
|
107
107
|
body: nil)
|
108
108
|
new_api_call_builder
|
@@ -118,20 +118,20 @@ module AdvancedBilling
|
|
118
118
|
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
119
119
|
.auth(Single.new('BasicAuth')))
|
120
120
|
.response(new_response_handler
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
121
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
122
|
+
.deserialize_into(ReasonCodeResponse.method(:from_hash))
|
123
|
+
.local_error_template('404',
|
124
|
+
'Not Found:\'{$response.body}\'',
|
125
|
+
APIException))
|
126
126
|
.execute
|
127
127
|
end
|
128
128
|
|
129
129
|
# This method gives a merchant the option to delete one reason code from the
|
130
130
|
# Churn Reason Codes. This code will be immediately removed. This action is
|
131
131
|
# not reversable.
|
132
|
-
# @param [Integer] reason_code_id Required parameter: The
|
133
|
-
# reason code
|
134
|
-
# @return [ReasonCodesJsonResponse] response from the API call
|
132
|
+
# @param [Integer] reason_code_id Required parameter: The Advanced Billing
|
133
|
+
# id of the reason code
|
134
|
+
# @return [ReasonCodesJsonResponse] response from the API call.
|
135
135
|
def delete_reason_code(reason_code_id)
|
136
136
|
new_api_call_builder
|
137
137
|
.request(new_request_builder(HttpMethodEnum::DELETE,
|
@@ -143,11 +143,11 @@ module AdvancedBilling
|
|
143
143
|
.header_param(new_parameter('application/json', key: 'accept'))
|
144
144
|
.auth(Single.new('BasicAuth')))
|
145
145
|
.response(new_response_handler
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
146
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
147
|
+
.deserialize_into(ReasonCodesJsonResponse.method(:from_hash))
|
148
|
+
.local_error_template('404',
|
149
|
+
'Not Found:\'{$response.body}\'',
|
150
|
+
APIException))
|
151
151
|
.execute
|
152
152
|
end
|
153
153
|
end
|
@@ -10,16 +10,17 @@ module AdvancedBilling
|
|
10
10
|
# within your Site. This method is useful for validating referral codes that
|
11
11
|
# are entered by a customer.
|
12
12
|
# ## Referrals Documentation
|
13
|
-
# Full documentation on how to use the referrals feature in the
|
14
|
-
# can be located
|
15
|
-
# [here](https://
|
13
|
+
# Full documentation on how to use the referrals feature in the Advanced
|
14
|
+
# Billing UI can be located
|
15
|
+
# [here](https://maxio.zendesk.com/hc/en-us/sections/24286965611405-Referral
|
16
|
+
# s).
|
16
17
|
# ## Server Response
|
17
18
|
# If the referral code is valid the status code will be `200` and the
|
18
19
|
# referral code will be returned. If the referral code is invalid, a `404`
|
19
20
|
# response will be returned.
|
20
21
|
# @param [String] code Required parameter: The referral code you are trying
|
21
22
|
# to validate
|
22
|
-
# @return [ReferralValidationResponse] response from the API call
|
23
|
+
# @return [ReferralValidationResponse] response from the API call.
|
23
24
|
def validate_referral_code(code)
|
24
25
|
new_api_call_builder
|
25
26
|
.request(new_request_builder(HttpMethodEnum::GET,
|
@@ -30,11 +31,11 @@ module AdvancedBilling
|
|
30
31
|
.header_param(new_parameter('application/json', key: 'accept'))
|
31
32
|
.auth(Single.new('BasicAuth')))
|
32
33
|
.response(new_response_handler
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
34
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
35
|
+
.deserialize_into(ReferralValidationResponse.method(:from_hash))
|
36
|
+
.local_error_template('404',
|
37
|
+
'Invalid referral code.',
|
38
|
+
SingleStringErrorResponseException))
|
38
39
|
.execute
|
39
40
|
end
|
40
41
|
end
|
@@ -20,7 +20,7 @@ module AdvancedBilling
|
|
20
20
|
# Access to the Sales Commission API endpoints is available to users with
|
21
21
|
# financial access, where the seller has the Advanced Analytics component
|
22
22
|
# enabled. For further information on getting access to Advanced Analytics
|
23
|
-
# please contact
|
23
|
+
# please contact Maxio support.
|
24
24
|
# > Note: The request is at seller level, it means `<<subdomain>>` variable
|
25
25
|
# will be replaced by `app`
|
26
26
|
# @param [String] seller_id Required parameter: The Chargify id of your
|
@@ -41,7 +41,7 @@ module AdvancedBilling
|
|
41
41
|
# set will be returned. Use in query `page=1`.
|
42
42
|
# @param [Integer] per_page Optional parameter: This parameter indicates how
|
43
43
|
# many records to fetch in each request. Default value is 100.
|
44
|
-
# @return [Array[SaleRepSettings]] response from the API call
|
44
|
+
# @return [Array[SaleRepSettings]] response from the API call.
|
45
45
|
def list_sales_commission_settings(options = {})
|
46
46
|
new_api_call_builder
|
47
47
|
.request(new_request_builder(HttpMethodEnum::GET,
|
@@ -57,9 +57,9 @@ module AdvancedBilling
|
|
57
57
|
.header_param(new_parameter('application/json', key: 'accept'))
|
58
58
|
.auth(Single.new('BasicAuth')))
|
59
59
|
.response(new_response_handler
|
60
|
-
|
61
|
-
|
62
|
-
|
60
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
61
|
+
.deserialize_into(SaleRepSettings.method(:from_hash))
|
62
|
+
.is_response_array(true))
|
63
63
|
.execute
|
64
64
|
end
|
65
65
|
|
@@ -77,7 +77,7 @@ module AdvancedBilling
|
|
77
77
|
# Access to the Sales Commission API endpoints is available to users with
|
78
78
|
# financial access, where the seller has the Advanced Analytics component
|
79
79
|
# enabled. For further information on getting access to Advanced Analytics
|
80
|
-
# please contact
|
80
|
+
# please contact Maxio support.
|
81
81
|
# > Note: The request is at seller level, it means `<<subdomain>>` variable
|
82
82
|
# will be replaced by `app`
|
83
83
|
# @param [String] seller_id Required parameter: The Chargify id of your
|
@@ -98,7 +98,7 @@ module AdvancedBilling
|
|
98
98
|
# set will be returned. Use in query `page=1`.
|
99
99
|
# @param [Integer] per_page Optional parameter: This parameter indicates how
|
100
100
|
# many records to fetch in each request. Default value is 100.
|
101
|
-
# @return [Array[ListSaleRepItem]] response from the API call
|
101
|
+
# @return [Array[ListSaleRepItem]] response from the API call.
|
102
102
|
def list_sales_reps(options = {})
|
103
103
|
new_api_call_builder
|
104
104
|
.request(new_request_builder(HttpMethodEnum::GET,
|
@@ -114,9 +114,9 @@ module AdvancedBilling
|
|
114
114
|
.header_param(new_parameter('application/json', key: 'accept'))
|
115
115
|
.auth(Single.new('BasicAuth')))
|
116
116
|
.response(new_response_handler
|
117
|
-
|
118
|
-
|
119
|
-
|
117
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
118
|
+
.deserialize_into(ListSaleRepItem.method(:from_hash))
|
119
|
+
.is_response_array(true))
|
120
120
|
.execute
|
121
121
|
end
|
122
122
|
|
@@ -134,13 +134,13 @@ module AdvancedBilling
|
|
134
134
|
# Access to the Sales Commission API endpoints is available to users with
|
135
135
|
# financial access, where the seller has the Advanced Analytics component
|
136
136
|
# enabled. For further information on getting access to Advanced Analytics
|
137
|
-
# please contact
|
137
|
+
# please contact Maxio support.
|
138
138
|
# > Note: The request is at seller level, it means `<<subdomain>>` variable
|
139
139
|
# will be replaced by `app`
|
140
140
|
# @param [String] seller_id Required parameter: The Chargify id of your
|
141
141
|
# seller account
|
142
|
-
# @param [String] sales_rep_id Required parameter: The
|
143
|
-
# rep.
|
142
|
+
# @param [String] sales_rep_id Required parameter: The Advanced Billing id
|
143
|
+
# of sales rep.
|
144
144
|
# @param [String] authorization Optional parameter: For authorization use
|
145
145
|
# user API key. See details
|
146
146
|
# [here](https://developers.chargify.com/docs/developer-docs/ZG9jOjMyNzk5NTg
|
@@ -157,7 +157,7 @@ module AdvancedBilling
|
|
157
157
|
# set will be returned. Use in query `page=1`.
|
158
158
|
# @param [Integer] per_page Optional parameter: This parameter indicates how
|
159
159
|
# many records to fetch in each request. Default value is 100.
|
160
|
-
# @return [SaleRep] response from the API call
|
160
|
+
# @return [SaleRep] response from the API call.
|
161
161
|
def read_sales_rep(seller_id,
|
162
162
|
sales_rep_id,
|
163
163
|
authorization: 'Bearer <<apiKey>>',
|
@@ -181,8 +181,8 @@ module AdvancedBilling
|
|
181
181
|
.header_param(new_parameter('application/json', key: 'accept'))
|
182
182
|
.auth(Single.new('BasicAuth')))
|
183
183
|
.response(new_response_handler
|
184
|
-
|
185
|
-
|
184
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
185
|
+
.deserialize_into(SaleRep.method(:from_hash)))
|
186
186
|
.execute
|
187
187
|
end
|
188
188
|
end
|
@@ -7,11 +7,11 @@ module AdvancedBilling
|
|
7
7
|
# SitesController
|
8
8
|
class SitesController < BaseController
|
9
9
|
# This endpoint allows you to fetch some site data.
|
10
|
-
# Full documentation on Sites in the
|
11
|
-
# [here](https://
|
10
|
+
# Full documentation on Sites in the Advanced Billing UI can be located
|
11
|
+
# [here](https://maxio.zendesk.com/hc/en-us/sections/24250550707085-Sites).
|
12
12
|
# Specifically, the [Clearing Site
|
13
|
-
# Data](https://maxio
|
14
|
-
# section is extremely relevant to this endpoint documentation.
|
13
|
+
# Data](https://maxio.zendesk.com/hc/en-us/articles/24250617028365-Clearing-
|
14
|
+
# Site-Data) section is extremely relevant to this endpoint documentation.
|
15
15
|
# #### Relationship invoicing enabled
|
16
16
|
# If site has RI enabled then you will see more settings like:
|
17
17
|
# "customer_hierarchy_enabled": true,
|
@@ -19,8 +19,9 @@ module AdvancedBilling
|
|
19
19
|
# "whopays_default_payer": "self"
|
20
20
|
# You can read more about these settings here:
|
21
21
|
# [Who Pays & Customer
|
22
|
-
# Hierarchy](https://
|
23
|
-
#
|
22
|
+
# Hierarchy](https://maxio.zendesk.com/hc/en-us/articles/24252185211533-Cust
|
23
|
+
# omer-Hierarchies-WhoPays)
|
24
|
+
# @return [SiteResponse] response from the API call.
|
24
25
|
def read_site
|
25
26
|
new_api_call_builder
|
26
27
|
.request(new_request_builder(HttpMethodEnum::GET,
|
@@ -29,8 +30,8 @@ module AdvancedBilling
|
|
29
30
|
.header_param(new_parameter('application/json', key: 'accept'))
|
30
31
|
.auth(Single.new('BasicAuth')))
|
31
32
|
.response(new_response_handler
|
32
|
-
|
33
|
-
|
33
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
34
|
+
.deserialize_into(SiteResponse.method(:from_hash)))
|
34
35
|
.execute
|
35
36
|
end
|
36
37
|
|
@@ -46,7 +47,7 @@ module AdvancedBilling
|
|
46
47
|
# `customers`: Will clear only customers and related subscriptions (leaving
|
47
48
|
# the products untouched) for the site. Revenue will also be reset to 0.
|
48
49
|
# Use in query `cleanup_scope=all`.
|
49
|
-
# @return [void] response from the API call
|
50
|
+
# @return [void] response from the API call.
|
50
51
|
def clear_site(cleanup_scope: CleanupScope::ALL)
|
51
52
|
new_api_call_builder
|
52
53
|
.request(new_request_builder(HttpMethodEnum::POST,
|
@@ -55,7 +56,7 @@ module AdvancedBilling
|
|
55
56
|
.query_param(new_parameter(cleanup_scope, key: 'cleanup_scope'))
|
56
57
|
.auth(Single.new('BasicAuth')))
|
57
58
|
.response(new_response_handler
|
58
|
-
|
59
|
+
.is_response_void(true))
|
59
60
|
.execute
|
60
61
|
end
|
61
62
|
|
@@ -71,7 +72,7 @@ module AdvancedBilling
|
|
71
72
|
# many records to fetch in each request. Default value is 20. The maximum
|
72
73
|
# allowed values is 200; any per_page value over 200 will be changed to 200.
|
73
74
|
# Use in query `per_page=200`.
|
74
|
-
# @return [ListPublicKeysResponse] response from the API call
|
75
|
+
# @return [ListPublicKeysResponse] response from the API call.
|
75
76
|
def list_chargify_js_public_keys(options = {})
|
76
77
|
new_api_call_builder
|
77
78
|
.request(new_request_builder(HttpMethodEnum::GET,
|
@@ -82,8 +83,8 @@ module AdvancedBilling
|
|
82
83
|
.header_param(new_parameter('application/json', key: 'accept'))
|
83
84
|
.auth(Single.new('BasicAuth')))
|
84
85
|
.response(new_response_handler
|
85
|
-
|
86
|
-
|
86
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
87
|
+
.deserialize_into(ListPublicKeysResponse.method(:from_hash)))
|
87
88
|
.execute
|
88
89
|
end
|
89
90
|
end
|