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.
Files changed (127) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +45 -45
  3. data/lib/advanced_billing/configuration.rb +2 -2
  4. data/lib/advanced_billing/controllers/advance_invoice_controller.rb +24 -24
  5. data/lib/advanced_billing/controllers/api_exports_controller.rb +57 -57
  6. data/lib/advanced_billing/controllers/base_controller.rb +10 -10
  7. data/lib/advanced_billing/controllers/billing_portal_controller.rb +33 -32
  8. data/lib/advanced_billing/controllers/component_price_points_controller.rb +60 -60
  9. data/lib/advanced_billing/controllers/components_controller.rb +110 -107
  10. data/lib/advanced_billing/controllers/coupons_controller.rb +89 -89
  11. data/lib/advanced_billing/controllers/custom_fields_controller.rb +76 -76
  12. data/lib/advanced_billing/controllers/customers_controller.rb +45 -41
  13. data/lib/advanced_billing/controllers/events_based_billing_segments_controller.rb +53 -53
  14. data/lib/advanced_billing/controllers/events_controller.rb +16 -15
  15. data/lib/advanced_billing/controllers/insights_controller.rb +17 -17
  16. data/lib/advanced_billing/controllers/invoices_controller.rb +99 -99
  17. data/lib/advanced_billing/controllers/offers_controller.rb +18 -15
  18. data/lib/advanced_billing/controllers/payment_profiles_controller.rb +107 -104
  19. data/lib/advanced_billing/controllers/product_families_controller.rb +26 -26
  20. data/lib/advanced_billing/controllers/product_price_points_controller.rb +62 -62
  21. data/lib/advanced_billing/controllers/products_controller.rb +37 -37
  22. data/lib/advanced_billing/controllers/proforma_invoices_controller.rb +61 -61
  23. data/lib/advanced_billing/controllers/reason_codes_controller.rb +35 -35
  24. data/lib/advanced_billing/controllers/referral_codes_controller.rb +9 -8
  25. data/lib/advanced_billing/controllers/sales_commissions_controller.rb +13 -13
  26. data/lib/advanced_billing/controllers/sites_controller.rb +11 -10
  27. data/lib/advanced_billing/controllers/subscription_components_controller.rb +170 -161
  28. data/lib/advanced_billing/controllers/subscription_group_invoice_account_controller.rb +23 -23
  29. data/lib/advanced_billing/controllers/subscription_group_status_controller.rb +21 -21
  30. data/lib/advanced_billing/controllers/subscription_groups_controller.rb +54 -54
  31. data/lib/advanced_billing/controllers/subscription_invoice_account_controller.rb +37 -37
  32. data/lib/advanced_billing/controllers/subscription_notes_controller.rb +20 -16
  33. data/lib/advanced_billing/controllers/subscription_products_controller.rb +20 -18
  34. data/lib/advanced_billing/controllers/subscription_status_controller.rb +74 -74
  35. data/lib/advanced_billing/controllers/subscriptions_controller.rb +163 -160
  36. data/lib/advanced_billing/controllers/webhooks_controller.rb +45 -44
  37. data/lib/advanced_billing/exceptions/component_allocation_error_exception.rb +15 -15
  38. data/lib/advanced_billing/exceptions/component_price_point_error_exception.rb +15 -15
  39. data/lib/advanced_billing/exceptions/customer_error_response_exception.rb +15 -15
  40. data/lib/advanced_billing/exceptions/error_array_map_response_exception.rb +15 -15
  41. data/lib/advanced_billing/exceptions/error_list_response_exception.rb +15 -15
  42. data/lib/advanced_billing/exceptions/error_string_map_response_exception.rb +15 -15
  43. data/lib/advanced_billing/exceptions/event_based_billing_list_segments_errors_exception.rb +15 -15
  44. data/lib/advanced_billing/exceptions/event_based_billing_segment_errors_exception.rb +15 -15
  45. data/lib/advanced_billing/exceptions/event_based_billing_segment_exception.rb +15 -15
  46. data/lib/advanced_billing/exceptions/product_price_point_error_response_exception.rb +15 -15
  47. data/lib/advanced_billing/exceptions/proforma_bad_request_error_response_exception.rb +15 -15
  48. data/lib/advanced_billing/exceptions/refund_prepayment_base_errors_response_exception.rb +15 -15
  49. data/lib/advanced_billing/exceptions/single_error_response_exception.rb +15 -15
  50. data/lib/advanced_billing/exceptions/single_string_error_response_exception.rb +15 -15
  51. data/lib/advanced_billing/exceptions/subscription_add_coupon_error_exception.rb +15 -15
  52. data/lib/advanced_billing/exceptions/subscription_component_allocation_error_exception.rb +15 -15
  53. data/lib/advanced_billing/exceptions/subscription_group_create_error_response_exception.rb +15 -15
  54. data/lib/advanced_billing/exceptions/subscription_group_signup_error_response_exception.rb +15 -15
  55. data/lib/advanced_billing/exceptions/subscription_group_update_error_response_exception.rb +15 -15
  56. data/lib/advanced_billing/exceptions/subscription_remove_coupon_errors_exception.rb +15 -15
  57. data/lib/advanced_billing/exceptions/subscriptions_mrr_error_response_exception.rb +15 -15
  58. data/lib/advanced_billing/exceptions/too_many_management_link_requests_error_exception.rb +15 -15
  59. data/lib/advanced_billing/models/activate_event_based_component.rb +84 -0
  60. data/lib/advanced_billing/models/{current_vault.rb → all_vaults.rb} +28 -7
  61. data/lib/advanced_billing/models/allocation.rb +1 -0
  62. data/lib/advanced_billing/models/allocation_preview_item.rb +1 -0
  63. data/lib/advanced_billing/models/apple_pay_payment_profile.rb +232 -0
  64. data/lib/advanced_billing/models/apple_pay_vault.rb +20 -0
  65. data/lib/advanced_billing/models/bank_account_attributes.rb +2 -0
  66. data/lib/advanced_billing/models/bank_account_payment_profile.rb +25 -20
  67. data/lib/advanced_billing/models/bank_account_vault.rb +19 -9
  68. data/lib/advanced_billing/models/change_invoice_status_event_data.rb +6 -6
  69. data/lib/advanced_billing/models/component.rb +1 -0
  70. data/lib/advanced_billing/models/component_custom_price.rb +33 -14
  71. data/lib/advanced_billing/models/component_price_point_item.rb +3 -1
  72. data/lib/advanced_billing/models/create_component_price_point.rb +3 -1
  73. data/lib/advanced_billing/models/create_customer.rb +11 -1
  74. data/lib/advanced_billing/models/create_metafield.rb +2 -1
  75. data/lib/advanced_billing/models/create_or_update_product.rb +7 -4
  76. data/lib/advanced_billing/models/create_payment_profile.rb +1 -1
  77. data/lib/advanced_billing/models/create_prepaid_usage_component_price_point.rb +6 -5
  78. data/lib/advanced_billing/models/create_product_price_point.rb +5 -3
  79. data/lib/advanced_billing/models/create_subscription.rb +27 -25
  80. data/lib/advanced_billing/models/credit_card_payment_profile.rb +17 -16
  81. data/lib/advanced_billing/models/credit_card_vault.rb +117 -0
  82. data/lib/advanced_billing/models/credit_note.rb +2 -2
  83. data/lib/advanced_billing/models/customer.rb +11 -1
  84. data/lib/advanced_billing/models/customer_attributes.rb +12 -1
  85. data/lib/advanced_billing/models/ebb_component.rb +1 -0
  86. data/lib/advanced_billing/models/{extended_interval_unit.rb → expiration_interval_unit.rb} +4 -4
  87. data/lib/advanced_billing/models/full_subscription_group_response.rb +65 -50
  88. data/lib/advanced_billing/models/get_one_time_token_payment_profile.rb +1 -1
  89. data/lib/advanced_billing/models/invoice.rb +19 -9
  90. data/lib/advanced_billing/models/invoice_consolidation_level.rb +2 -2
  91. data/lib/advanced_billing/models/invoice_refund.rb +13 -1
  92. data/lib/advanced_billing/models/invoice_status.rb +2 -2
  93. data/lib/advanced_billing/models/invoice_tax.rb +29 -0
  94. data/lib/advanced_billing/models/invoice_tax_component_breakout.rb +101 -1
  95. data/lib/advanced_billing/models/issue_invoice_event_data.rb +6 -6
  96. data/lib/advanced_billing/models/metered_component.rb +4 -3
  97. data/lib/advanced_billing/models/offer_item.rb +3 -1
  98. data/lib/advanced_billing/models/on_off_component.rb +3 -2
  99. data/lib/advanced_billing/models/paid_invoice.rb +2 -2
  100. data/lib/advanced_billing/models/pay_pal_vault.rb +29 -0
  101. data/lib/advanced_billing/models/payment_profile_attributes.rb +5 -5
  102. data/lib/advanced_billing/models/payment_profile_response.rb +3 -3
  103. data/lib/advanced_billing/models/payment_type.rb +4 -1
  104. data/lib/advanced_billing/models/paypal_payment_profile.rb +242 -0
  105. data/lib/advanced_billing/models/prepaid_usage_component.rb +5 -4
  106. data/lib/advanced_billing/models/product.rb +2 -2
  107. data/lib/advanced_billing/models/product_price_point.rb +2 -2
  108. data/lib/advanced_billing/models/proforma_invoice.rb +6 -6
  109. data/lib/advanced_billing/models/quantity_based_component.rb +4 -3
  110. data/lib/advanced_billing/models/refund_invoice_event_data.rb +4 -4
  111. data/lib/advanced_billing/models/resent_invitation.rb +36 -0
  112. data/lib/advanced_billing/models/subscription.rb +13 -10
  113. data/lib/advanced_billing/models/subscription_component.rb +1 -0
  114. data/lib/advanced_billing/models/subscription_component_subscription.rb +26 -20
  115. data/lib/advanced_billing/models/subscription_custom_price.rb +5 -2
  116. data/lib/advanced_billing/models/subscription_group_bank_account.rb +2 -0
  117. data/lib/advanced_billing/models/subscription_group_credit_card.rb +1 -1
  118. data/lib/advanced_billing/models/subscription_group_signup_response.rb +39 -30
  119. data/lib/advanced_billing/models/subscription_state.rb +30 -30
  120. data/lib/advanced_billing/models/tax_configuration.rb +1 -2
  121. data/lib/advanced_billing/models/update_component_price_point.rb +3 -1
  122. data/lib/advanced_billing/models/update_customer.rb +12 -1
  123. data/lib/advanced_billing/models/update_payment_profile.rb +1 -1
  124. data/lib/advanced_billing/utilities/file_wrapper.rb +9 -9
  125. data/lib/advanced_billing/utilities/union_type_lookup.rb +17 -3
  126. data/lib/advanced_billing.rb +10 -4
  127. metadata +16 -10
@@ -7,14 +7,14 @@ module AdvancedBilling
7
7
  # CouponsController
8
8
  class CouponsController < BaseController
9
9
  # ## Coupons Documentation
10
- # Coupons can be administered in the Chargify application or created via
11
- # API. Please view our section on [creating
12
- # coupons](https://maxio-chargify.zendesk.com/hc/en-us/articles/540474283073
13
- # 3) for more information.
10
+ # Coupons can be administered in the Advanced Billing application or created
11
+ # via API. Please view our section on [creating
12
+ # coupons](https://maxio.zendesk.com/hc/en-us/articles/24261212433165-Creati
13
+ # ng-Editing-Deleting-Coupons) for more information.
14
14
  # Additionally, for documentation on how to apply a coupon to a subscription
15
- # within the Chargify UI, please see our documentation
16
- # [here](https://maxio-chargify.zendesk.com/hc/en-us/articles/5404761012877)
17
- # .
15
+ # within the Advanced Billing UI, please see our documentation
16
+ # [here](https://maxio.zendesk.com/hc/en-us/articles/24261259337101-Coupons-
17
+ # and-Subscriptions).
18
18
  # ## Create Coupon
19
19
  # This request will create a coupon, based on the provided information.
20
20
  # When creating a coupon, you must specify a product family using the
@@ -25,8 +25,8 @@ module AdvancedBilling
25
25
  # by optionally passing in hashes of `restricted_products` and/or
26
26
  # `restricted_components` in the format:
27
27
  # `{ "<product/component_id>": boolean_value }`
28
- # @param [Integer] product_family_id Required parameter: The Chargify id of
29
- # the product family to which the coupon belongs
28
+ # @param [Integer] product_family_id Required parameter: The Advanced
29
+ # Billing id of the product family to which the coupon belongs
30
30
  # @param [CreateOrUpdateCoupon] body Optional parameter: Example:
31
31
  # @return [CouponResponse] response from the API call
32
32
  def create_coupon(product_family_id,
@@ -44,12 +44,12 @@ module AdvancedBilling
44
44
  .body_serializer(proc do |param| param.to_json unless param.nil? end)
45
45
  .auth(Single.new('BasicAuth')))
46
46
  .response(new_response_handler
47
- .deserializer(APIHelper.method(:custom_type_deserializer))
48
- .deserialize_into(CouponResponse.method(:from_hash))
49
- .local_error_template('422',
50
- 'HTTP Response Not OK. Status code: {$statusCode}.'\
51
- ' Response: \'{$response.body}\'.',
52
- ErrorListResponseException))
47
+ .deserializer(APIHelper.method(:custom_type_deserializer))
48
+ .deserialize_into(CouponResponse.method(:from_hash))
49
+ .local_error_template('422',
50
+ 'HTTP Response Not OK. Status code: {$statusCode}.'\
51
+ ' Response: \'{$response.body}\'.',
52
+ ErrorListResponseException))
53
53
  .execute
54
54
  end
55
55
 
@@ -57,8 +57,8 @@ module AdvancedBilling
57
57
  # If the coupon is set to `use_site_exchange_rate: true`, it will return
58
58
  # pricing based on the current exchange rate. If the flag is set to false,
59
59
  # it will return all of the defined prices for each currency.
60
- # @param [Integer] product_family_id Required parameter: The Chargify id of
61
- # the product family to which the coupon belongs
60
+ # @param [Integer] product_family_id Required parameter: The Advanced
61
+ # Billing id of the product family to which the coupon belongs
62
62
  # @param [Integer] page Optional parameter: Result records are organized in
63
63
  # pages. By default, the first page of results is displayed. The page
64
64
  # parameter specifies a page number of results to fetch. You can start
@@ -94,9 +94,9 @@ module AdvancedBilling
94
94
  .auth(Single.new('BasicAuth'))
95
95
  .array_serialization_format(ArraySerializationFormat::CSV))
96
96
  .response(new_response_handler
97
- .deserializer(APIHelper.method(:custom_type_deserializer))
98
- .deserialize_into(CouponResponse.method(:from_hash))
99
- .is_response_array(true))
97
+ .deserializer(APIHelper.method(:custom_type_deserializer))
98
+ .deserialize_into(CouponResponse.method(:from_hash))
99
+ .is_response_array(true))
100
100
  .execute
101
101
  end
102
102
 
@@ -107,8 +107,8 @@ module AdvancedBilling
107
107
  # to find does not belong to the default product family in your site, then
108
108
  # you will need to specify (either in the url or as a query string param)
109
109
  # the product family id.
110
- # @param [Integer] product_family_id Optional parameter: The Chargify id of
111
- # the product family to which the coupon belongs
110
+ # @param [Integer] product_family_id Optional parameter: The Advanced
111
+ # Billing id of the product family to which the coupon belongs
112
112
  # @param [String] code Optional parameter: The code of the coupon
113
113
  # @return [CouponResponse] response from the API call
114
114
  def find_coupon(product_family_id: nil,
@@ -122,13 +122,13 @@ module AdvancedBilling
122
122
  .header_param(new_parameter('application/json', key: 'accept'))
123
123
  .auth(Single.new('BasicAuth')))
124
124
  .response(new_response_handler
125
- .deserializer(APIHelper.method(:custom_type_deserializer))
126
- .deserialize_into(CouponResponse.method(:from_hash)))
125
+ .deserializer(APIHelper.method(:custom_type_deserializer))
126
+ .deserialize_into(CouponResponse.method(:from_hash)))
127
127
  .execute
128
128
  end
129
129
 
130
130
  # You can retrieve the Coupon via the API with the Show method. You must
131
- # identify the Coupon in this call by the ID parameter that Chargify
131
+ # identify the Coupon in this call by the ID parameter that Advanced Billing
132
132
  # assigns.
133
133
  # If instead you would like to find a Coupon using a Coupon code, see the
134
134
  # Coupon Find method.
@@ -138,10 +138,10 @@ module AdvancedBilling
138
138
  # If the coupon is set to `use_site_exchange_rate: true`, it will return
139
139
  # pricing based on the current exchange rate. If the flag is set to false,
140
140
  # it will return all of the defined prices for each currency.
141
- # @param [Integer] product_family_id Required parameter: The Chargify id of
142
- # the product family to which the coupon belongs
143
- # @param [Integer] coupon_id Required parameter: The Chargify id of the
144
- # coupon
141
+ # @param [Integer] product_family_id Required parameter: The Advanced
142
+ # Billing id of the product family to which the coupon belongs
143
+ # @param [Integer] coupon_id Required parameter: The Advanced Billing id of
144
+ # the coupon
145
145
  # @return [CouponResponse] response from the API call
146
146
  def read_coupon(product_family_id,
147
147
  coupon_id)
@@ -158,8 +158,8 @@ module AdvancedBilling
158
158
  .header_param(new_parameter('application/json', key: 'accept'))
159
159
  .auth(Single.new('BasicAuth')))
160
160
  .response(new_response_handler
161
- .deserializer(APIHelper.method(:custom_type_deserializer))
162
- .deserialize_into(CouponResponse.method(:from_hash)))
161
+ .deserializer(APIHelper.method(:custom_type_deserializer))
162
+ .deserialize_into(CouponResponse.method(:from_hash)))
163
163
  .execute
164
164
  end
165
165
 
@@ -170,10 +170,10 @@ module AdvancedBilling
170
170
  # by optionally passing in hashes of `restricted_products` and/or
171
171
  # `restricted_components` in the format:
172
172
  # `{ "<product/component_id>": boolean_value }`
173
- # @param [Integer] product_family_id Required parameter: The Chargify id of
174
- # the product family to which the coupon belongs
175
- # @param [Integer] coupon_id Required parameter: The Chargify id of the
176
- # coupon
173
+ # @param [Integer] product_family_id Required parameter: The Advanced
174
+ # Billing id of the product family to which the coupon belongs
175
+ # @param [Integer] coupon_id Required parameter: The Advanced Billing id of
176
+ # the coupon
177
177
  # @param [CreateOrUpdateCoupon] body Optional parameter: Example:
178
178
  # @return [CouponResponse] response from the API call
179
179
  def update_coupon(product_family_id,
@@ -195,8 +195,8 @@ module AdvancedBilling
195
195
  .body_serializer(proc do |param| param.to_json unless param.nil? end)
196
196
  .auth(Single.new('BasicAuth')))
197
197
  .response(new_response_handler
198
- .deserializer(APIHelper.method(:custom_type_deserializer))
199
- .deserialize_into(CouponResponse.method(:from_hash)))
198
+ .deserializer(APIHelper.method(:custom_type_deserializer))
199
+ .deserialize_into(CouponResponse.method(:from_hash)))
200
200
  .execute
201
201
  end
202
202
 
@@ -205,10 +205,10 @@ module AdvancedBilling
205
205
  # remain attached and functional on existing Subscriptions that are using
206
206
  # it.
207
207
  # The `archived_at` date and time will be assigned.
208
- # @param [Integer] product_family_id Required parameter: The Chargify id of
209
- # the product family to which the coupon belongs
210
- # @param [Integer] coupon_id Required parameter: The Chargify id of the
211
- # coupon
208
+ # @param [Integer] product_family_id Required parameter: The Advanced
209
+ # Billing id of the product family to which the coupon belongs
210
+ # @param [Integer] coupon_id Required parameter: The Advanced Billing id of
211
+ # the coupon
212
212
  # @return [CouponResponse] response from the API call
213
213
  def archive_coupon(product_family_id,
214
214
  coupon_id)
@@ -225,8 +225,8 @@ module AdvancedBilling
225
225
  .header_param(new_parameter('application/json', key: 'accept'))
226
226
  .auth(Single.new('BasicAuth')))
227
227
  .response(new_response_handler
228
- .deserializer(APIHelper.method(:custom_type_deserializer))
229
- .deserialize_into(CouponResponse.method(:from_hash)))
228
+ .deserializer(APIHelper.method(:custom_type_deserializer))
229
+ .deserialize_into(CouponResponse.method(:from_hash)))
230
230
  .execute
231
231
  end
232
232
 
@@ -266,18 +266,18 @@ module AdvancedBilling
266
266
  .auth(Single.new('BasicAuth'))
267
267
  .array_serialization_format(ArraySerializationFormat::CSV))
268
268
  .response(new_response_handler
269
- .deserializer(APIHelper.method(:custom_type_deserializer))
270
- .deserialize_into(CouponResponse.method(:from_hash))
271
- .is_response_array(true))
269
+ .deserializer(APIHelper.method(:custom_type_deserializer))
270
+ .deserialize_into(CouponResponse.method(:from_hash))
271
+ .is_response_array(true))
272
272
  .execute
273
273
  end
274
274
 
275
275
  # This request will provide details about the coupon usage as an array of
276
276
  # data hashes, one per product.
277
- # @param [Integer] product_family_id Required parameter: The Chargify id of
278
- # the product family to which the coupon belongs
279
- # @param [Integer] coupon_id Required parameter: The Chargify id of the
280
- # coupon
277
+ # @param [Integer] product_family_id Required parameter: The Advanced
278
+ # Billing id of the product family to which the coupon belongs
279
+ # @param [Integer] coupon_id Required parameter: The Advanced Billing id of
280
+ # the coupon
281
281
  # @return [Array[CouponUsage]] response from the API call
282
282
  def read_coupon_usage(product_family_id,
283
283
  coupon_id)
@@ -294,9 +294,9 @@ module AdvancedBilling
294
294
  .header_param(new_parameter('application/json', key: 'accept'))
295
295
  .auth(Single.new('BasicAuth')))
296
296
  .response(new_response_handler
297
- .deserializer(APIHelper.method(:custom_type_deserializer))
298
- .deserialize_into(CouponUsage.method(:from_hash))
299
- .is_response_array(true))
297
+ .deserializer(APIHelper.method(:custom_type_deserializer))
298
+ .deserialize_into(CouponUsage.method(:from_hash))
299
+ .is_response_array(true))
300
300
  .execute
301
301
  end
302
302
 
@@ -327,8 +327,8 @@ module AdvancedBilling
327
327
  # de>&product_family_id=<id>
328
328
  # ```
329
329
  # @param [String] code Required parameter: The code of the coupon
330
- # @param [Integer] product_family_id Optional parameter: The Chargify id of
331
- # the product family to which the coupon belongs
330
+ # @param [Integer] product_family_id Optional parameter: The Advanced
331
+ # Billing id of the product family to which the coupon belongs
332
332
  # @return [CouponResponse] response from the API call
333
333
  def validate_coupon(code,
334
334
  product_family_id: nil)
@@ -342,11 +342,11 @@ module AdvancedBilling
342
342
  .header_param(new_parameter('application/json', key: 'accept'))
343
343
  .auth(Single.new('BasicAuth')))
344
344
  .response(new_response_handler
345
- .deserializer(APIHelper.method(:custom_type_deserializer))
346
- .deserialize_into(CouponResponse.method(:from_hash))
347
- .local_error('404',
348
- 'Not Found',
349
- SingleStringErrorResponseException))
345
+ .deserializer(APIHelper.method(:custom_type_deserializer))
346
+ .deserialize_into(CouponResponse.method(:from_hash))
347
+ .local_error('404',
348
+ 'Not Found',
349
+ SingleStringErrorResponseException))
350
350
  .execute
351
351
  end
352
352
 
@@ -357,8 +357,8 @@ module AdvancedBilling
357
357
  # Currency pricing for coupons must mirror the setup of the primary coupon
358
358
  # pricing - if the primary coupon is percentage based, you will not be able
359
359
  # to define pricing in non-primary currencies.
360
- # @param [Integer] coupon_id Required parameter: The Chargify id of the
361
- # coupon
360
+ # @param [Integer] coupon_id Required parameter: The Advanced Billing id of
361
+ # the coupon
362
362
  # @param [CouponCurrencyRequest] body Optional parameter: Example:
363
363
  # @return [CouponCurrencyResponse] response from the API call
364
364
  def create_or_update_coupon_currency_prices(coupon_id,
@@ -376,8 +376,8 @@ module AdvancedBilling
376
376
  .body_serializer(proc do |param| param.to_json unless param.nil? end)
377
377
  .auth(Single.new('BasicAuth')))
378
378
  .response(new_response_handler
379
- .deserializer(APIHelper.method(:custom_type_deserializer))
380
- .deserialize_into(CouponCurrencyResponse.method(:from_hash)))
379
+ .deserializer(APIHelper.method(:custom_type_deserializer))
380
+ .deserialize_into(CouponCurrencyResponse.method(:from_hash)))
381
381
  .execute
382
382
  end
383
383
 
@@ -397,14 +397,14 @@ module AdvancedBilling
397
397
  # contain only letters and numbers, and do not have any spaces. Lowercase
398
398
  # letters will be capitalized before the subcode is created.
399
399
  # ## Coupon Subcodes Documentation
400
- # Full documentation on how to create coupon subcodes in the Chargify UI can
401
- # be located
402
- # [here](https://chargify.zendesk.com/hc/en-us/articles/4407755909531#coupon
403
- # -codes).
400
+ # Full documentation on how to create coupon subcodes in the Advanced
401
+ # Billing UI can be located
402
+ # [here](https://maxio.zendesk.com/hc/en-us/articles/24261208729229-Coupon-C
403
+ # odes).
404
404
  # Additionally, for documentation on how to apply a coupon to a Subscription
405
- # within the Chargify UI, please see our documentation
406
- # [here](https://chargify.zendesk.com/hc/en-us/articles/4407884887835#coupon
407
- # ).
405
+ # within the Advanced Billing UI, please see our documentation
406
+ # [here](https://maxio.zendesk.com/hc/en-us/articles/24261259337101-Coupons-
407
+ # and-Subscriptions).
408
408
  # ## Create Coupon Subcode
409
409
  # This request allows you to create specific subcodes underneath an existing
410
410
  # coupon code.
@@ -419,8 +419,8 @@ module AdvancedBilling
419
419
  # So, if the coupon subcode is `20%OFF`, the URL to delete this coupon
420
420
  # subcode would be:
421
421
  # `https://<subdomain>.chargify.com/coupons/567/codes/20%25OFF.<format>`
422
- # @param [Integer] coupon_id Required parameter: The Chargify id of the
423
- # coupon
422
+ # @param [Integer] coupon_id Required parameter: The Advanced Billing id of
423
+ # the coupon
424
424
  # @param [CouponSubcodes] body Optional parameter: Example:
425
425
  # @return [CouponSubcodesResponse] response from the API call
426
426
  def create_coupon_subcodes(coupon_id,
@@ -438,15 +438,15 @@ module AdvancedBilling
438
438
  .body_serializer(proc do |param| param.to_json unless param.nil? end)
439
439
  .auth(Single.new('BasicAuth')))
440
440
  .response(new_response_handler
441
- .deserializer(APIHelper.method(:custom_type_deserializer))
442
- .deserialize_into(CouponSubcodesResponse.method(:from_hash)))
441
+ .deserializer(APIHelper.method(:custom_type_deserializer))
442
+ .deserialize_into(CouponSubcodesResponse.method(:from_hash)))
443
443
  .execute
444
444
  end
445
445
 
446
446
  # This request allows you to request the subcodes that are attached to a
447
447
  # coupon.
448
- # @param [Integer] coupon_id Required parameter: The Chargify id of the
449
- # coupon
448
+ # @param [Integer] coupon_id Required parameter: The Advanced Billing id of
449
+ # the coupon
450
450
  # @param [Integer] page Optional parameter: Result records are organized in
451
451
  # pages. By default, the first page of results is displayed. The page
452
452
  # parameter specifies a page number of results to fetch. You can start
@@ -472,8 +472,8 @@ module AdvancedBilling
472
472
  .header_param(new_parameter('application/json', key: 'accept'))
473
473
  .auth(Single.new('BasicAuth')))
474
474
  .response(new_response_handler
475
- .deserializer(APIHelper.method(:custom_type_deserializer))
476
- .deserialize_into(CouponSubcodes.method(:from_hash)))
475
+ .deserializer(APIHelper.method(:custom_type_deserializer))
476
+ .deserialize_into(CouponSubcodes.method(:from_hash)))
477
477
  .execute
478
478
  end
479
479
 
@@ -486,8 +486,8 @@ module AdvancedBilling
486
486
  # + The created subcodes,
487
487
  # + Subcodes that were not created because they already exist,
488
488
  # + Any subcodes not created because they are invalid.
489
- # @param [Integer] coupon_id Required parameter: The Chargify id of the
490
- # coupon
489
+ # @param [Integer] coupon_id Required parameter: The Advanced Billing id of
490
+ # the coupon
491
491
  # @param [CouponSubcodes] body Optional parameter: Example:
492
492
  # @return [CouponSubcodesResponse] response from the API call
493
493
  def update_coupon_subcodes(coupon_id,
@@ -505,8 +505,8 @@ module AdvancedBilling
505
505
  .body_serializer(proc do |param| param.to_json unless param.nil? end)
506
506
  .auth(Single.new('BasicAuth')))
507
507
  .response(new_response_handler
508
- .deserializer(APIHelper.method(:custom_type_deserializer))
509
- .deserialize_into(CouponSubcodesResponse.method(:from_hash)))
508
+ .deserializer(APIHelper.method(:custom_type_deserializer))
509
+ .deserialize_into(CouponSubcodesResponse.method(:from_hash)))
510
510
  .execute
511
511
  end
512
512
 
@@ -530,8 +530,8 @@ module AdvancedBilling
530
530
  # Or if the coupon subcode is 20%OFF, the URL to delete this coupon subcode
531
531
  # would be:
532
532
  # @https://<subdomain>.chargify.com/coupons/567/codes/20%25OFF.<format>
533
- # @param [Integer] coupon_id Required parameter: The Chargify id of the
534
- # coupon to which the subcode belongs
533
+ # @param [Integer] coupon_id Required parameter: The Advanced Billing id of
534
+ # the coupon to which the subcode belongs
535
535
  # @param [String] subcode Required parameter: The subcode of the coupon
536
536
  # @return [void] response from the API call
537
537
  def delete_coupon_subcode(coupon_id,
@@ -548,10 +548,10 @@ module AdvancedBilling
548
548
  .should_encode(true))
549
549
  .auth(Single.new('BasicAuth')))
550
550
  .response(new_response_handler
551
- .is_response_void(true)
552
- .local_error_template('404',
553
- 'Not Found:\'{$response.body}\'',
554
- APIException))
551
+ .is_response_void(true)
552
+ .local_error_template('404',
553
+ 'Not Found:\'{$response.body}\'',
554
+ APIException))
555
555
  .execute
556
556
  end
557
557
  end
@@ -7,21 +7,21 @@ module AdvancedBilling
7
7
  # CustomFieldsController
8
8
  class CustomFieldsController < BaseController
9
9
  # ## Custom Fields: Metafield Intro
10
- # **Chargify refers to Custom Fields in the API documentation as metafields
11
- # and metadata.** Within the Chargify UI, metadata and metafields are
12
- # grouped together under the umbrella of "Custom Fields." All of our
13
- # UI-based documentation that references custom fields will not cite the
14
- # terminology metafields or metadata.
10
+ # **Advanced Billing refers to Custom Fields in the API documentation as
11
+ # metafields and metadata.** Within the Advanced Billing UI, metadata and
12
+ # metafields are grouped together under the umbrella of "Custom Fields." All
13
+ # of our UI-based documentation that references custom fields will not cite
14
+ # the terminology metafields or metadata.
15
15
  # + **Metafield is the custom field**
16
16
  # + **Metadata is the data populating the custom field.**
17
- # Chargify Metafields are used to add meaningful attributes to subscription
18
- # and customer resources. Full documentation on how to create Custom Fields
19
- # in the Chargify UI can be located
20
- # [here](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405332553613-
21
- # Custom-Fields-Reference). For additional documentation on how to record
22
- # data within custom fields, please see our subscription-based documentation
23
- # [here.](https://maxio-chargify.zendesk.com/hc/en-us/articles/5404434903181
24
- # -Subscription-Summary#custom-fields)
17
+ # Advanced Billing Metafields are used to add meaningful attributes to
18
+ # subscription and customer resources. Full documentation on how to create
19
+ # Custom Fields in the Advanced Billing UI can be located
20
+ # [here](https://maxio.zendesk.com/hc/en-us/sections/24266118312589-Custom-F
21
+ # ields). For additional documentation on how to record data within custom
22
+ # fields, please see our subscription-based documentation
23
+ # [here](https://maxio.zendesk.com/hc/en-us/articles/24251701302925-Subscrip
24
+ # tion-Summary-Custom-Fields-Tab).
25
25
  # Metafield are the place where you will set up your resource to accept
26
26
  # additional data. It is scoped to the site instead of a specific customer
27
27
  # or subscription. Think of it as the key, and Metadata as the value on
@@ -60,13 +60,13 @@ module AdvancedBilling
60
60
  .body_serializer(proc do |param| param.to_json unless param.nil? end)
61
61
  .auth(Single.new('BasicAuth')))
62
62
  .response(new_response_handler
63
- .deserializer(APIHelper.method(:custom_type_deserializer))
64
- .deserialize_into(Metafield.method(:from_hash))
65
- .is_response_array(true)
66
- .local_error_template('422',
67
- 'HTTP Response Not OK. Status code: {$statusCode}.'\
68
- ' Response: \'{$response.body}\'.',
69
- SingleErrorResponseException))
63
+ .deserializer(APIHelper.method(:custom_type_deserializer))
64
+ .deserialize_into(Metafield.method(:from_hash))
65
+ .is_response_array(true)
66
+ .local_error_template('422',
67
+ 'HTTP Response Not OK. Status code: {$statusCode}.'\
68
+ ' Response: \'{$response.body}\'.',
69
+ SingleErrorResponseException))
70
70
  .execute
71
71
  end
72
72
 
@@ -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
- .deserializer(APIHelper.method(:custom_type_deserializer))
109
- .deserialize_into(ListMetafieldsResponse.method(:from_hash)))
108
+ .deserializer(APIHelper.method(:custom_type_deserializer))
109
+ .deserialize_into(ListMetafieldsResponse.method(:from_hash)))
110
110
  .execute
111
111
  end
112
112
 
@@ -131,13 +131,13 @@ module AdvancedBilling
131
131
  .body_serializer(proc do |param| param.to_json unless param.nil? end)
132
132
  .auth(Single.new('BasicAuth')))
133
133
  .response(new_response_handler
134
- .deserializer(APIHelper.method(:custom_type_deserializer))
135
- .deserialize_into(Metafield.method(:from_hash))
136
- .is_response_array(true)
137
- .local_error_template('422',
138
- 'HTTP Response Not OK. Status code: {$statusCode}.'\
139
- ' Response: \'{$response.body}\'.',
140
- SingleErrorResponseException))
134
+ .deserializer(APIHelper.method(:custom_type_deserializer))
135
+ .deserialize_into(Metafield.method(:from_hash))
136
+ .is_response_array(true)
137
+ .local_error_template('422',
138
+ 'HTTP Response Not OK. Status code: {$statusCode}.'\
139
+ ' Response: \'{$response.body}\'.',
140
+ SingleErrorResponseException))
141
141
  .execute
142
142
  end
143
143
 
@@ -162,29 +162,29 @@ module AdvancedBilling
162
162
  .query_param(new_parameter(name, key: 'name'))
163
163
  .auth(Single.new('BasicAuth')))
164
164
  .response(new_response_handler
165
- .is_response_void(true)
166
- .local_error_template('404',
167
- 'Not Found:\'{$response.body}\'',
168
- APIException))
165
+ .is_response_void(true)
166
+ .local_error_template('404',
167
+ 'Not Found:\'{$response.body}\'',
168
+ APIException))
169
169
  .execute
170
170
  end
171
171
 
172
172
  # ## Custom Fields: Metadata Intro
173
- # **Chargify refers to Custom Fields in the API documentation as metafields
174
- # and metadata.** Within the Chargify UI, metadata and metafields are
175
- # grouped together under the umbrella of "Custom Fields." All of our
176
- # UI-based documentation that references custom fields will not cite the
177
- # terminology metafields or metadata.
173
+ # **Advanced Billing refers to Custom Fields in the API documentation as
174
+ # metafields and metadata.** Within the Advanced Billing UI, metadata and
175
+ # metafields are grouped together under the umbrella of "Custom Fields." All
176
+ # of our UI-based documentation that references custom fields will not cite
177
+ # the terminology metafields or metadata.
178
178
  # + **Metafield is the custom field**
179
179
  # + **Metadata is the data populating the custom field.**
180
- # Chargify Metafields are used to add meaningful attributes to subscription
181
- # and customer resources. Full documentation on how to create Custom Fields
182
- # in the Chargify UI can be located
183
- # [here](https://chargify.zendesk.com/hc/en-us/articles/4407659856411). For
184
- # additional documentation on how to record data within custom fields,
185
- # please see our subscription-based documentation
186
- # [here.](https://chargify.zendesk.com/hc/en-us/articles/4407884887835#custo
187
- # m-fields)
180
+ # Advanced Billing Metafields are used to add meaningful attributes to
181
+ # subscription and customer resources. Full documentation on how to create
182
+ # Custom Fields in the Advanced Billing UI can be located
183
+ # [here](https://maxio.zendesk.com/hc/en-us/articles/24266164865677-Custom-F
184
+ # ields-Overview). For additional documentation on how to record data within
185
+ # custom fields, please see our subscription-based documentation
186
+ # [here.](https://maxio.zendesk.com/hc/en-us/articles/24251701302925-Subscri
187
+ # ption-Summary-Custom-Fields-Tab)
188
188
  # Metadata is associated to a customer or subscription, and corresponds to a
189
189
  # Metafield. When creating a new metadata object for a given record, **if
190
190
  # the metafield is not present it will be created**.
@@ -199,8 +199,8 @@ module AdvancedBilling
199
199
  # metadata.
200
200
  # @param [ResourceType] resource_type Required parameter: the resource type
201
201
  # to which the metafields belong
202
- # @param [Integer] resource_id Required parameter: The Chargify id of the
203
- # customer or the subscription for which the metadata applies
202
+ # @param [Integer] resource_id Required parameter: The Advanced Billing id
203
+ # of the customer or the subscription for which the metadata applies
204
204
  # @param [CreateMetadataRequest] body Optional parameter: Example:
205
205
  # @return [Array[Metadata]] response from the API call
206
206
  def create_metadata(resource_type,
@@ -222,13 +222,13 @@ module AdvancedBilling
222
222
  .body_serializer(proc do |param| param.to_json unless param.nil? end)
223
223
  .auth(Single.new('BasicAuth')))
224
224
  .response(new_response_handler
225
- .deserializer(APIHelper.method(:custom_type_deserializer))
226
- .deserialize_into(Metadata.method(:from_hash))
227
- .is_response_array(true)
228
- .local_error_template('422',
229
- 'HTTP Response Not OK. Status code: {$statusCode}.'\
230
- ' Response: \'{$response.body}\'.',
231
- SingleErrorResponseException))
225
+ .deserializer(APIHelper.method(:custom_type_deserializer))
226
+ .deserialize_into(Metadata.method(:from_hash))
227
+ .is_response_array(true)
228
+ .local_error_template('422',
229
+ 'HTTP Response Not OK. Status code: {$statusCode}.'\
230
+ ' Response: \'{$response.body}\'.',
231
+ SingleErrorResponseException))
232
232
  .execute
233
233
  end
234
234
 
@@ -239,8 +239,8 @@ module AdvancedBilling
239
239
  # as a tool for pagination.
240
240
  # @param [ResourceType] resource_type Required parameter: the resource type
241
241
  # to which the metafields belong
242
- # @param [Integer] resource_id Required parameter: The Chargify id of the
243
- # customer or the subscription for which the metadata applies
242
+ # @param [Integer] resource_id Required parameter: The Advanced Billing id
243
+ # of the customer or the subscription for which the metadata applies
244
244
  # @param [Integer] page Optional parameter: Result records are organized in
245
245
  # pages. By default, the first page of results is displayed. The page
246
246
  # parameter specifies a page number of results to fetch. You can start
@@ -269,8 +269,8 @@ module AdvancedBilling
269
269
  .header_param(new_parameter('application/json', key: 'accept'))
270
270
  .auth(Single.new('BasicAuth')))
271
271
  .response(new_response_handler
272
- .deserializer(APIHelper.method(:custom_type_deserializer))
273
- .deserialize_into(PaginatedMetadata.method(:from_hash)))
272
+ .deserializer(APIHelper.method(:custom_type_deserializer))
273
+ .deserialize_into(PaginatedMetadata.method(:from_hash)))
274
274
  .execute
275
275
  end
276
276
 
@@ -278,8 +278,8 @@ module AdvancedBilling
278
278
  # subscription or customer.
279
279
  # @param [ResourceType] resource_type Required parameter: the resource type
280
280
  # to which the metafields belong
281
- # @param [Integer] resource_id Required parameter: The Chargify id of the
282
- # customer or the subscription for which the metadata applies
281
+ # @param [Integer] resource_id Required parameter: The Advanced Billing id
282
+ # of the customer or the subscription for which the metadata applies
283
283
  # @param [UpdateMetadataRequest] body Optional parameter: Example:
284
284
  # @return [Array[Metadata]] response from the API call
285
285
  def update_metadata(resource_type,
@@ -301,13 +301,13 @@ module AdvancedBilling
301
301
  .body_serializer(proc do |param| param.to_json unless param.nil? end)
302
302
  .auth(Single.new('BasicAuth')))
303
303
  .response(new_response_handler
304
- .deserializer(APIHelper.method(:custom_type_deserializer))
305
- .deserialize_into(Metadata.method(:from_hash))
306
- .is_response_array(true)
307
- .local_error_template('422',
308
- 'HTTP Response Not OK. Status code: {$statusCode}.'\
309
- ' Response: \'{$response.body}\'.',
310
- SingleErrorResponseException))
304
+ .deserializer(APIHelper.method(:custom_type_deserializer))
305
+ .deserialize_into(Metadata.method(:from_hash))
306
+ .is_response_array(true)
307
+ .local_error_template('422',
308
+ 'HTTP Response Not OK. Status code: {$statusCode}.'\
309
+ ' Response: \'{$response.body}\'.',
310
+ SingleErrorResponseException))
311
311
  .execute
312
312
  end
313
313
 
@@ -332,8 +332,8 @@ module AdvancedBilling
332
332
  # and the plain text response of `true`.
333
333
  # @param [ResourceType] resource_type Required parameter: the resource type
334
334
  # to which the metafields belong
335
- # @param [Integer] resource_id Required parameter: The Chargify id of the
336
- # customer or the subscription for which the metadata applies
335
+ # @param [Integer] resource_id Required parameter: The Advanced Billing id
336
+ # of the customer or the subscription for which the metadata applies
337
337
  # @param [String] name Optional parameter: Name of field to be removed.
338
338
  # @param [Array[String]] names Optional parameter: Names of fields to be
339
339
  # removed. Use in query:
@@ -358,10 +358,10 @@ module AdvancedBilling
358
358
  .auth(Single.new('BasicAuth'))
359
359
  .array_serialization_format(ArraySerializationFormat::UN_INDEXED))
360
360
  .response(new_response_handler
361
- .is_response_void(true)
362
- .local_error_template('404',
363
- 'Not Found:\'{$response.body}\'',
364
- APIException))
361
+ .is_response_void(true)
362
+ .local_error_template('404',
363
+ 'Not Found:\'{$response.body}\'',
364
+ APIException))
365
365
  .execute
366
366
  end
367
367
 
@@ -440,8 +440,8 @@ module AdvancedBilling
440
440
  .auth(Single.new('BasicAuth'))
441
441
  .array_serialization_format(ArraySerializationFormat::UN_INDEXED))
442
442
  .response(new_response_handler
443
- .deserializer(APIHelper.method(:custom_type_deserializer))
444
- .deserialize_into(PaginatedMetadata.method(:from_hash)))
443
+ .deserializer(APIHelper.method(:custom_type_deserializer))
444
+ .deserialize_into(PaginatedMetadata.method(:from_hash)))
445
445
  .execute
446
446
  end
447
447
  end