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
@@ -30,12 +30,12 @@ module AdvancedBilling
|
|
30
30
|
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
31
31
|
.auth(Single.new('BasicAuth')))
|
32
32
|
.response(new_response_handler
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
33
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
34
|
+
.deserialize_into(SubscriptionGroupPrepaymentResponse.method(:from_hash))
|
35
|
+
.local_error_template('422',
|
36
|
+
'HTTP Response Not OK. Status code: {$statusCode}.'\
|
37
|
+
' Response: \'{$response.body}\'.',
|
38
|
+
ErrorListResponseException))
|
39
39
|
.execute
|
40
40
|
end
|
41
41
|
|
@@ -71,11 +71,11 @@ module AdvancedBilling
|
|
71
71
|
.auth(Single.new('BasicAuth'))
|
72
72
|
.array_serialization_format(ArraySerializationFormat::CSV))
|
73
73
|
.response(new_response_handler
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
74
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
75
|
+
.deserialize_into(ListSubscriptionGroupPrepaymentResponse.method(:from_hash))
|
76
|
+
.local_error_template('404',
|
77
|
+
'Not Found:\'{$response.body}\'',
|
78
|
+
APIException))
|
79
79
|
.execute
|
80
80
|
end
|
81
81
|
|
@@ -102,12 +102,12 @@ module AdvancedBilling
|
|
102
102
|
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
103
103
|
.auth(Single.new('BasicAuth')))
|
104
104
|
.response(new_response_handler
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
105
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
106
|
+
.deserialize_into(ServiceCreditResponse.method(:from_hash))
|
107
|
+
.local_error_template('422',
|
108
|
+
'HTTP Response Not OK. Status code: {$statusCode}.'\
|
109
|
+
' Response: \'{$response.body}\'.',
|
110
|
+
ErrorListResponseException))
|
111
111
|
.execute
|
112
112
|
end
|
113
113
|
|
@@ -133,12 +133,12 @@ module AdvancedBilling
|
|
133
133
|
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
134
134
|
.auth(Single.new('BasicAuth')))
|
135
135
|
.response(new_response_handler
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
136
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
137
|
+
.deserialize_into(ServiceCredit.method(:from_hash))
|
138
|
+
.local_error_template('422',
|
139
|
+
'HTTP Response Not OK. Status code: {$statusCode}.'\
|
140
|
+
' Response: \'{$response.body}\'.',
|
141
|
+
ErrorListResponseException))
|
142
142
|
.execute
|
143
143
|
end
|
144
144
|
end
|
@@ -33,11 +33,11 @@ module AdvancedBilling
|
|
33
33
|
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
34
34
|
.auth(Single.new('BasicAuth')))
|
35
35
|
.response(new_response_handler
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
36
|
+
.is_response_void(true)
|
37
|
+
.local_error_template('422',
|
38
|
+
'HTTP Response Not OK. Status code: {$statusCode}.'\
|
39
|
+
' Response: \'{$response.body}\'.',
|
40
|
+
ErrorListResponseException))
|
41
41
|
.execute
|
42
42
|
end
|
43
43
|
|
@@ -59,11 +59,11 @@ module AdvancedBilling
|
|
59
59
|
.should_encode(true))
|
60
60
|
.auth(Single.new('BasicAuth')))
|
61
61
|
.response(new_response_handler
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
62
|
+
.is_response_void(true)
|
63
|
+
.local_error_template('422',
|
64
|
+
'HTTP Response Not OK. Status code: {$statusCode}.'\
|
65
|
+
' Response: \'{$response.body}\'.',
|
66
|
+
ErrorListResponseException))
|
67
67
|
.execute
|
68
68
|
end
|
69
69
|
|
@@ -84,11 +84,11 @@ module AdvancedBilling
|
|
84
84
|
.should_encode(true))
|
85
85
|
.auth(Single.new('BasicAuth')))
|
86
86
|
.response(new_response_handler
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
87
|
+
.is_response_void(true)
|
88
|
+
.local_error_template('422',
|
89
|
+
'HTTP Response Not OK. Status code: {$statusCode}.'\
|
90
|
+
' Response: \'{$response.body}\'.',
|
91
|
+
ErrorListResponseException))
|
92
92
|
.execute
|
93
93
|
end
|
94
94
|
|
@@ -145,12 +145,12 @@ module AdvancedBilling
|
|
145
145
|
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
146
146
|
.auth(Single.new('BasicAuth')))
|
147
147
|
.response(new_response_handler
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
148
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
149
|
+
.deserialize_into(ReactivateSubscriptionGroupResponse.method(:from_hash))
|
150
|
+
.local_error_template('422',
|
151
|
+
'HTTP Response Not OK. Status code: {$statusCode}.'\
|
152
|
+
' Response: \'{$response.body}\'.',
|
153
|
+
ErrorListResponseException))
|
154
154
|
.execute
|
155
155
|
end
|
156
156
|
end
|
@@ -31,12 +31,12 @@ module AdvancedBilling
|
|
31
31
|
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
32
32
|
.auth(Single.new('BasicAuth')))
|
33
33
|
.response(new_response_handler
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
34
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
35
|
+
.deserialize_into(SubscriptionGroupSignupResponse.method(:from_hash))
|
36
|
+
.local_error_template('422',
|
37
|
+
'HTTP Response Not OK. Status code: {$statusCode}.'\
|
38
|
+
' Response: \'{$response.body}\'.',
|
39
|
+
SubscriptionGroupSignupErrorResponseException))
|
40
40
|
.execute
|
41
41
|
end
|
42
42
|
|
@@ -55,12 +55,12 @@ module AdvancedBilling
|
|
55
55
|
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
56
56
|
.auth(Single.new('BasicAuth')))
|
57
57
|
.response(new_response_handler
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
58
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
59
|
+
.deserialize_into(SubscriptionGroupResponse.method(:from_hash))
|
60
|
+
.local_error_template('422',
|
61
|
+
'HTTP Response Not OK. Status code: {$statusCode}.'\
|
62
|
+
' Response: \'{$response.body}\'.',
|
63
|
+
SubscriptionGroupCreateErrorResponseException))
|
64
64
|
.execute
|
65
65
|
end
|
66
66
|
|
@@ -98,8 +98,8 @@ module AdvancedBilling
|
|
98
98
|
.auth(Single.new('BasicAuth'))
|
99
99
|
.array_serialization_format(ArraySerializationFormat::UN_INDEXED))
|
100
100
|
.response(new_response_handler
|
101
|
-
|
102
|
-
|
101
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
102
|
+
.deserialize_into(ListSubscriptionGroupsResponse.method(:from_hash)))
|
103
103
|
.execute
|
104
104
|
end
|
105
105
|
|
@@ -129,8 +129,8 @@ module AdvancedBilling
|
|
129
129
|
.auth(Single.new('BasicAuth'))
|
130
130
|
.array_serialization_format(ArraySerializationFormat::UN_INDEXED))
|
131
131
|
.response(new_response_handler
|
132
|
-
|
133
|
-
|
132
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
133
|
+
.deserialize_into(FullSubscriptionGroupResponse.method(:from_hash)))
|
134
134
|
.execute
|
135
135
|
end
|
136
136
|
|
@@ -159,12 +159,12 @@ module AdvancedBilling
|
|
159
159
|
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
160
160
|
.auth(Single.new('BasicAuth')))
|
161
161
|
.response(new_response_handler
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
162
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
163
|
+
.deserialize_into(SubscriptionGroupResponse.method(:from_hash))
|
164
|
+
.local_error_template('422',
|
165
|
+
'HTTP Response Not OK. Status code: {$statusCode}.'\
|
166
|
+
' Response: \'{$response.body}\'.',
|
167
|
+
SubscriptionGroupUpdateErrorResponseException))
|
168
168
|
.execute
|
169
169
|
end
|
170
170
|
|
@@ -184,18 +184,18 @@ module AdvancedBilling
|
|
184
184
|
.header_param(new_parameter('application/json', key: 'accept'))
|
185
185
|
.auth(Single.new('BasicAuth')))
|
186
186
|
.response(new_response_handler
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
187
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
188
|
+
.deserialize_into(DeleteSubscriptionGroupResponse.method(:from_hash))
|
189
|
+
.local_error_template('404',
|
190
|
+
'Not Found:\'{$response.body}\'',
|
191
|
+
APIException))
|
192
192
|
.execute
|
193
193
|
end
|
194
194
|
|
195
195
|
# Use this endpoint to find subscription group associated with subscription.
|
196
196
|
# If the subscription is not in a group endpoint will return 404 code.
|
197
|
-
# @param [String] subscription_id Required parameter: The
|
198
|
-
# subscription associated with the subscription group
|
197
|
+
# @param [String] subscription_id Required parameter: The Advanced Billing
|
198
|
+
# id of the subscription associated with the subscription group
|
199
199
|
# @return [FullSubscriptionGroupResponse] response from the API call
|
200
200
|
def find_subscription_group(subscription_id)
|
201
201
|
new_api_call_builder
|
@@ -207,20 +207,20 @@ module AdvancedBilling
|
|
207
207
|
.header_param(new_parameter('application/json', key: 'accept'))
|
208
208
|
.auth(Single.new('BasicAuth')))
|
209
209
|
.response(new_response_handler
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
210
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
211
|
+
.deserialize_into(FullSubscriptionGroupResponse.method(:from_hash))
|
212
|
+
.local_error_template('404',
|
213
|
+
'Not Found:\'{$response.body}\'',
|
214
|
+
APIException))
|
215
215
|
.execute
|
216
216
|
end
|
217
217
|
|
218
218
|
# For sites making use of the [Relationship
|
219
|
-
# Billing](https://
|
220
|
-
# [Customer
|
221
|
-
# Hierarchy](https://
|
222
|
-
# features, it is possible to
|
223
|
-
# groups.
|
219
|
+
# Billing](https://maxio.zendesk.com/hc/en-us/articles/24252287829645-Advanc
|
220
|
+
# ed-Billing-Invoices-Overview) and [Customer
|
221
|
+
# Hierarchy](https://maxio.zendesk.com/hc/en-us/articles/24252185211533-Cust
|
222
|
+
# omer-Hierarchies-WhoPays#customer-hierarchies) features, it is possible to
|
223
|
+
# add existing subscriptions to subscription groups.
|
224
224
|
# Passing `group` parameters with a `target` containing a `type` and
|
225
225
|
# optional `id` is all that's needed. When the `target` parameter specifies
|
226
226
|
# a `"customer"` or `"subscription"` that is already part of a hierarchy,
|
@@ -264,17 +264,17 @@ module AdvancedBilling
|
|
264
264
|
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
265
265
|
.auth(Single.new('BasicAuth')))
|
266
266
|
.response(new_response_handler
|
267
|
-
|
268
|
-
|
267
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
268
|
+
.deserialize_into(SubscriptionGroupResponse.method(:from_hash)))
|
269
269
|
.execute
|
270
270
|
end
|
271
271
|
|
272
272
|
# For sites making use of the [Relationship
|
273
|
-
# Billing](https://
|
274
|
-
# [Customer
|
275
|
-
# Hierarchy](https://
|
276
|
-
# features, it is possible to
|
277
|
-
# group.
|
273
|
+
# Billing](https://maxio.zendesk.com/hc/en-us/articles/24252287829645-Advanc
|
274
|
+
# ed-Billing-Invoices-Overview) and [Customer
|
275
|
+
# Hierarchy](https://maxio.zendesk.com/hc/en-us/articles/24252185211533-Cust
|
276
|
+
# omer-Hierarchies-WhoPays#customer-hierarchies) features, it is possible to
|
277
|
+
# remove existing subscription from subscription group.
|
278
278
|
# @param [Integer] subscription_id Required parameter: The Chargify id of
|
279
279
|
# the subscription
|
280
280
|
# @return [void] response from the API call
|
@@ -288,14 +288,14 @@ module AdvancedBilling
|
|
288
288
|
.should_encode(true))
|
289
289
|
.auth(Single.new('BasicAuth')))
|
290
290
|
.response(new_response_handler
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
291
|
+
.is_response_void(true)
|
292
|
+
.local_error_template('404',
|
293
|
+
'Not Found:\'{$response.body}\'',
|
294
|
+
APIException)
|
295
|
+
.local_error_template('422',
|
296
|
+
'HTTP Response Not OK. Status code: {$statusCode}.'\
|
297
|
+
' Response: \'{$response.body}\'.',
|
298
|
+
ErrorListResponseException))
|
299
299
|
.execute
|
300
300
|
end
|
301
301
|
end
|
@@ -23,8 +23,8 @@ module AdvancedBilling
|
|
23
23
|
.header_param(new_parameter('application/json', key: 'accept'))
|
24
24
|
.auth(Single.new('BasicAuth')))
|
25
25
|
.response(new_response_handler
|
26
|
-
|
27
|
-
|
26
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
27
|
+
.deserialize_into(AccountBalances.method(:from_hash)))
|
28
28
|
.execute
|
29
29
|
end
|
30
30
|
|
@@ -55,12 +55,12 @@ module AdvancedBilling
|
|
55
55
|
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
56
56
|
.auth(Single.new('BasicAuth')))
|
57
57
|
.response(new_response_handler
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
58
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
59
|
+
.deserialize_into(CreatePrepaymentResponse.method(:from_hash))
|
60
|
+
.local_error_template('422',
|
61
|
+
'HTTP Response Not OK. Status code: {$statusCode}.'\
|
62
|
+
' Response: \'{$response.body}\'.',
|
63
|
+
APIException))
|
64
64
|
.execute
|
65
65
|
end
|
66
66
|
|
@@ -96,11 +96,11 @@ module AdvancedBilling
|
|
96
96
|
.auth(Single.new('BasicAuth'))
|
97
97
|
.array_serialization_format(ArraySerializationFormat::CSV))
|
98
98
|
.response(new_response_handler
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
99
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
100
|
+
.deserialize_into(PrepaymentsResponse.method(:from_hash))
|
101
|
+
.local_error_template('404',
|
102
|
+
'Not Found:\'{$response.body}\'',
|
103
|
+
APIException))
|
104
104
|
.execute
|
105
105
|
end
|
106
106
|
|
@@ -126,12 +126,12 @@ module AdvancedBilling
|
|
126
126
|
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
127
127
|
.auth(Single.new('BasicAuth')))
|
128
128
|
.response(new_response_handler
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
129
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
130
|
+
.deserialize_into(ServiceCredit.method(:from_hash))
|
131
|
+
.local_error_template('422',
|
132
|
+
'HTTP Response Not OK. Status code: {$statusCode}.'\
|
133
|
+
' Response: \'{$response.body}\'.',
|
134
|
+
APIException))
|
135
135
|
.execute
|
136
136
|
end
|
137
137
|
|
@@ -156,11 +156,11 @@ module AdvancedBilling
|
|
156
156
|
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
157
157
|
.auth(Single.new('BasicAuth')))
|
158
158
|
.response(new_response_handler
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
159
|
+
.is_response_void(true)
|
160
|
+
.local_error_template('422',
|
161
|
+
'HTTP Response Not OK. Status code: {$statusCode}.'\
|
162
|
+
' Response: \'{$response.body}\'.',
|
163
|
+
APIException))
|
164
164
|
.execute
|
165
165
|
end
|
166
166
|
|
@@ -194,19 +194,19 @@ module AdvancedBilling
|
|
194
194
|
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
195
195
|
.auth(Single.new('BasicAuth')))
|
196
196
|
.response(new_response_handler
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
197
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
198
|
+
.deserialize_into(PrepaymentResponse.method(:from_hash))
|
199
|
+
.local_error_template('404',
|
200
|
+
'Not Found:\'{$response.body}\'',
|
201
|
+
APIException)
|
202
|
+
.local_error_template('400',
|
203
|
+
'HTTP Response Not OK. Status code: {$statusCode}.'\
|
204
|
+
' Response: \'{$response.body}\'.',
|
205
|
+
RefundPrepaymentBaseErrorsResponseException)
|
206
|
+
.local_error_template('422',
|
207
|
+
'HTTP Response Not OK. Status code: {$statusCode}.'\
|
208
|
+
' Response: \'{$response.body}\'.',
|
209
|
+
APIException))
|
210
210
|
.execute
|
211
211
|
end
|
212
212
|
end
|
@@ -12,9 +12,10 @@ module AdvancedBilling
|
|
12
12
|
# free text format.
|
13
13
|
# If you have structured data such as birth date, color, etc., consider
|
14
14
|
# using Metadata instead.
|
15
|
-
# Full documentation on how to use Notes in the
|
16
|
-
#
|
17
|
-
#
|
15
|
+
# Full documentation on how to use Notes in the Advanced Billing UI can be
|
16
|
+
# located
|
17
|
+
# [here](https://maxio.zendesk.com/hc/en-us/articles/24251712214413-Subscrip
|
18
|
+
# tion-Summary-Overview).
|
18
19
|
# @param [Integer] subscription_id Required parameter: The Chargify id of
|
19
20
|
# the subscription
|
20
21
|
# @param [UpdateSubscriptionNoteRequest] body Optional parameter: Example:
|
@@ -34,8 +35,8 @@ module AdvancedBilling
|
|
34
35
|
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
35
36
|
.auth(Single.new('BasicAuth')))
|
36
37
|
.response(new_response_handler
|
37
|
-
|
38
|
-
|
38
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
39
|
+
.deserialize_into(SubscriptionNoteResponse.method(:from_hash)))
|
39
40
|
.execute
|
40
41
|
end
|
41
42
|
|
@@ -68,9 +69,9 @@ module AdvancedBilling
|
|
68
69
|
.header_param(new_parameter('application/json', key: 'accept'))
|
69
70
|
.auth(Single.new('BasicAuth')))
|
70
71
|
.response(new_response_handler
|
71
|
-
|
72
|
-
|
73
|
-
|
72
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
73
|
+
.deserialize_into(SubscriptionNoteResponse.method(:from_hash))
|
74
|
+
.is_response_array(true))
|
74
75
|
.execute
|
75
76
|
end
|
76
77
|
|
@@ -78,7 +79,8 @@ module AdvancedBilling
|
|
78
79
|
# method to show a particular note attached to a subscription.
|
79
80
|
# @param [Integer] subscription_id Required parameter: The Chargify id of
|
80
81
|
# the subscription
|
81
|
-
# @param [Integer] note_id Required parameter: The
|
82
|
+
# @param [Integer] note_id Required parameter: The Advanced Billing id of
|
83
|
+
# the note
|
82
84
|
# @return [SubscriptionNoteResponse] response from the API call
|
83
85
|
def read_subscription_note(subscription_id,
|
84
86
|
note_id)
|
@@ -95,15 +97,16 @@ module AdvancedBilling
|
|
95
97
|
.header_param(new_parameter('application/json', key: 'accept'))
|
96
98
|
.auth(Single.new('BasicAuth')))
|
97
99
|
.response(new_response_handler
|
98
|
-
|
99
|
-
|
100
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
101
|
+
.deserialize_into(SubscriptionNoteResponse.method(:from_hash)))
|
100
102
|
.execute
|
101
103
|
end
|
102
104
|
|
103
105
|
# Use the following method to update a note for a Subscription.
|
104
106
|
# @param [Integer] subscription_id Required parameter: The Chargify id of
|
105
107
|
# the subscription
|
106
|
-
# @param [Integer] note_id Required parameter: The
|
108
|
+
# @param [Integer] note_id Required parameter: The Advanced Billing id of
|
109
|
+
# the note
|
107
110
|
# @param [UpdateSubscriptionNoteRequest] body Optional parameter: Example:
|
108
111
|
# @return [SubscriptionNoteResponse] response from the API call
|
109
112
|
def update_subscription_note(subscription_id,
|
@@ -125,15 +128,16 @@ module AdvancedBilling
|
|
125
128
|
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
126
129
|
.auth(Single.new('BasicAuth')))
|
127
130
|
.response(new_response_handler
|
128
|
-
|
129
|
-
|
131
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
132
|
+
.deserialize_into(SubscriptionNoteResponse.method(:from_hash)))
|
130
133
|
.execute
|
131
134
|
end
|
132
135
|
|
133
136
|
# Use the following method to delete a note for a Subscription.
|
134
137
|
# @param [Integer] subscription_id Required parameter: The Chargify id of
|
135
138
|
# the subscription
|
136
|
-
# @param [Integer] note_id Required parameter: The
|
139
|
+
# @param [Integer] note_id Required parameter: The Advanced Billing id of
|
140
|
+
# the note
|
137
141
|
# @return [void] response from the API call
|
138
142
|
def delete_subscription_note(subscription_id,
|
139
143
|
note_id)
|
@@ -149,7 +153,7 @@ module AdvancedBilling
|
|
149
153
|
.should_encode(true))
|
150
154
|
.auth(Single.new('BasicAuth')))
|
151
155
|
.response(new_response_handler
|
152
|
-
|
156
|
+
.is_response_void(true))
|
153
157
|
.execute
|
154
158
|
end
|
155
159
|
end
|
@@ -21,9 +21,10 @@ module AdvancedBilling
|
|
21
21
|
# subscription should be canceled, the product changed, and then the
|
22
22
|
# subscription can be reactivated.)
|
23
23
|
# ## Migrations Documentation
|
24
|
-
# Full documentation on how to record Migrations in the
|
25
|
-
# located
|
26
|
-
# [here](https://
|
24
|
+
# Full documentation on how to record Migrations in the Advanced Billing UI
|
25
|
+
# can be located
|
26
|
+
# [here](https://maxio.zendesk.com/hc/en-us/articles/24181589372429-Data-Mig
|
27
|
+
# ration-to-Advanced-Billing).
|
27
28
|
# ## Failed Migrations
|
28
29
|
# One of the most common ways that a migration can fail is when the attempt
|
29
30
|
# is made to migrate a subscription to it's current product. Please be aware
|
@@ -32,9 +33,10 @@ module AdvancedBilling
|
|
32
33
|
# It may happen that a payment needs 3D Secure Authentication when the
|
33
34
|
# subscription is migrated to a new product; this is referred to in our help
|
34
35
|
# docs as a [post-authentication
|
35
|
-
# flow](https://maxio
|
36
|
-
#
|
37
|
-
# `422 Unprocessable Entity` in this case with the
|
36
|
+
# flow](https://maxio.zendesk.com/hc/en-us/articles/24176278996493-Testing-I
|
37
|
+
# mplementing-3D-Secure#psd2-flows-pre-authentication-and-post-authenticatio
|
38
|
+
# n). The server returns `422 Unprocessable Entity` in this case with the
|
39
|
+
# following response:
|
38
40
|
# ```json
|
39
41
|
# {
|
40
42
|
# "errors": [
|
@@ -117,12 +119,12 @@ module AdvancedBilling
|
|
117
119
|
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
118
120
|
.auth(Single.new('BasicAuth')))
|
119
121
|
.response(new_response_handler
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
122
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
123
|
+
.deserialize_into(SubscriptionResponse.method(:from_hash))
|
124
|
+
.local_error_template('422',
|
125
|
+
'HTTP Response Not OK. Status code: {$statusCode}.'\
|
126
|
+
' Response: \'{$response.body}\'.',
|
127
|
+
ErrorListResponseException))
|
126
128
|
.execute
|
127
129
|
end
|
128
130
|
|
@@ -154,12 +156,12 @@ module AdvancedBilling
|
|
154
156
|
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
155
157
|
.auth(Single.new('BasicAuth')))
|
156
158
|
.response(new_response_handler
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
159
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
160
|
+
.deserialize_into(SubscriptionMigrationPreviewResponse.method(:from_hash))
|
161
|
+
.local_error_template('422',
|
162
|
+
'HTTP Response Not OK. Status code: {$statusCode}.'\
|
163
|
+
' Response: \'{$response.body}\'.',
|
164
|
+
ErrorListResponseException))
|
163
165
|
.execute
|
164
166
|
end
|
165
167
|
end
|