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
@@ -6,8 +6,8 @@
6
6
  module AdvancedBilling
7
7
  # SubscriptionStatusController
8
8
  class SubscriptionStatusController < BaseController
9
- # Chargify offers the ability to retry collecting the balance due on a past
10
- # due Subscription without waiting for the next scheduled attempt.
9
+ # Advanced Billing offers the ability to retry collecting the balance due on
10
+ # a past due Subscription without waiting for the next scheduled attempt.
11
11
  # ## Successful Reactivation
12
12
  # The response will be `200 OK` with the updated Subscription.
13
13
  # ## Failed Reactivation
@@ -26,12 +26,12 @@ module AdvancedBilling
26
26
  .header_param(new_parameter('application/json', key: 'accept'))
27
27
  .auth(Single.new('BasicAuth')))
28
28
  .response(new_response_handler
29
- .deserializer(APIHelper.method(:custom_type_deserializer))
30
- .deserialize_into(SubscriptionResponse.method(:from_hash))
31
- .local_error_template('422',
32
- 'HTTP Response Not OK. Status code: {$statusCode}.'\
33
- ' Response: \'{$response.body}\'.',
34
- ErrorListResponseException))
29
+ .deserializer(APIHelper.method(:custom_type_deserializer))
30
+ .deserialize_into(SubscriptionResponse.method(:from_hash))
31
+ .local_error_template('422',
32
+ 'HTTP Response Not OK. Status code: {$statusCode}.'\
33
+ ' Response: \'{$response.body}\'.',
34
+ ErrorListResponseException))
35
35
  .execute
36
36
  end
37
37
 
@@ -56,15 +56,15 @@ module AdvancedBilling
56
56
  .body_serializer(proc do |param| param.to_json unless param.nil? end)
57
57
  .auth(Single.new('BasicAuth')))
58
58
  .response(new_response_handler
59
- .deserializer(APIHelper.method(:custom_type_deserializer))
60
- .deserialize_into(SubscriptionResponse.method(:from_hash))
61
- .local_error_template('404',
62
- 'Not Found:\'{$response.body}\'',
63
- APIException)
64
- .local_error_template('422',
65
- 'HTTP Response Not OK. Status code: {$statusCode}.'\
66
- ' Response: \'{$response.body}\'.',
67
- APIException))
59
+ .deserializer(APIHelper.method(:custom_type_deserializer))
60
+ .deserialize_into(SubscriptionResponse.method(:from_hash))
61
+ .local_error_template('404',
62
+ 'Not Found:\'{$response.body}\'',
63
+ APIException)
64
+ .local_error_template('422',
65
+ 'HTTP Response Not OK. Status code: {$statusCode}.'\
66
+ ' Response: \'{$response.body}\'.',
67
+ APIException))
68
68
  .execute
69
69
  end
70
70
 
@@ -91,12 +91,12 @@ module AdvancedBilling
91
91
  .header_param(new_parameter('application/json', key: 'accept'))
92
92
  .auth(Single.new('BasicAuth')))
93
93
  .response(new_response_handler
94
- .deserializer(APIHelper.method(:custom_type_deserializer))
95
- .deserialize_into(SubscriptionResponse.method(:from_hash))
96
- .local_error_template('422',
97
- 'HTTP Response Not OK. Status code: {$statusCode}.'\
98
- ' Response: \'{$response.body}\'.',
99
- ErrorListResponseException))
94
+ .deserializer(APIHelper.method(:custom_type_deserializer))
95
+ .deserialize_into(SubscriptionResponse.method(:from_hash))
96
+ .local_error_template('422',
97
+ 'HTTP Response Not OK. Status code: {$statusCode}.'\
98
+ ' Response: \'{$response.body}\'.',
99
+ ErrorListResponseException))
100
100
  .execute
101
101
  end
102
102
 
@@ -124,12 +124,12 @@ module AdvancedBilling
124
124
  .body_serializer(proc do |param| param.to_json unless param.nil? end)
125
125
  .auth(Single.new('BasicAuth')))
126
126
  .response(new_response_handler
127
- .deserializer(APIHelper.method(:custom_type_deserializer))
128
- .deserialize_into(SubscriptionResponse.method(:from_hash))
129
- .local_error_template('422',
130
- 'HTTP Response Not OK. Status code: {$statusCode}.'\
131
- ' Response: \'{$response.body}\'.',
132
- ErrorListResponseException))
127
+ .deserializer(APIHelper.method(:custom_type_deserializer))
128
+ .deserialize_into(SubscriptionResponse.method(:from_hash))
129
+ .local_error_template('422',
130
+ 'HTTP Response Not OK. Status code: {$statusCode}.'\
131
+ ' Response: \'{$response.body}\'.',
132
+ ErrorListResponseException))
133
133
  .execute
134
134
  end
135
135
 
@@ -159,24 +159,24 @@ 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
- .deserializer(APIHelper.method(:custom_type_deserializer))
163
- .deserialize_into(SubscriptionResponse.method(:from_hash))
164
- .local_error_template('422',
165
- 'HTTP Response Not OK. Status code: {$statusCode}.'\
166
- ' Response: \'{$response.body}\'.',
167
- ErrorListResponseException))
162
+ .deserializer(APIHelper.method(:custom_type_deserializer))
163
+ .deserialize_into(SubscriptionResponse.method(:from_hash))
164
+ .local_error_template('422',
165
+ 'HTTP Response Not OK. Status code: {$statusCode}.'\
166
+ ' Response: \'{$response.body}\'.',
167
+ ErrorListResponseException))
168
168
  .execute
169
169
  end
170
170
 
171
- # Chargify offers the ability to reactivate a previously canceled
171
+ # Advanced Billing offers the ability to reactivate a previously canceled
172
172
  # subscription. For details on how the reactivation works, and how to
173
173
  # reactivate subscriptions through the application, see
174
- # [reactivation](https://chargify.zendesk.com/hc/en-us/articles/440789873769
175
- # 1).
174
+ # [reactivation](https://maxio.zendesk.com/hc/en-us/articles/24252109503629-
175
+ # Reactivating-and-Resuming).
176
176
  # **Please note: The term
177
- # "resume" is used also during another process in Chargify. This occurs when
178
- # an on-hold subscription is "resumed". This returns the subscription to an
179
- # active state.**
177
+ # "resume" is used also during another process in Advanced Billing. This
178
+ # occurs when an on-hold subscription is "resumed". This returns the
179
+ # subscription to an active state.**
180
180
  # + The response returns the subscription object in the `active` or
181
181
  # `trialing` state.
182
182
  # + The `canceled_at` and `cancellation_message` fields do not have values.
@@ -194,12 +194,12 @@ module AdvancedBilling
194
194
  # Consider a subscription which was created on June 1st, and would renew on
195
195
  # July 1st. The subscription is then canceled on June 15.
196
196
  # If a reactivation with `resume: true` were attempted _before_ what would
197
- # have been the next billing date of July 1st, then Chargify would resume
198
- # the subscription.
197
+ # have been the next billing date of July 1st, then Advanced Billing would
198
+ # resume the subscription.
199
199
  # If a reactivation with `resume: true` were attempted _after_ what would
200
- # have been the next billing date of July 1st, then Chargify would not
201
- # resume the subscription, and instead it would be reactivated with a new
202
- # billing period.
200
+ # have been the next billing date of July 1st, then Advanced Billing would
201
+ # not resume the subscription, and instead it would be reactivated with a
202
+ # new billing period.
203
203
  # | Canceled | Reactivation | Resumable? |
204
204
  # |---|---|---|
205
205
  # | Jun 15 | June 28 | Yes |
@@ -325,17 +325,17 @@ module AdvancedBilling
325
325
  .body_serializer(proc do |param| param.to_json unless param.nil? end)
326
326
  .auth(Single.new('BasicAuth')))
327
327
  .response(new_response_handler
328
- .deserializer(APIHelper.method(:custom_type_deserializer))
329
- .deserialize_into(SubscriptionResponse.method(:from_hash))
330
- .local_error_template('422',
331
- 'HTTP Response Not OK. Status code: {$statusCode}.'\
332
- ' Response: \'{$response.body}\'.',
333
- ErrorListResponseException))
328
+ .deserializer(APIHelper.method(:custom_type_deserializer))
329
+ .deserialize_into(SubscriptionResponse.method(:from_hash))
330
+ .local_error_template('422',
331
+ 'HTTP Response Not OK. Status code: {$statusCode}.'\
332
+ ' Response: \'{$response.body}\'.',
333
+ ErrorListResponseException))
334
334
  .execute
335
335
  end
336
336
 
337
- # Chargify offers the ability to cancel a subscription at the end of the
338
- # current billing period. This period is set by its current product.
337
+ # Advanced Billing offers the ability to cancel a subscription at the end of
338
+ # the current billing period. This period is set by its current product.
339
339
  # Requesting to cancel the subscription at the end of the period sets the
340
340
  # `cancel_at_end_of_period` flag to true.
341
341
  # Note that you cannot set `cancel_at_end_of_period` at subscription
@@ -359,11 +359,11 @@ module AdvancedBilling
359
359
  .body_serializer(proc do |param| param.to_json unless param.nil? end)
360
360
  .auth(Single.new('BasicAuth')))
361
361
  .response(new_response_handler
362
- .deserializer(APIHelper.method(:custom_type_deserializer))
363
- .deserialize_into(DelayedCancellationResponse.method(:from_hash))
364
- .local_error_template('404',
365
- 'Not Found:\'{$response.body}\'',
366
- APIException))
362
+ .deserializer(APIHelper.method(:custom_type_deserializer))
363
+ .deserialize_into(DelayedCancellationResponse.method(:from_hash))
364
+ .local_error_template('404',
365
+ 'Not Found:\'{$response.body}\'',
366
+ APIException))
367
367
  .execute
368
368
  end
369
369
 
@@ -387,11 +387,11 @@ module AdvancedBilling
387
387
  .header_param(new_parameter('application/json', key: 'accept'))
388
388
  .auth(Single.new('BasicAuth')))
389
389
  .response(new_response_handler
390
- .deserializer(APIHelper.method(:custom_type_deserializer))
391
- .deserialize_into(DelayedCancellationResponse.method(:from_hash))
392
- .local_error_template('404',
393
- 'Not Found:\'{$response.body}\'',
394
- APIException))
390
+ .deserializer(APIHelper.method(:custom_type_deserializer))
391
+ .deserialize_into(DelayedCancellationResponse.method(:from_hash))
392
+ .local_error_template('404',
393
+ 'Not Found:\'{$response.body}\'',
394
+ APIException))
395
395
  .execute
396
396
  end
397
397
 
@@ -411,8 +411,8 @@ module AdvancedBilling
411
411
  .header_param(new_parameter('application/json', key: 'accept'))
412
412
  .auth(Single.new('BasicAuth')))
413
413
  .response(new_response_handler
414
- .deserializer(APIHelper.method(:custom_type_deserializer))
415
- .deserialize_into(SubscriptionResponse.method(:from_hash)))
414
+ .deserializer(APIHelper.method(:custom_type_deserializer))
415
+ .deserialize_into(SubscriptionResponse.method(:from_hash)))
416
416
  .execute
417
417
  end
418
418
 
@@ -423,8 +423,8 @@ module AdvancedBilling
423
423
  # The "Next Billing" amount and "Next Billing" date are already represented
424
424
  # in the UI on each Subscriber's Summary. For more information, please see
425
425
  # our documentation
426
- # [here](https://chargify.zendesk.com/hc/en-us/articles/4407884887835#next-b
427
- # illing).
426
+ # [here](https://maxio.zendesk.com/hc/en-us/articles/24252493695757-Subscrib
427
+ # er-Interface-Overview).
428
428
  # ## Optional Component Fields
429
429
  # This endpoint is particularly useful due to the fact that it will return
430
430
  # the computed billing amount for the base product and the components which
@@ -467,12 +467,12 @@ module AdvancedBilling
467
467
  .body_serializer(proc do |param| param.to_json unless param.nil? end)
468
468
  .auth(Single.new('BasicAuth')))
469
469
  .response(new_response_handler
470
- .deserializer(APIHelper.method(:custom_type_deserializer))
471
- .deserialize_into(RenewalPreviewResponse.method(:from_hash))
472
- .local_error_template('422',
473
- 'HTTP Response Not OK. Status code: {$statusCode}.'\
474
- ' Response: \'{$response.body}\'.',
475
- ErrorListResponseException))
470
+ .deserializer(APIHelper.method(:custom_type_deserializer))
471
+ .deserialize_into(RenewalPreviewResponse.method(:from_hash))
472
+ .local_error_template('422',
473
+ 'HTTP Response Not OK. Status code: {$statusCode}.'\
474
+ ' Response: \'{$response.body}\'.',
475
+ ErrorListResponseException))
476
476
  .execute
477
477
  end
478
478
  end