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
@@ -32,12 +32,12 @@ module AdvancedBilling
32
32
  .body_serializer(proc do |param| param.to_json unless param.nil? end)
33
33
  .auth(Single.new('BasicAuth')))
34
34
  .response(new_response_handler
35
- .deserializer(APIHelper.method(:custom_type_deserializer))
36
- .deserialize_into(Invoice.method(:from_hash))
37
- .local_error_template('422',
38
- 'HTTP Response Not OK. Status code: {$statusCode}.'\
39
- ' Response: \'{$response.body}\'.',
40
- ErrorListResponseException))
35
+ .deserializer(APIHelper.method(:custom_type_deserializer))
36
+ .deserialize_into(Invoice.method(:from_hash))
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
 
@@ -148,8 +148,8 @@ module AdvancedBilling
148
148
  .auth(Single.new('BasicAuth'))
149
149
  .array_serialization_format(ArraySerializationFormat::CSV))
150
150
  .response(new_response_handler
151
- .deserializer(APIHelper.method(:custom_type_deserializer))
152
- .deserialize_into(ListInvoicesResponse.method(:from_hash)))
151
+ .deserializer(APIHelper.method(:custom_type_deserializer))
152
+ .deserialize_into(ListInvoicesResponse.method(:from_hash)))
153
153
  .execute
154
154
  end
155
155
 
@@ -179,8 +179,8 @@ module AdvancedBilling
179
179
  .header_param(new_parameter('application/json', key: 'accept'))
180
180
  .auth(Single.new('BasicAuth')))
181
181
  .response(new_response_handler
182
- .deserializer(APIHelper.method(:custom_type_deserializer))
183
- .deserialize_into(Invoice.method(:from_hash)))
182
+ .deserializer(APIHelper.method(:custom_type_deserializer))
183
+ .deserialize_into(Invoice.method(:from_hash)))
184
184
  .execute
185
185
  end
186
186
 
@@ -253,8 +253,8 @@ module AdvancedBilling
253
253
  .auth(Single.new('BasicAuth'))
254
254
  .array_serialization_format(ArraySerializationFormat::CSV))
255
255
  .response(new_response_handler
256
- .deserializer(APIHelper.method(:custom_type_deserializer))
257
- .deserialize_into(ListInvoiceEventsResponse.method(:from_hash)))
256
+ .deserializer(APIHelper.method(:custom_type_deserializer))
257
+ .deserialize_into(ListInvoiceEventsResponse.method(:from_hash)))
258
258
  .execute
259
259
  end
260
260
 
@@ -299,12 +299,12 @@ module AdvancedBilling
299
299
  # }
300
300
  # }
301
301
  # ```
302
- # Note that Chargify will attempt to fully pay the invoice's `due_amount`
303
- # from the Subscription's Service Credit account. At this time, partial
304
- # payments from a Service Credit Account are only allowed for consolidated
305
- # invoices (subscription groups). Therefore, for normal invoices the Service
306
- # Credit account balance must be greater than or equal to the invoice's
307
- # `due_amount`.
302
+ # Note that Advanced Billing will attempt to fully pay the invoice's
303
+ # `due_amount` from the Subscription's Service Credit account. At this time,
304
+ # partial payments from a Service Credit Account are only allowed for
305
+ # consolidated invoices (subscription groups). Therefore, for normal
306
+ # invoices the Service Credit account balance must be greater than or equal
307
+ # to the invoice's `due_amount`.
308
308
  # @param [String] uid Required parameter: The unique identifier for the
309
309
  # invoice, this does not refer to the public facing invoice number.
310
310
  # @param [CreateInvoicePaymentRequest] body Optional parameter: Example:
@@ -324,12 +324,12 @@ module AdvancedBilling
324
324
  .body_serializer(proc do |param| param.to_json unless param.nil? end)
325
325
  .auth(Single.new('BasicAuth')))
326
326
  .response(new_response_handler
327
- .deserializer(APIHelper.method(:custom_type_deserializer))
328
- .deserialize_into(Invoice.method(:from_hash))
329
- .local_error_template('422',
330
- 'HTTP Response Not OK. Status code: {$statusCode}.'\
331
- ' Response: \'{$response.body}\'.',
332
- ErrorListResponseException))
327
+ .deserializer(APIHelper.method(:custom_type_deserializer))
328
+ .deserialize_into(Invoice.method(:from_hash))
329
+ .local_error_template('422',
330
+ 'HTTP Response Not OK. Status code: {$statusCode}.'\
331
+ ' Response: \'{$response.body}\'.',
332
+ ErrorListResponseException))
333
333
  .execute
334
334
  end
335
335
 
@@ -373,12 +373,12 @@ module AdvancedBilling
373
373
  .body_serializer(proc do |param| param.to_json unless param.nil? end)
374
374
  .auth(Single.new('BasicAuth')))
375
375
  .response(new_response_handler
376
- .deserializer(APIHelper.method(:custom_type_deserializer))
377
- .deserialize_into(MultiInvoicePaymentResponse.method(:from_hash))
378
- .local_error_template('422',
379
- 'HTTP Response Not OK. Status code: {$statusCode}.'\
380
- ' Response: \'{$response.body}\'.',
381
- ErrorListResponseException))
376
+ .deserializer(APIHelper.method(:custom_type_deserializer))
377
+ .deserialize_into(MultiInvoicePaymentResponse.method(:from_hash))
378
+ .local_error_template('422',
379
+ 'HTTP Response Not OK. Status code: {$statusCode}.'\
380
+ ' Response: \'{$response.body}\'.',
381
+ ErrorListResponseException))
382
382
  .execute
383
383
  end
384
384
 
@@ -389,7 +389,7 @@ module AdvancedBilling
389
389
  # `refunds`. To include these arrays, pass the specific field as a key in
390
390
  # the query with a value set to `true`.
391
391
  # @param [Integer] subscription_id Optional parameter: The subscription's
392
- # Chargify id
392
+ # Advanced Billing id
393
393
  # @param [Integer] page Optional parameter: Result records are organized in
394
394
  # pages. By default, the first page of results is displayed. The page
395
395
  # parameter specifies a page number of results to fetch. You can start
@@ -428,8 +428,8 @@ module AdvancedBilling
428
428
  .header_param(new_parameter('application/json', key: 'accept'))
429
429
  .auth(Single.new('BasicAuth')))
430
430
  .response(new_response_handler
431
- .deserializer(APIHelper.method(:custom_type_deserializer))
432
- .deserialize_into(ListCreditNotesResponse.method(:from_hash)))
431
+ .deserializer(APIHelper.method(:custom_type_deserializer))
432
+ .deserialize_into(ListCreditNotesResponse.method(:from_hash)))
433
433
  .execute
434
434
  end
435
435
 
@@ -448,8 +448,8 @@ module AdvancedBilling
448
448
  .header_param(new_parameter('application/json', key: 'accept'))
449
449
  .auth(Single.new('BasicAuth')))
450
450
  .response(new_response_handler
451
- .deserializer(APIHelper.method(:custom_type_deserializer))
452
- .deserialize_into(CreditNote.method(:from_hash)))
451
+ .deserializer(APIHelper.method(:custom_type_deserializer))
452
+ .deserialize_into(CreditNote.method(:from_hash)))
453
453
  .execute
454
454
  end
455
455
 
@@ -480,12 +480,12 @@ module AdvancedBilling
480
480
  .body_serializer(proc do |param| param.to_json unless param.nil? end)
481
481
  .auth(Single.new('BasicAuth')))
482
482
  .response(new_response_handler
483
- .deserializer(APIHelper.method(:custom_type_deserializer))
484
- .deserialize_into(RecordPaymentResponse.method(:from_hash))
485
- .local_error_template('422',
486
- 'HTTP Response Not OK. Status code: {$statusCode}.'\
487
- ' Response: \'{$response.body}\'.',
488
- ErrorListResponseException))
483
+ .deserializer(APIHelper.method(:custom_type_deserializer))
484
+ .deserialize_into(RecordPaymentResponse.method(:from_hash))
485
+ .local_error_template('422',
486
+ 'HTTP Response Not OK. Status code: {$statusCode}.'\
487
+ ' Response: \'{$response.body}\'.',
488
+ ErrorListResponseException))
489
489
  .execute
490
490
  end
491
491
 
@@ -521,15 +521,15 @@ module AdvancedBilling
521
521
  .header_param(new_parameter('application/json', key: 'accept'))
522
522
  .auth(Single.new('BasicAuth')))
523
523
  .response(new_response_handler
524
- .deserializer(APIHelper.method(:custom_type_deserializer))
525
- .deserialize_into(Invoice.method(:from_hash))
526
- .local_error_template('404',
527
- 'Not Found:\'{$response.body}\'',
528
- APIException)
529
- .local_error_template('422',
530
- 'HTTP Response Not OK. Status code: {$statusCode}.'\
531
- ' Response: \'{$response.body}\'.',
532
- ErrorListResponseException))
524
+ .deserializer(APIHelper.method(:custom_type_deserializer))
525
+ .deserialize_into(Invoice.method(:from_hash))
526
+ .local_error_template('404',
527
+ 'Not Found:\'{$response.body}\'',
528
+ APIException)
529
+ .local_error_template('422',
530
+ 'HTTP Response Not OK. Status code: {$statusCode}.'\
531
+ ' Response: \'{$response.body}\'.',
532
+ ErrorListResponseException))
533
533
  .execute
534
534
  end
535
535
 
@@ -555,15 +555,15 @@ module AdvancedBilling
555
555
  .body_serializer(proc do |param| param.to_json unless param.nil? end)
556
556
  .auth(Single.new('BasicAuth')))
557
557
  .response(new_response_handler
558
- .deserializer(APIHelper.method(:custom_type_deserializer))
559
- .deserialize_into(Invoice.method(:from_hash))
560
- .local_error_template('404',
561
- 'Not Found:\'{$response.body}\'',
562
- APIException)
563
- .local_error_template('422',
564
- 'HTTP Response Not OK. Status code: {$statusCode}.'\
565
- ' Response: \'{$response.body}\'.',
566
- ErrorListResponseException))
558
+ .deserializer(APIHelper.method(:custom_type_deserializer))
559
+ .deserialize_into(Invoice.method(:from_hash))
560
+ .local_error_template('404',
561
+ 'Not Found:\'{$response.body}\'',
562
+ APIException)
563
+ .local_error_template('422',
564
+ 'HTTP Response Not OK. Status code: {$statusCode}.'\
565
+ ' Response: \'{$response.body}\'.',
566
+ ErrorListResponseException))
567
567
  .execute
568
568
  end
569
569
 
@@ -600,8 +600,8 @@ module AdvancedBilling
600
600
  .header_param(new_parameter('application/json', key: 'accept'))
601
601
  .auth(Single.new('BasicAuth')))
602
602
  .response(new_response_handler
603
- .deserializer(APIHelper.method(:custom_type_deserializer))
604
- .deserialize_into(ConsolidatedInvoice.method(:from_hash)))
603
+ .deserializer(APIHelper.method(:custom_type_deserializer))
604
+ .deserialize_into(ConsolidatedInvoice.method(:from_hash)))
605
605
  .execute
606
606
  end
607
607
 
@@ -788,12 +788,12 @@ module AdvancedBilling
788
788
  .body_serializer(proc do |param| param.to_json unless param.nil? end)
789
789
  .auth(Single.new('BasicAuth')))
790
790
  .response(new_response_handler
791
- .deserializer(APIHelper.method(:custom_type_deserializer))
792
- .deserialize_into(InvoiceResponse.method(:from_hash))
793
- .local_error_template('422',
794
- 'HTTP Response Not OK. Status code: {$statusCode}.'\
795
- ' Response: \'{$response.body}\'.',
796
- ErrorArrayMapResponseException))
791
+ .deserializer(APIHelper.method(:custom_type_deserializer))
792
+ .deserialize_into(InvoiceResponse.method(:from_hash))
793
+ .local_error_template('422',
794
+ 'HTTP Response Not OK. Status code: {$statusCode}.'\
795
+ ' Response: \'{$response.body}\'.',
796
+ ErrorArrayMapResponseException))
797
797
  .execute
798
798
  end
799
799
 
@@ -829,11 +829,11 @@ module AdvancedBilling
829
829
  .body_serializer(proc do |param| param.to_json unless param.nil? end)
830
830
  .auth(Single.new('BasicAuth')))
831
831
  .response(new_response_handler
832
- .is_response_void(true)
833
- .local_error_template('422',
834
- 'HTTP Response Not OK. Status code: {$statusCode}.'\
835
- ' Response: \'{$response.body}\'.',
836
- ErrorListResponseException))
832
+ .is_response_void(true)
833
+ .local_error_template('422',
834
+ 'HTTP Response Not OK. Status code: {$statusCode}.'\
835
+ ' Response: \'{$response.body}\'.',
836
+ ErrorListResponseException))
837
837
  .execute
838
838
  end
839
839
 
@@ -857,15 +857,15 @@ module AdvancedBilling
857
857
  .header_param(new_parameter('application/json', key: 'accept'))
858
858
  .auth(Single.new('BasicAuth')))
859
859
  .response(new_response_handler
860
- .deserializer(APIHelper.method(:custom_type_deserializer))
861
- .deserialize_into(CustomerChangesPreviewResponse.method(:from_hash))
862
- .local_error_template('404',
863
- 'Not Found:\'{$response.body}\'',
864
- ErrorListResponseException)
865
- .local_error_template('422',
866
- 'HTTP Response Not OK. Status code: {$statusCode}.'\
867
- ' Response: \'{$response.body}\'.',
868
- ErrorListResponseException))
860
+ .deserializer(APIHelper.method(:custom_type_deserializer))
861
+ .deserialize_into(CustomerChangesPreviewResponse.method(:from_hash))
862
+ .local_error_template('404',
863
+ 'Not Found:\'{$response.body}\'',
864
+ ErrorListResponseException)
865
+ .local_error_template('422',
866
+ 'HTTP Response Not OK. Status code: {$statusCode}.'\
867
+ ' Response: \'{$response.body}\'.',
868
+ ErrorListResponseException))
869
869
  .execute
870
870
  end
871
871
 
@@ -889,15 +889,15 @@ module AdvancedBilling
889
889
  .header_param(new_parameter('application/json', key: 'accept'))
890
890
  .auth(Single.new('BasicAuth')))
891
891
  .response(new_response_handler
892
- .deserializer(APIHelper.method(:custom_type_deserializer))
893
- .deserialize_into(Invoice.method(:from_hash))
894
- .local_error_template('404',
895
- 'Not Found:\'{$response.body}\'',
896
- ErrorListResponseException)
897
- .local_error_template('422',
898
- 'HTTP Response Not OK. Status code: {$statusCode}.'\
899
- ' Response: \'{$response.body}\'.',
900
- ErrorListResponseException))
892
+ .deserializer(APIHelper.method(:custom_type_deserializer))
893
+ .deserialize_into(Invoice.method(:from_hash))
894
+ .local_error_template('404',
895
+ 'Not Found:\'{$response.body}\'',
896
+ ErrorListResponseException)
897
+ .local_error_template('422',
898
+ 'HTTP Response Not OK. Status code: {$statusCode}.'\
899
+ ' Response: \'{$response.body}\'.',
900
+ ErrorListResponseException))
901
901
  .execute
902
902
  end
903
903
 
@@ -947,15 +947,15 @@ module AdvancedBilling
947
947
  .body_serializer(proc do |param| param.to_json unless param.nil? end)
948
948
  .auth(Single.new('BasicAuth')))
949
949
  .response(new_response_handler
950
- .deserializer(APIHelper.method(:custom_type_deserializer))
951
- .deserialize_into(Invoice.method(:from_hash))
952
- .local_error_template('404',
953
- 'Not Found:\'{$response.body}\'',
954
- APIException)
955
- .local_error_template('422',
956
- 'HTTP Response Not OK. Status code: {$statusCode}.'\
957
- ' Response: \'{$response.body}\'.',
958
- ErrorListResponseException))
950
+ .deserializer(APIHelper.method(:custom_type_deserializer))
951
+ .deserialize_into(Invoice.method(:from_hash))
952
+ .local_error_template('404',
953
+ 'Not Found:\'{$response.body}\'',
954
+ APIException)
955
+ .local_error_template('422',
956
+ 'HTTP Response Not OK. Status code: {$statusCode}.'\
957
+ ' Response: \'{$response.body}\'.',
958
+ ErrorListResponseException))
959
959
  .execute
960
960
  end
961
961
  end
@@ -6,15 +6,18 @@
6
6
  module AdvancedBilling
7
7
  # OffersController
8
8
  class OffersController < BaseController
9
- # Create an offer within your Chargify site by sending a POST request.
9
+ # Create an offer within your Advanced Billing site by sending a POST
10
+ # request.
10
11
  # ## Documentation
11
12
  # Offers allow you to package complicated combinations of products,
12
13
  # components and coupons into a convenient package which can then be
13
14
  # subscribed to just like products.
14
15
  # Once an offer is defined it can be used as an alternative to the product
15
16
  # when creating subscriptions.
16
- # Full documentation on how to use offers in the Chargify UI can be located
17
- # [here](https://chargify.zendesk.com/hc/en-us/articles/4407753852059).
17
+ # Full documentation on how to use offers in the Advanced Billing UI can be
18
+ # located
19
+ # [here](https://maxio.zendesk.com/hc/en-us/articles/24261295098637-Offers-O
20
+ # verview).
18
21
  # ## Using a Product Price Point
19
22
  # You can optionally pass in a `product_price_point_id` that corresponds
20
23
  # with the `product_id` and the offer will use that price point. If a
@@ -33,12 +36,12 @@ module AdvancedBilling
33
36
  .body_serializer(proc do |param| param.to_json unless param.nil? end)
34
37
  .auth(Single.new('BasicAuth')))
35
38
  .response(new_response_handler
36
- .deserializer(APIHelper.method(:custom_type_deserializer))
37
- .deserialize_into(OfferResponse.method(:from_hash))
38
- .local_error_template('422',
39
- 'HTTP Response Not OK. Status code: {$statusCode}.'\
40
- ' Response: \'{$response.body}\'.',
41
- ErrorArrayMapResponseException))
39
+ .deserializer(APIHelper.method(:custom_type_deserializer))
40
+ .deserialize_into(OfferResponse.method(:from_hash))
41
+ .local_error_template('422',
42
+ 'HTTP Response Not OK. Status code: {$statusCode}.'\
43
+ ' Response: \'{$response.body}\'.',
44
+ ErrorArrayMapResponseException))
42
45
  .execute
43
46
  end
44
47
 
@@ -68,8 +71,8 @@ module AdvancedBilling
68
71
  .header_param(new_parameter('application/json', key: 'accept'))
69
72
  .auth(Single.new('BasicAuth')))
70
73
  .response(new_response_handler
71
- .deserializer(APIHelper.method(:custom_type_deserializer))
72
- .deserialize_into(ListOffersResponse.method(:from_hash)))
74
+ .deserializer(APIHelper.method(:custom_type_deserializer))
75
+ .deserialize_into(ListOffersResponse.method(:from_hash)))
73
76
  .execute
74
77
  end
75
78
 
@@ -89,8 +92,8 @@ module AdvancedBilling
89
92
  .header_param(new_parameter('application/json', key: 'accept'))
90
93
  .auth(Single.new('BasicAuth')))
91
94
  .response(new_response_handler
92
- .deserializer(APIHelper.method(:custom_type_deserializer))
93
- .deserialize_into(OfferResponse.method(:from_hash)))
95
+ .deserializer(APIHelper.method(:custom_type_deserializer))
96
+ .deserialize_into(OfferResponse.method(:from_hash)))
94
97
  .execute
95
98
  end
96
99
 
@@ -109,7 +112,7 @@ module AdvancedBilling
109
112
  .should_encode(true))
110
113
  .auth(Single.new('BasicAuth')))
111
114
  .response(new_response_handler
112
- .is_response_void(true))
115
+ .is_response_void(true))
113
116
  .execute
114
117
  end
115
118
 
@@ -128,7 +131,7 @@ module AdvancedBilling
128
131
  .should_encode(true))
129
132
  .auth(Single.new('BasicAuth')))
130
133
  .response(new_response_handler
131
- .is_response_void(true))
134
+ .is_response_void(true))
132
135
  .execute
133
136
  end
134
137
  end