maxio-advanced-billing-sdk 1.0.0 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (516) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +59 -297
  3. data/lib/advanced_billing/client.rb +21 -22
  4. data/lib/advanced_billing/configuration.rb +17 -18
  5. data/lib/advanced_billing/controllers/advance_invoice_controller.rb +8 -10
  6. data/lib/advanced_billing/controllers/api_exports_controller.rb +9 -9
  7. data/lib/advanced_billing/controllers/base_controller.rb +2 -1
  8. data/lib/advanced_billing/controllers/billing_portal_controller.rb +4 -4
  9. data/lib/advanced_billing/controllers/components_controller.rb +22 -22
  10. data/lib/advanced_billing/controllers/coupons_controller.rb +14 -14
  11. data/lib/advanced_billing/controllers/custom_fields_controller.rb +9 -9
  12. data/lib/advanced_billing/controllers/customers_controller.rb +7 -7
  13. data/lib/advanced_billing/controllers/events_based_billing_segments_controller.rb +6 -6
  14. data/lib/advanced_billing/controllers/events_controller.rb +3 -3
  15. data/lib/advanced_billing/controllers/insights_controller.rb +4 -4
  16. data/lib/advanced_billing/controllers/invoices_controller.rb +24 -20
  17. data/lib/advanced_billing/controllers/offers_controller.rb +5 -5
  18. data/lib/advanced_billing/controllers/payment_profiles_controller.rb +12 -12
  19. data/lib/advanced_billing/controllers/product_families_controller.rb +4 -4
  20. data/lib/advanced_billing/controllers/product_price_points_controller.rb +11 -11
  21. data/lib/advanced_billing/controllers/products_controller.rb +6 -6
  22. data/lib/advanced_billing/controllers/proforma_invoices_controller.rb +44 -25
  23. data/lib/advanced_billing/controllers/reason_codes_controller.rb +5 -5
  24. data/lib/advanced_billing/controllers/referral_codes_controller.rb +2 -2
  25. data/lib/advanced_billing/controllers/sales_commissions_controller.rb +3 -3
  26. data/lib/advanced_billing/controllers/sites_controller.rb +3 -3
  27. data/lib/advanced_billing/controllers/subscription_components_controller.rb +37 -31
  28. data/lib/advanced_billing/controllers/subscription_group_invoice_account_controller.rb +4 -4
  29. data/lib/advanced_billing/controllers/subscription_group_status_controller.rb +4 -4
  30. data/lib/advanced_billing/controllers/subscription_groups_controller.rb +23 -16
  31. data/lib/advanced_billing/controllers/subscription_invoice_account_controller.rb +11 -7
  32. data/lib/advanced_billing/controllers/subscription_notes_controller.rb +5 -5
  33. data/lib/advanced_billing/controllers/subscription_products_controller.rb +2 -2
  34. data/lib/advanced_billing/controllers/subscription_status_controller.rb +10 -10
  35. data/lib/advanced_billing/controllers/subscriptions_controller.rb +12 -12
  36. data/lib/advanced_billing/controllers/webhooks_controller.rb +8 -8
  37. data/lib/advanced_billing/exceptions/subscription_group_create_error_response_exception.rb +34 -0
  38. data/lib/advanced_billing/http/auth/basic_auth.rb +27 -6
  39. data/lib/advanced_billing/models/account_balance.rb +44 -3
  40. data/lib/advanced_billing/models/account_balances.rb +24 -2
  41. data/lib/advanced_billing/models/ach_agreement.rb +12 -2
  42. data/lib/advanced_billing/models/activate_subscription_request.rb +12 -2
  43. data/lib/advanced_billing/models/add_coupons_request.rb +12 -2
  44. data/lib/advanced_billing/models/add_subscription_to_a_group.rb +12 -2
  45. data/lib/advanced_billing/models/address_change.rb +12 -2
  46. data/lib/advanced_billing/models/agreement_acceptance.rb +12 -2
  47. data/lib/advanced_billing/models/allocate_components.rb +12 -2
  48. data/lib/advanced_billing/models/allocation.rb +56 -2
  49. data/lib/advanced_billing/models/allocation_expiration_date.rb +23 -4
  50. data/lib/advanced_billing/models/allocation_preview.rb +33 -6
  51. data/lib/advanced_billing/models/allocation_preview_item.rb +12 -2
  52. data/lib/advanced_billing/models/allocation_preview_line_item.rb +12 -2
  53. data/lib/advanced_billing/models/allocation_preview_response.rb +12 -2
  54. data/lib/advanced_billing/models/allocation_response.rb +12 -2
  55. data/lib/advanced_billing/models/allocation_settings.rb +12 -2
  56. data/lib/advanced_billing/models/applied_credit_note_data.rb +12 -2
  57. data/lib/advanced_billing/models/apply_credit_note_event_data.rb +12 -2
  58. data/lib/advanced_billing/models/apply_debit_note_event_data.rb +12 -2
  59. data/lib/advanced_billing/models/apply_payment_event_data.rb +12 -2
  60. data/lib/advanced_billing/models/attribute_error.rb +12 -2
  61. data/lib/advanced_billing/models/auto_resume.rb +12 -2
  62. data/lib/advanced_billing/models/bank_account_attributes.rb +12 -2
  63. data/lib/advanced_billing/models/bank_account_payment_profile.rb +13 -2
  64. data/lib/advanced_billing/models/bank_account_response.rb +12 -2
  65. data/lib/advanced_billing/models/bank_account_verification.rb +12 -2
  66. data/lib/advanced_billing/models/bank_account_verification_request.rb +12 -2
  67. data/lib/advanced_billing/models/base_refund_error.rb +12 -2
  68. data/lib/advanced_billing/models/base_string_error.rb +12 -2
  69. data/lib/advanced_billing/models/batch_job.rb +33 -6
  70. data/lib/advanced_billing/models/batch_job_response.rb +12 -2
  71. data/lib/advanced_billing/models/billing_address.rb +12 -2
  72. data/lib/advanced_billing/models/billing_manifest.rb +33 -6
  73. data/lib/advanced_billing/models/billing_manifest_item.rb +12 -2
  74. data/lib/advanced_billing/models/billing_schedule.rb +12 -2
  75. data/lib/advanced_billing/models/breakouts.rb +12 -2
  76. data/lib/advanced_billing/models/{bulk_component_s_price_point_assignment.rb → bulk_components_price_point_assignment.rb} +16 -6
  77. data/lib/advanced_billing/models/bulk_create_product_price_points_request.rb +12 -2
  78. data/lib/advanced_billing/models/bulk_create_product_price_points_response.rb +12 -2
  79. data/lib/advanced_billing/models/bulk_create_segments.rb +12 -2
  80. data/lib/advanced_billing/models/bulk_update_segments.rb +12 -2
  81. data/lib/advanced_billing/models/bulk_update_segments_item.rb +12 -2
  82. data/lib/advanced_billing/models/calendar_billing.rb +12 -2
  83. data/lib/advanced_billing/models/cancel_grouped_subscriptions_request.rb +12 -2
  84. data/lib/advanced_billing/models/cancellation_options.rb +12 -2
  85. data/lib/advanced_billing/models/cancellation_request.rb +12 -2
  86. data/lib/advanced_billing/models/change_invoice_collection_method_event_data.rb +12 -2
  87. data/lib/advanced_billing/models/chargify_ebb.rb +33 -6
  88. data/lib/advanced_billing/models/component.rb +22 -4
  89. data/lib/advanced_billing/models/component_allocation_change.rb +12 -2
  90. data/lib/advanced_billing/models/component_allocation_error_item.rb +12 -2
  91. data/lib/advanced_billing/models/component_cost_data.rb +12 -2
  92. data/lib/advanced_billing/models/component_cost_data_rate_tier.rb +12 -2
  93. data/lib/advanced_billing/models/component_currency_price.rb +12 -2
  94. data/lib/advanced_billing/models/component_currency_prices_response.rb +12 -2
  95. data/lib/advanced_billing/models/component_custom_price.rb +12 -2
  96. data/lib/advanced_billing/models/component_price.rb +12 -2
  97. data/lib/advanced_billing/models/component_price_point.rb +12 -2
  98. data/lib/advanced_billing/models/{component_s_price_point_assignment.rb → component_price_point_assignment.rb} +17 -7
  99. data/lib/advanced_billing/models/component_price_point_error_item.rb +12 -2
  100. data/lib/advanced_billing/models/component_price_point_item.rb +12 -2
  101. data/lib/advanced_billing/models/component_price_point_response.rb +12 -2
  102. data/lib/advanced_billing/models/component_price_points_response.rb +12 -2
  103. data/lib/advanced_billing/models/component_response.rb +12 -2
  104. data/lib/advanced_billing/models/consolidated_invoice.rb +12 -2
  105. data/lib/advanced_billing/models/count_response.rb +12 -2
  106. data/lib/advanced_billing/models/coupon.rb +78 -12
  107. data/lib/advanced_billing/models/coupon_currency.rb +12 -2
  108. data/lib/advanced_billing/models/coupon_currency_request.rb +12 -2
  109. data/lib/advanced_billing/models/coupon_currency_response.rb +12 -2
  110. data/lib/advanced_billing/models/coupon_response.rb +12 -2
  111. data/lib/advanced_billing/models/coupon_restriction.rb +12 -2
  112. data/lib/advanced_billing/models/coupon_subcodes.rb +12 -2
  113. data/lib/advanced_billing/models/coupon_subcodes_response.rb +12 -2
  114. data/lib/advanced_billing/models/coupon_usage.rb +12 -2
  115. data/lib/advanced_billing/models/create_allocation.rb +12 -2
  116. data/lib/advanced_billing/models/create_allocation_request.rb +12 -2
  117. data/lib/advanced_billing/models/create_component_price_point.rb +12 -2
  118. data/lib/advanced_billing/models/create_component_price_point_request.rb +12 -2
  119. data/lib/advanced_billing/models/create_component_price_points_request.rb +12 -2
  120. data/lib/advanced_billing/models/create_currency_price.rb +12 -2
  121. data/lib/advanced_billing/models/create_currency_prices_request.rb +12 -2
  122. data/lib/advanced_billing/models/create_customer.rb +12 -2
  123. data/lib/advanced_billing/models/create_customer_request.rb +12 -2
  124. data/lib/advanced_billing/models/create_ebb_component.rb +12 -2
  125. data/lib/advanced_billing/models/create_invoice.rb +12 -2
  126. data/lib/advanced_billing/models/create_invoice_address.rb +12 -2
  127. data/lib/advanced_billing/models/create_invoice_coupon.rb +12 -2
  128. data/lib/advanced_billing/models/create_invoice_item.rb +12 -2
  129. data/lib/advanced_billing/models/create_invoice_payment.rb +23 -2
  130. data/lib/advanced_billing/models/create_invoice_payment_application.rb +12 -2
  131. data/lib/advanced_billing/models/create_invoice_payment_request.rb +12 -2
  132. data/lib/advanced_billing/models/create_invoice_request.rb +12 -2
  133. data/lib/advanced_billing/models/create_metadata.rb +12 -2
  134. data/lib/advanced_billing/models/create_metadata_request.rb +12 -2
  135. data/lib/advanced_billing/models/create_metafield.rb +12 -2
  136. data/lib/advanced_billing/models/create_metafields_request.rb +12 -2
  137. data/lib/advanced_billing/models/create_metered_component.rb +12 -2
  138. data/lib/advanced_billing/models/create_multi_invoice_payment.rb +12 -2
  139. data/lib/advanced_billing/models/create_multi_invoice_payment_request.rb +12 -2
  140. data/lib/advanced_billing/models/create_offer.rb +12 -2
  141. data/lib/advanced_billing/models/create_offer_component.rb +12 -2
  142. data/lib/advanced_billing/models/create_offer_request.rb +12 -2
  143. data/lib/advanced_billing/models/create_on_off_component.rb +12 -2
  144. data/lib/advanced_billing/models/create_or_update_coupon.rb +12 -2
  145. data/lib/advanced_billing/models/{update_endpoint.rb → create_or_update_endpoint.rb} +14 -4
  146. data/lib/advanced_billing/models/{update_endpoint_request.rb → create_or_update_endpoint_request.rb} +15 -5
  147. data/lib/advanced_billing/models/create_or_update_flat_amount_coupon.rb +29 -2
  148. data/lib/advanced_billing/models/create_or_update_percentage_coupon.rb +29 -2
  149. data/lib/advanced_billing/models/create_or_update_product.rb +86 -4
  150. data/lib/advanced_billing/models/create_or_update_product_request.rb +12 -2
  151. data/lib/advanced_billing/models/create_or_update_segment_price.rb +12 -2
  152. data/lib/advanced_billing/models/create_payment.rb +14 -4
  153. data/lib/advanced_billing/models/create_payment_profile.rb +12 -2
  154. data/lib/advanced_billing/models/create_payment_profile_request.rb +12 -2
  155. data/lib/advanced_billing/models/create_prepaid_component.rb +12 -2
  156. data/lib/advanced_billing/models/create_prepaid_usage_component_price_point.rb +12 -2
  157. data/lib/advanced_billing/models/create_prepayment.rb +13 -3
  158. data/lib/advanced_billing/models/create_prepayment_method.rb +44 -0
  159. data/lib/advanced_billing/models/create_prepayment_request.rb +12 -2
  160. data/lib/advanced_billing/models/create_prepayment_response.rb +12 -2
  161. data/lib/advanced_billing/models/create_product_currency_price.rb +12 -2
  162. data/lib/advanced_billing/models/create_product_currency_prices_request.rb +12 -2
  163. data/lib/advanced_billing/models/create_product_family.rb +12 -2
  164. data/lib/advanced_billing/models/create_product_family_request.rb +12 -2
  165. data/lib/advanced_billing/models/create_product_price_point.rb +16 -6
  166. data/lib/advanced_billing/models/create_product_price_point_request.rb +12 -2
  167. data/lib/advanced_billing/models/create_quantity_based_component.rb +12 -2
  168. data/lib/advanced_billing/models/create_reason_code.rb +12 -2
  169. data/lib/advanced_billing/models/create_reason_code_request.rb +12 -2
  170. data/lib/advanced_billing/models/create_segment.rb +12 -2
  171. data/lib/advanced_billing/models/create_segment_request.rb +12 -2
  172. data/lib/advanced_billing/models/create_signup_proforma_preview_include.rb +20 -0
  173. data/lib/advanced_billing/models/create_subscription.rb +22 -4
  174. data/lib/advanced_billing/models/create_subscription_component.rb +12 -2
  175. data/lib/advanced_billing/models/create_subscription_group.rb +15 -20
  176. data/lib/advanced_billing/models/create_subscription_group_request.rb +12 -2
  177. data/lib/advanced_billing/models/create_subscription_request.rb +12 -2
  178. data/lib/advanced_billing/models/create_usage.rb +12 -2
  179. data/lib/advanced_billing/models/create_usage_request.rb +12 -2
  180. data/lib/advanced_billing/models/created_prepayment.rb +23 -4
  181. data/lib/advanced_billing/models/credit_account_balance_changed.rb +22 -5
  182. data/lib/advanced_billing/models/credit_card_attributes.rb +12 -2
  183. data/lib/advanced_billing/models/credit_card_payment_profile.rb +12 -2
  184. data/lib/advanced_billing/models/credit_note.rb +12 -2
  185. data/lib/advanced_billing/models/credit_note1.rb +12 -2
  186. data/lib/advanced_billing/models/credit_note_application.rb +23 -5
  187. data/lib/advanced_billing/models/credit_note_line_item.rb +38 -4
  188. data/lib/advanced_billing/models/credit_scheme_request.rb +12 -2
  189. data/lib/advanced_billing/models/currency_price.rb +12 -2
  190. data/lib/advanced_billing/models/currency_prices_response.rb +12 -2
  191. data/lib/advanced_billing/models/custom_field_value_change.rb +12 -2
  192. data/lib/advanced_billing/models/customer.rb +63 -15
  193. data/lib/advanced_billing/models/customer1.rb +13 -2
  194. data/lib/advanced_billing/models/customer_attributes.rb +12 -2
  195. data/lib/advanced_billing/models/customer_change.rb +12 -2
  196. data/lib/advanced_billing/models/customer_changes_preview_response.rb +12 -2
  197. data/lib/advanced_billing/models/customer_custom_fields_change.rb +12 -2
  198. data/lib/advanced_billing/models/customer_error.rb +12 -2
  199. data/lib/advanced_billing/models/customer_payer_change.rb +12 -2
  200. data/lib/advanced_billing/models/customer_response.rb +12 -2
  201. data/lib/advanced_billing/models/deduct_service_credit.rb +12 -2
  202. data/lib/advanced_billing/models/deduct_service_credit_request.rb +12 -2
  203. data/lib/advanced_billing/models/delayed_cancellation_response.rb +12 -2
  204. data/lib/advanced_billing/models/delete_subscription_group_response.rb +12 -2
  205. data/lib/advanced_billing/models/dunner_data.rb +29 -7
  206. data/lib/advanced_billing/models/dunning_step_data.rb +12 -2
  207. data/lib/advanced_billing/models/dunning_step_reached.rb +12 -2
  208. data/lib/advanced_billing/models/ebb_component.rb +12 -2
  209. data/lib/advanced_billing/models/ebb_event.rb +12 -2
  210. data/lib/advanced_billing/models/enable_webhooks_request.rb +12 -2
  211. data/lib/advanced_billing/models/enable_webhooks_response.rb +12 -2
  212. data/lib/advanced_billing/models/endpoint.rb +12 -2
  213. data/lib/advanced_billing/models/endpoint_response.rb +12 -2
  214. data/lib/advanced_billing/models/errors.rb +12 -2
  215. data/lib/advanced_billing/models/event.rb +23 -5
  216. data/lib/advanced_billing/models/event_based_billing_segment_error.rb +12 -2
  217. data/lib/advanced_billing/models/event_response.rb +12 -2
  218. data/lib/advanced_billing/models/full_subscription_group_response.rb +369 -11
  219. data/lib/advanced_billing/models/get_one_time_token_payment_profile.rb +12 -2
  220. data/lib/advanced_billing/models/get_one_time_token_request.rb +12 -2
  221. data/lib/advanced_billing/models/group_billing.rb +12 -2
  222. data/lib/advanced_billing/models/group_settings.rb +12 -2
  223. data/lib/advanced_billing/models/group_target.rb +12 -2
  224. data/lib/advanced_billing/models/group_type.rb +23 -0
  225. data/lib/advanced_billing/models/invoice.rb +12 -2
  226. data/lib/advanced_billing/models/invoice_address.rb +12 -2
  227. data/lib/advanced_billing/models/invoice_balance_item.rb +12 -2
  228. data/lib/advanced_billing/models/invoice_credit.rb +12 -2
  229. data/lib/advanced_billing/models/invoice_custom_field.rb +12 -2
  230. data/lib/advanced_billing/models/invoice_customer.rb +13 -2
  231. data/lib/advanced_billing/models/invoice_discount.rb +14 -4
  232. data/lib/advanced_billing/models/invoice_discount_breakout.rb +12 -2
  233. data/lib/advanced_billing/models/invoice_discount_source_type.rb +26 -0
  234. data/lib/advanced_billing/models/invoice_discount_type.rb +26 -0
  235. data/lib/advanced_billing/models/invoice_display_settings.rb +12 -2
  236. data/lib/advanced_billing/models/invoice_event.rb +23 -4
  237. data/lib/advanced_billing/models/invoice_event_data.rb +12 -2
  238. data/lib/advanced_billing/models/invoice_event_payment.rb +12 -2
  239. data/lib/advanced_billing/models/invoice_event_payment1.rb +12 -2
  240. data/lib/advanced_billing/models/invoice_issued.rb +27 -15
  241. data/lib/advanced_billing/models/invoice_line_item.rb +22 -2
  242. data/lib/advanced_billing/models/invoice_line_item_component_cost_data.rb +12 -2
  243. data/lib/advanced_billing/models/invoice_line_item_event_data.rb +12 -2
  244. data/lib/advanced_billing/models/invoice_line_item_pricing_detail.rb +12 -2
  245. data/lib/advanced_billing/models/invoice_payer.rb +12 -2
  246. data/lib/advanced_billing/models/invoice_payer_change.rb +12 -2
  247. data/lib/advanced_billing/models/invoice_payment.rb +12 -2
  248. data/lib/advanced_billing/models/invoice_payment_application.rb +12 -2
  249. data/lib/advanced_billing/models/invoice_payment_method.rb +12 -2
  250. data/lib/advanced_billing/models/invoice_pre_payment.rb +25 -5
  251. data/lib/advanced_billing/models/invoice_previous_balance.rb +12 -2
  252. data/lib/advanced_billing/models/invoice_refund.rb +34 -2
  253. data/lib/advanced_billing/models/invoice_response.rb +12 -2
  254. data/lib/advanced_billing/models/invoice_seller.rb +12 -2
  255. data/lib/advanced_billing/models/invoice_tax.rb +13 -3
  256. data/lib/advanced_billing/models/invoice_tax_breakout.rb +23 -2
  257. data/lib/advanced_billing/models/invoice_tax_component_breakout.rb +12 -2
  258. data/lib/advanced_billing/models/issue_advance_invoice_request.rb +12 -2
  259. data/lib/advanced_billing/models/issue_invoice_event_data.rb +12 -2
  260. data/lib/advanced_billing/models/issue_invoice_request.rb +12 -2
  261. data/lib/advanced_billing/models/issue_service_credit.rb +12 -2
  262. data/lib/advanced_billing/models/issue_service_credit_request.rb +12 -2
  263. data/lib/advanced_billing/models/item_price_point_changed.rb +12 -2
  264. data/lib/advanced_billing/models/item_price_point_data.rb +12 -2
  265. data/lib/advanced_billing/models/list_components_price_points_response.rb +12 -2
  266. data/lib/advanced_billing/models/list_credit_notes_response.rb +12 -2
  267. data/lib/advanced_billing/models/list_invoice_events_response.rb +12 -2
  268. data/lib/advanced_billing/models/list_invoices_response.rb +12 -2
  269. data/lib/advanced_billing/models/list_metafields_response.rb +12 -2
  270. data/lib/advanced_billing/models/list_mrr_response.rb +12 -2
  271. data/lib/advanced_billing/models/list_mrr_response_result.rb +12 -2
  272. data/lib/advanced_billing/models/list_offers_response.rb +12 -2
  273. data/lib/advanced_billing/models/list_product_price_points_response.rb +12 -2
  274. data/lib/advanced_billing/models/list_proforma_invoices_meta.rb +90 -0
  275. data/lib/advanced_billing/models/list_proforma_invoices_response.rb +79 -0
  276. data/lib/advanced_billing/models/list_public_keys_meta.rb +12 -2
  277. data/lib/advanced_billing/models/list_public_keys_response.rb +12 -2
  278. data/lib/advanced_billing/models/list_sale_rep_item.rb +12 -2
  279. data/lib/advanced_billing/models/list_segments_response.rb +12 -2
  280. data/lib/advanced_billing/models/list_subcription_group_prepayment_item.rb +25 -12
  281. data/lib/advanced_billing/models/list_subscription_components_response.rb +12 -2
  282. data/lib/advanced_billing/models/list_subscription_group_prepayment.rb +12 -2
  283. data/lib/advanced_billing/models/list_subscription_group_prepayment_response.rb +12 -2
  284. data/lib/advanced_billing/models/list_subscription_groups_item.rb +33 -5
  285. data/lib/advanced_billing/models/list_subscription_groups_meta.rb +12 -2
  286. data/lib/advanced_billing/models/list_subscription_groups_response.rb +12 -2
  287. data/lib/advanced_billing/models/metadata.rb +23 -4
  288. data/lib/advanced_billing/models/metafield.rb +12 -2
  289. data/lib/advanced_billing/models/metafield_scope.rb +12 -2
  290. data/lib/advanced_billing/models/metered_component.rb +12 -2
  291. data/lib/advanced_billing/models/metered_usage.rb +12 -2
  292. data/lib/advanced_billing/models/movement.rb +23 -4
  293. data/lib/advanced_billing/models/movement_line_item.rb +12 -2
  294. data/lib/advanced_billing/models/mrr.rb +23 -4
  295. data/lib/advanced_billing/models/mrr_movement.rb +12 -2
  296. data/lib/advanced_billing/models/mrr_response.rb +12 -2
  297. data/lib/advanced_billing/models/multi_invoice_payment.rb +12 -2
  298. data/lib/advanced_billing/models/multi_invoice_payment_response.rb +12 -2
  299. data/lib/advanced_billing/models/nested_subscription_group.rb +12 -2
  300. data/lib/advanced_billing/models/net_terms.rb +12 -2
  301. data/lib/advanced_billing/models/offer.rb +43 -8
  302. data/lib/advanced_billing/models/offer_discount.rb +12 -2
  303. data/lib/advanced_billing/models/offer_item.rb +12 -2
  304. data/lib/advanced_billing/models/offer_response.rb +12 -2
  305. data/lib/advanced_billing/models/offer_signup_page.rb +12 -2
  306. data/lib/advanced_billing/models/on_off_component.rb +12 -2
  307. data/lib/advanced_billing/models/organization_address.rb +12 -2
  308. data/lib/advanced_billing/models/origin_invoice.rb +12 -2
  309. data/lib/advanced_billing/models/overage_pricing.rb +12 -2
  310. data/lib/advanced_billing/models/override_subscription.rb +12 -2
  311. data/lib/advanced_billing/models/override_subscription_request.rb +12 -2
  312. data/lib/advanced_billing/models/paginated_metadata.rb +12 -2
  313. data/lib/advanced_billing/models/{payment.rb → paid_invoice.rb} +23 -13
  314. data/lib/advanced_billing/models/pause_request.rb +12 -2
  315. data/lib/advanced_billing/models/payer_attributes.rb +13 -3
  316. data/lib/advanced_billing/models/payer_error.rb +12 -2
  317. data/lib/advanced_billing/models/payment_collection_method_changed.rb +12 -2
  318. data/lib/advanced_billing/models/payment_for_allocation.rb +12 -2
  319. data/lib/advanced_billing/models/payment_method_apple_pay.rb +12 -2
  320. data/lib/advanced_billing/models/payment_method_bank_account.rb +12 -2
  321. data/lib/advanced_billing/models/payment_method_credit_card.rb +12 -2
  322. data/lib/advanced_billing/models/payment_method_external.rb +12 -2
  323. data/lib/advanced_billing/models/payment_method_paypal.rb +12 -2
  324. data/lib/advanced_billing/models/payment_profile_attributes.rb +12 -2
  325. data/lib/advanced_billing/models/payment_profile_response.rb +12 -2
  326. data/lib/advanced_billing/models/payment_related_events.rb +12 -2
  327. data/lib/advanced_billing/models/pending_cancellation_change.rb +22 -5
  328. data/lib/advanced_billing/models/portal_management_link.rb +53 -12
  329. data/lib/advanced_billing/models/prepaid_component_price_point.rb +12 -2
  330. data/lib/advanced_billing/models/prepaid_configuration.rb +12 -2
  331. data/lib/advanced_billing/models/prepaid_configuration_response.rb +12 -2
  332. data/lib/advanced_billing/models/prepaid_subscription_balance_changed.rb +12 -2
  333. data/lib/advanced_billing/models/prepaid_usage.rb +12 -2
  334. data/lib/advanced_billing/models/prepaid_usage_allocation_detail.rb +12 -2
  335. data/lib/advanced_billing/models/prepaid_usage_component.rb +12 -2
  336. data/lib/advanced_billing/models/prepayment.rb +21 -4
  337. data/lib/advanced_billing/models/prepayment_account_balance_changed.rb +12 -2
  338. data/lib/advanced_billing/models/prepayment_aggregated_error.rb +12 -2
  339. data/lib/advanced_billing/models/prepayment_method.rb +3 -6
  340. data/lib/advanced_billing/models/prepayment_response.rb +12 -2
  341. data/lib/advanced_billing/models/prepayments_response.rb +12 -2
  342. data/lib/advanced_billing/models/preview_allocations_request.rb +12 -2
  343. data/lib/advanced_billing/models/price.rb +12 -2
  344. data/lib/advanced_billing/models/price_point.rb +12 -2
  345. data/lib/advanced_billing/models/product.rb +14 -4
  346. data/lib/advanced_billing/models/product_family.rb +33 -6
  347. data/lib/advanced_billing/models/product_family_response.rb +12 -2
  348. data/lib/advanced_billing/models/product_price_point.rb +16 -6
  349. data/lib/advanced_billing/models/product_price_point_errors.rb +12 -2
  350. data/lib/advanced_billing/models/product_price_point_response.rb +12 -2
  351. data/lib/advanced_billing/models/product_response.rb +12 -2
  352. data/lib/advanced_billing/models/proforma_error.rb +12 -2
  353. data/lib/advanced_billing/models/proforma_invoice.rb +87 -19
  354. data/lib/advanced_billing/models/proforma_invoice_credit.rb +12 -2
  355. data/lib/advanced_billing/models/proforma_invoice_discount.rb +37 -7
  356. data/lib/advanced_billing/models/proforma_invoice_discount_source_type.rb +23 -0
  357. data/lib/advanced_billing/models/proforma_invoice_issued.rb +23 -6
  358. data/lib/advanced_billing/models/proforma_invoice_payment.rb +12 -2
  359. data/lib/advanced_billing/models/proforma_invoice_role.rb +30 -0
  360. data/lib/advanced_billing/models/proforma_invoice_status.rb +26 -0
  361. data/lib/advanced_billing/models/proforma_invoice_tax.rb +15 -5
  362. data/lib/advanced_billing/models/proforma_invoice_tax_source_type.rb +23 -0
  363. data/lib/advanced_billing/models/proration.rb +12 -2
  364. data/lib/advanced_billing/models/public_key.rb +23 -4
  365. data/lib/advanced_billing/models/public_signup_page.rb +12 -2
  366. data/lib/advanced_billing/models/quantity_based_component.rb +12 -2
  367. data/lib/advanced_billing/models/reactivate_subscription_group_request.rb +12 -2
  368. data/lib/advanced_billing/models/reactivate_subscription_group_response.rb +23 -5
  369. data/lib/advanced_billing/models/reactivate_subscription_request.rb +12 -2
  370. data/lib/advanced_billing/models/reactivation_billing.rb +12 -2
  371. data/lib/advanced_billing/models/reason_code.rb +33 -6
  372. data/lib/advanced_billing/models/reason_code_response.rb +12 -2
  373. data/lib/advanced_billing/models/reason_codes_json_response.rb +12 -2
  374. data/lib/advanced_billing/models/record_payment_request.rb +12 -2
  375. data/lib/advanced_billing/models/{payment_response.rb → record_payment_response.rb} +33 -9
  376. data/lib/advanced_billing/models/referral_code.rb +12 -2
  377. data/lib/advanced_billing/models/referral_validation_response.rb +12 -2
  378. data/lib/advanced_billing/models/refund.rb +12 -2
  379. data/lib/advanced_billing/models/refund_consolidated_invoice.rb +12 -2
  380. data/lib/advanced_billing/models/refund_invoice.rb +12 -2
  381. data/lib/advanced_billing/models/refund_invoice_event_data.rb +12 -2
  382. data/lib/advanced_billing/models/refund_invoice_request.rb +12 -2
  383. data/lib/advanced_billing/models/refund_prepayment.rb +12 -2
  384. data/lib/advanced_billing/models/refund_prepayment_aggregated_error.rb +12 -2
  385. data/lib/advanced_billing/models/refund_prepayment_base_refund_error.rb +12 -2
  386. data/lib/advanced_billing/models/refund_prepayment_request.rb +12 -2
  387. data/lib/advanced_billing/models/refund_success.rb +12 -2
  388. data/lib/advanced_billing/models/remove_payment_event_data.rb +12 -2
  389. data/lib/advanced_billing/models/renewal_preview.rb +23 -5
  390. data/lib/advanced_billing/models/renewal_preview_component.rb +12 -2
  391. data/lib/advanced_billing/models/renewal_preview_line_item.rb +12 -2
  392. data/lib/advanced_billing/models/renewal_preview_request.rb +12 -2
  393. data/lib/advanced_billing/models/renewal_preview_response.rb +12 -2
  394. data/lib/advanced_billing/models/replay_webhooks_request.rb +12 -2
  395. data/lib/advanced_billing/models/replay_webhooks_response.rb +12 -2
  396. data/lib/advanced_billing/models/resent_invitation.rb +12 -2
  397. data/lib/advanced_billing/models/resume_options.rb +12 -2
  398. data/lib/advanced_billing/models/revoked_invitation.rb +12 -2
  399. data/lib/advanced_billing/models/sale_rep.rb +12 -2
  400. data/lib/advanced_billing/models/sale_rep_item_mrr.rb +12 -2
  401. data/lib/advanced_billing/models/sale_rep_settings.rb +12 -2
  402. data/lib/advanced_billing/models/sale_rep_subscription.rb +12 -2
  403. data/lib/advanced_billing/models/segment.rb +33 -6
  404. data/lib/advanced_billing/models/segment_price.rb +12 -2
  405. data/lib/advanced_billing/models/segment_response.rb +12 -2
  406. data/lib/advanced_billing/models/seller.rb +12 -2
  407. data/lib/advanced_billing/models/send_invoice_request.rb +12 -2
  408. data/lib/advanced_billing/models/service_credit.rb +12 -2
  409. data/lib/advanced_billing/models/service_credit_response.rb +12 -2
  410. data/lib/advanced_billing/models/shipping_address.rb +12 -2
  411. data/lib/advanced_billing/models/signup_proforma_preview.rb +12 -2
  412. data/lib/advanced_billing/models/signup_proforma_preview_response.rb +12 -2
  413. data/lib/advanced_billing/models/site.rb +12 -2
  414. data/lib/advanced_billing/models/site_response.rb +12 -2
  415. data/lib/advanced_billing/models/site_statistics.rb +16 -6
  416. data/lib/advanced_billing/models/site_summary.rb +12 -2
  417. data/lib/advanced_billing/models/subscription.rb +12 -2
  418. data/lib/advanced_billing/models/subscription_component.rb +22 -4
  419. data/lib/advanced_billing/models/subscription_component_allocation_error_item.rb +12 -2
  420. data/lib/advanced_billing/models/subscription_component_response.rb +12 -2
  421. data/lib/advanced_billing/models/subscription_component_subscription.rb +23 -4
  422. data/lib/advanced_billing/models/subscription_custom_price.rb +12 -2
  423. data/lib/advanced_billing/models/subscription_group.rb +38 -10
  424. data/lib/advanced_billing/models/subscription_group_balances.rb +12 -2
  425. data/lib/advanced_billing/models/subscription_group_bank_account.rb +12 -2
  426. data/lib/advanced_billing/models/subscription_group_component_custom_price.rb +12 -2
  427. data/lib/advanced_billing/models/subscription_group_credit_card.rb +12 -2
  428. data/lib/advanced_billing/models/subscription_group_customer.rb +12 -2
  429. data/lib/advanced_billing/models/subscription_group_include.rb +20 -0
  430. data/lib/advanced_billing/models/subscription_group_item.rb +12 -2
  431. data/lib/advanced_billing/models/subscription_group_member_error.rb +12 -2
  432. data/lib/advanced_billing/models/subscription_group_members_array_error.rb +72 -0
  433. data/lib/advanced_billing/models/subscription_group_payment_profile.rb +12 -2
  434. data/lib/advanced_billing/models/subscription_group_prepayment.rb +12 -2
  435. data/lib/advanced_billing/models/subscription_group_prepayment_request.rb +12 -2
  436. data/lib/advanced_billing/models/subscription_group_prepayment_response.rb +12 -2
  437. data/lib/advanced_billing/models/subscription_group_response.rb +12 -2
  438. data/lib/advanced_billing/models/subscription_group_signup.rb +12 -2
  439. data/lib/advanced_billing/models/subscription_group_signup_component.rb +12 -2
  440. data/lib/advanced_billing/models/subscription_group_signup_error.rb +12 -2
  441. data/lib/advanced_billing/models/subscription_group_signup_failure.rb +12 -2
  442. data/lib/advanced_billing/models/subscription_group_signup_failure_data.rb +12 -2
  443. data/lib/advanced_billing/models/subscription_group_signup_item.rb +12 -2
  444. data/lib/advanced_billing/models/subscription_group_signup_request.rb +12 -2
  445. data/lib/advanced_billing/models/subscription_group_signup_response.rb +231 -9
  446. data/lib/advanced_billing/models/subscription_group_signup_success.rb +12 -2
  447. data/lib/advanced_billing/models/subscription_group_signup_success_data.rb +21 -5
  448. data/lib/advanced_billing/models/subscription_group_single_error.rb +73 -0
  449. data/lib/advanced_billing/models/subscription_group_subscription_error.rb +66 -2
  450. data/lib/advanced_billing/models/subscription_group_update_error.rb +12 -2
  451. data/lib/advanced_billing/models/subscription_groups_list_include.rb +20 -0
  452. data/lib/advanced_billing/models/subscription_included_coupon.rb +12 -2
  453. data/lib/advanced_billing/models/subscription_migration_preview.rb +12 -2
  454. data/lib/advanced_billing/models/subscription_migration_preview_options.rb +23 -5
  455. data/lib/advanced_billing/models/subscription_migration_preview_request.rb +12 -2
  456. data/lib/advanced_billing/models/subscription_migration_preview_response.rb +12 -2
  457. data/lib/advanced_billing/models/subscription_mrr.rb +12 -2
  458. data/lib/advanced_billing/models/subscription_mrr_breakout.rb +12 -2
  459. data/lib/advanced_billing/models/subscription_mrr_response.rb +12 -2
  460. data/lib/advanced_billing/models/subscription_note.rb +33 -6
  461. data/lib/advanced_billing/models/subscription_note_response.rb +12 -2
  462. data/lib/advanced_billing/models/subscription_preview.rb +12 -2
  463. data/lib/advanced_billing/models/subscription_preview_response.rb +12 -2
  464. data/lib/advanced_billing/models/subscription_product_change.rb +12 -2
  465. data/lib/advanced_billing/models/subscription_product_migration.rb +12 -2
  466. data/lib/advanced_billing/models/subscription_product_migration_request.rb +12 -2
  467. data/lib/advanced_billing/models/subscription_response.rb +12 -2
  468. data/lib/advanced_billing/models/subscription_state_change.rb +12 -2
  469. data/lib/advanced_billing/models/tax_configuration.rb +12 -2
  470. data/lib/advanced_billing/models/too_many_management_link_requests.rb +12 -2
  471. data/lib/advanced_billing/models/update_allocation_expiration_date.rb +12 -2
  472. data/lib/advanced_billing/models/update_component.rb +12 -2
  473. data/lib/advanced_billing/models/update_component_price_point.rb +12 -2
  474. data/lib/advanced_billing/models/update_component_price_point_request.rb +12 -2
  475. data/lib/advanced_billing/models/update_component_request.rb +12 -2
  476. data/lib/advanced_billing/models/update_coupon_currency.rb +12 -2
  477. data/lib/advanced_billing/models/update_currency_price.rb +12 -2
  478. data/lib/advanced_billing/models/update_currency_prices_request.rb +12 -2
  479. data/lib/advanced_billing/models/update_customer.rb +12 -2
  480. data/lib/advanced_billing/models/update_customer_request.rb +12 -2
  481. data/lib/advanced_billing/models/update_metadata.rb +12 -2
  482. data/lib/advanced_billing/models/update_metadata_request.rb +12 -2
  483. data/lib/advanced_billing/models/update_metafield.rb +12 -2
  484. data/lib/advanced_billing/models/update_metafields_request.rb +12 -2
  485. data/lib/advanced_billing/models/update_payment_profile.rb +12 -2
  486. data/lib/advanced_billing/models/update_payment_profile_request.rb +12 -2
  487. data/lib/advanced_billing/models/update_price.rb +12 -2
  488. data/lib/advanced_billing/models/update_product_price_point.rb +12 -2
  489. data/lib/advanced_billing/models/update_product_price_point_request.rb +12 -2
  490. data/lib/advanced_billing/models/update_reason_code.rb +12 -2
  491. data/lib/advanced_billing/models/update_reason_code_request.rb +12 -2
  492. data/lib/advanced_billing/models/update_segment.rb +12 -2
  493. data/lib/advanced_billing/models/update_segment_request.rb +12 -2
  494. data/lib/advanced_billing/models/update_subscription.rb +23 -5
  495. data/lib/advanced_billing/models/update_subscription_component.rb +12 -2
  496. data/lib/advanced_billing/models/update_subscription_group.rb +12 -2
  497. data/lib/advanced_billing/models/update_subscription_group_request.rb +12 -2
  498. data/lib/advanced_billing/models/update_subscription_note.rb +12 -2
  499. data/lib/advanced_billing/models/update_subscription_note_request.rb +12 -2
  500. data/lib/advanced_billing/models/update_subscription_request.rb +12 -2
  501. data/lib/advanced_billing/models/upsert_prepaid_configuration.rb +12 -2
  502. data/lib/advanced_billing/models/upsert_prepaid_configuration_request.rb +12 -2
  503. data/lib/advanced_billing/models/usage.rb +12 -2
  504. data/lib/advanced_billing/models/usage_response.rb +12 -2
  505. data/lib/advanced_billing/models/void_invoice.rb +12 -2
  506. data/lib/advanced_billing/models/void_invoice_event_data.rb +12 -2
  507. data/lib/advanced_billing/models/void_invoice_request.rb +12 -2
  508. data/lib/advanced_billing/models/void_remainder_event_data.rb +12 -2
  509. data/lib/advanced_billing/models/webhook.rb +53 -10
  510. data/lib/advanced_billing/models/webhook_response.rb +12 -2
  511. data/lib/advanced_billing/utilities/union_type_lookup.rb +20 -8
  512. data/lib/advanced_billing.rb +25 -12
  513. metadata +24 -11
  514. data/lib/advanced_billing/models/proforma_invoice_discount_breakout.rb +0 -62
  515. data/lib/advanced_billing/models/proforma_invoice_preview.rb +0 -484
  516. data/lib/advanced_billing/models/proforma_invoice_tax_breakout.rb +0 -61
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 56965407fbc91505e38726fbc62e7c8179afbcf71e51fb1993386ce182c45fe4
4
- data.tar.gz: 72fbecf77997471c4b644c71a2dbf661fadd897a5acbce5602036a79c56187e2
3
+ metadata.gz: 56ad6bf7a546dec06d225320086160fc7268eabaa8494758580cb136cd957526
4
+ data.tar.gz: 5c251518ad00a555d27146b7c2f317ac169474ecf303e4de1216b44e84189f4d
5
5
  SHA512:
6
- metadata.gz: b3a9b49bc84316ee76362c2fd2d07e12300b14fb8cd39250cca01aed6c118bea1d2d6fe7923a0234ab353aa525b3e6f96495bd4f76d4493dec82f623b6a12062
7
- data.tar.gz: b0a0199d82d5ca95f05182546c3b123d81acdc2389d4b59bcbf518495d0808b75cb04864851d87961b38bbd1ff7198c866c4c0b0efef4ef26bc4a04395fb3342
6
+ metadata.gz: 348d9a2c09c3f1557ce3340cd3623765e50da283354f322fa0cfd55d4f898f53cc54983a3b15d64e44bf54b39b5bcc3d78b457b07846c8ce68f6d501f8f56f22
7
+ data.tar.gz: 412763f3a4e11e72088bbca0fcd1fb6377fee9b5b1b35eb8cddaeb0a7126be72b656efa206211648d785a8a471f2d7bd46d6b4121e0fce9c0edb87d5e0710f36
data/README.md CHANGED
@@ -3,288 +3,47 @@
3
3
 
4
4
  ## Introduction
5
5
 
6
- ### Introduction
6
+ Maxio Advanced Billing (formerly Chargify) provides an HTTP-based API that conforms to the principles of REST.
7
+ One of the many reasons to use Advanced Billing is the immense feature set and surrounding community [client libraries](page:development-tools/client-libraries).
8
+ The Maxio API returns JSON responses as the primary and recommended format, but XML is also provided as a backwards compatible option for Merchants who require it.
7
9
 
8
- #### API Integration
10
+ ### Steps to make your first Maxio Advanced Billing API call
9
11
 
10
- Maxio Advanced Billing (formerly Chargify API) can be integrated with many environments and programming languages via our REST API. Some of our users have contributed their API wrappers in various programming languages. Check out the [API Code Overview](https://developers.chargify.com/docs/developer-docs/ZG9jOjE0NjAzNDI2-api-code-samples) doc for an introduction to the wrappers and available code samples.
12
+ 1. [Sign-up](https://app.chargify.com/signup/maxio-billing-sandbox) or [log-in](https://app.chargify.com/login.html) to your [test site](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405553861773-Testing-Intro) account.
13
+ 2. [Setup and configure authentication](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405281550477-API-Keys#api) credentials.
14
+ 3. Submit your API request and try it out.
15
+ 4. Verify results through response.
16
+ 5. Test our integrations.
11
17
 
12
- #### Testing Guide
18
+ We strongly suggest exploring the developer portal, our [integrations](https://www.maxio.com/integrations) and the API guide, as well as the entire set of application-based documentation to aid in your discovery of the product.
13
19
 
14
- Maxio Advanced Billing has compiled a [testing guide](https://chargify.zendesk.com/hc/en-us/articles/4407904658587) that covers a list of important factors to consider while in the testing phase. Here's a high-level overiew of what's covered in our testing guide:
20
+ #### Example
15
21
 
16
- + Test credit card basics
17
- + Test site limits
18
- + Live mode versus test mode
19
-
20
- We strongly suggest reading over the testing guide, as well as the entire set of application-based documentation to aid in your discovery of the product.
21
-
22
- #### Engage Support
23
-
24
- We always enjoy (and appreciate) hearing about larger integrations ahead of time. If you’re planning on importing a large amount of data into Maxio via our API, we suggest sending a “heads up” to “support@chargify.com” so we can coordinate with you to ensure your import process goes smoothly.
25
-
26
- Our API, while considered stable, is continually being improved and polished. Please feel free to contact support if you experience issues when integrating with the Maxio Advanced Billing API.
27
-
28
- If you have any additional questions regarding our documentation please don't hesitate in reaching out.
29
-
30
- #### Support Access
31
-
32
- Access to our Technical Specialist team for API support is currently limited to purchasers of our larger Maxio support plans.
33
-
34
- But don’t worry! There are quite a few options to help you get the answers you need:
35
-
36
- - [Read our documentation for developers](https://developers.chargify.com/docs/developer-docs/ZG9jOjM0NjA3MQ-overview)
37
- - Explore the endpoints of our API Documentation
38
- - [Watch our videos and tutorials](https://chargify.com/tutorials)
39
- - [Check out the Chargify tag on Stack Overflow](http://stackoverflow.com/questions/tagged/chargify)
40
-
41
- ### API Overview
42
-
43
- The Chargify API allows you to interact with our system programmatically from your own application. Using the API you interact with Resources such as:
44
-
45
- - Products
46
- - Subscriptions
47
- - Customers
48
- - etc.
49
-
50
- The API attempts to conform to the [RESTful](http://en.wikipedia.org/wiki/Representational_State_Transfer) design principles.
51
- You interact with the resources exposed via the API by accessing resource collection and element URIs using the HTTP verbs (GET, POST, PUT, and DELETE).
52
- Chargify accepts and returns both JSON and XML data via the API.
53
-
54
- You’ll likely need access to a web developer or programmer (if you’re not one) to get the most use out of the API.
55
-
56
- #### Available Formats: JSON and XML
57
-
58
- JSON is the primary and recommended format for use with the Chargify API. XML is also provided as a backwards compatible option for Merchants who require it.
59
-
60
- #### Authentication
61
-
62
- Authentication is implemented as HTTP Basic Authentication over TLS >= 1.2 (HTTPS), as described in [API Authentication](https://developers.chargify.com/docs/developer-docs/ZG9jOjE1NTUxNQ-authentication)
63
-
64
- #### URL
65
-
66
- The URL for API requests includes the subdomain of the Site you are working with:
67
-
68
- `https://<subdomain>.chargify.com/<resource URI>`
69
-
70
- #### Response Data
71
-
72
- Response data is sent as either XML or JSON, depending on the type of data requested (`HTTP Content-Type` header) or the type specified as being accepted (HTTP `Accept` header).
73
-
74
- GETs for individual statements & invoices may also be requested as PDF using `application/pdf` or appending `.pdf` to the resource URI.
75
-
76
- Response codes are sent via the normal HTTP Response Code, and are documented separately for each resource.
77
-
78
- For boolean fields, please note that a value of `null` may be considered as false. However, this is not true across all cases. Please excercise good judgement here, or contact support with any questions.
79
-
80
- For example:
81
-
82
- + `null` can define that there's no data available for that attribute
83
-
84
- #### Pagination
85
-
86
- When an endpoint returns a list of items, it will be paginated. Usually, 20 items will be returned by default, and you may request up to a maximum of 200 at a time. Pagination is done with query string parameters, for example: `?page=5&per_page=200`
87
-
88
- #### Response Time Zones
89
-
90
- API responses from Chargify are sent with the timezone of current Chargify site.
91
-
92
- Alternately, webhooks sent from Chargify globally utilize EST as the timezone for all content in the body of the payload.
93
-
94
- #### Request Data
95
-
96
- POST and PUT request data may be formatted as either XML (`application/xml`) or JSON (`application/json`). For best results, you should set your HTTP `Content-Type` request header accordingly, although you may also specify your format by appending `.xml` or `.json` extensions on to the resource URI.
97
-
98
- Note that Chargify does not accept PUT or POST data sent as query params or form encoded data – data must be sent as either XML or JSON. If you fail to set your `Content-Type` to either `application/xml` or `application/json`, your request may fail due to triggering of forgery protection mechanisms.
99
-
100
- ##### About Decimal Numbers
101
-
102
- In order to prevent losing precision, we serialize decimal numbers as strings instead of as JSON numbers.
103
-
104
- We recommend parsing these strings into their decimal equivalent using a decimal number library in your programming language (i.e. `BigDecimal` in Ruby) instead of relying on floating point values or arithmetic.
105
-
106
- ##### About Amount Fields
107
-
108
- Fields holding amount values are given as a string representing a decimal whole currency amount.
109
-
110
- For example, `"1.23"` in currency `"USD"` would equate to `$1.23`.
111
-
112
- Not all fields will be rounded to the smallest currency denomination. Intermediate results, such as those that derive from line-level tax calculations, may hold precision up to 8 decimal places. However, the top-level totals we provide (e.g. `total_amount`) will be rounded to the smallest currency denomination.
113
-
114
- It is up to API consumers to parse the string into a decimal number representation and do any rounding necessary for your application.
115
-
116
- #### Debugging
117
-
118
- If you’re having difficulty executing a request via our API, try the simplest thing and attempt your request via the curl command-line tool, as shown in the below example. Add the `--verbose` flag to your request to receive even more debugging information.
119
-
120
- Another handy tool is [Beeceptor](https://beeceptor.com/). You can use this to intercept your request to see exactly what is being sent.
121
-
122
- If you are unable to connect at all, check that you are using TLS 1.2 or better.
123
-
124
- If you see a "Could not resolve host" error, double check that the url is correct, including your subdomain. For example: `mysite.chargify.com`. This error means your DNS server could not find an IP address for the domain you are trying to connect to.
125
-
126
- #### Backwards Compatibility
127
-
128
- We consider the following changes to be backwards compatible and may make them without advance notice:
129
-
130
- + Adding new API endpoints, or adding new attributes in the responses of existing endpoints
131
- + Adding new optional parameters to be sent to existing API endpoints
132
- + Adding new fields to exported data
133
- + Changing the type or length of any of the ID attributes
134
- + For example, most IDs are currently integers, but you should not assume that this will always be the case.
135
-
136
- In addition, you should not depend on the order of attributes within the API response as this may change.
137
-
138
- Chargify does not provide notifications for additions that are clearly defined as backwards compatible.
139
-
140
- #### Examples
141
-
142
- The following examples use the curl command-line tool to execute API requests.
143
-
144
- ##### Subscription Listing
22
+ The following example uses the curl command-line tool to execute API requests.
145
23
 
146
24
  **Request**
147
25
 
148
26
  curl -u <api_key>:x -H Accept:application/json -H Content-Type:application/json https://acme.chargify.com/subscriptions.json
149
27
 
150
- ### API Access Limitations
151
-
152
- There are a few scenarios that may end up in causing an API request to be blocked even with correct credentials.
153
- **Please note:** All relevant API requests will be blocked if any of the below conditions are true. These limitations also apply to [Chargify Direct](https://developers.chargify.com/docs/developer-docs/ZG9jOjE0NjAzNDE3-introduction).
154
-
155
- Those scenarios are as follows:
156
-
157
- - Your Chargify subscription is canceled.
158
- - Your Chargify trial has reached an end.
159
- - The site you're making a request for is in the process of ["clearing site data"](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405428327309)
160
- - _Note: any API request for another site that is in a good state will NOT be blocked_
161
- - The site you're making a request for has been deleted.
162
- - _Note: any API request for another site that is in a good state will NOT be blocked_
163
-
164
- Read more about your Chargify subscription [here](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405430043149-Advanced-Billing-Subscription#advanced-billing-subscription-0-0)
165
-
166
- #### What happens when an API request is blocked
167
-
168
- The request will fail with a `422` http status code. The response will also include a message explaining the reason for the request being blocked. For example:
169
-
170
- - If your Chargify subscription is canceled:
171
-
172
- ```json
173
- {
174
- "errors" => [
175
- [0] "Your Chargify account has been canceled. Please contact support@chargify.com to reactivate."
176
- ]
177
- }
178
- ```
179
-
180
- - If your Chargify trial has reached and end and you attempted to make an API request, the response body will look like:
181
-
182
- ```json
183
- {
184
- "errors" => [
185
- [0] "Your trial has ended, please contact sales."
186
- ]
187
- }
188
- ```
189
-
190
- - If the site you're making a request for is in the process of ["clearing site data"](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405428327309):
191
-
192
- ```json
193
- {
194
- "errors" => [
195
- [0] "Site data clearing is in progress. Please try later."
196
- ]
197
- }
198
- ```
199
-
200
- - If the site you're making a request for has been deleted:
201
-
202
- ```json
203
- {
204
- "errors" => [
205
- [0] "This site has been deleted."
206
- ]
207
- }
208
- ```
209
-
210
- ### Secure Applications
211
-
212
- Please note that it is NOT possible to make API requests directly from the customer's browser or device. Doing so would expose your API key on the client side, and anyone who has that key has full access to all of your Chargify data.
213
-
214
- Instead you will need to take care to tokenize sensitive information by using [Chargify.js](https://developers.chargify.com/docs/developer-docs/ZG9jOjE0NjAzNDI0-overview) or a similar JavaScript library provided by your gateway, and then post the token and other information to your own server, from which you can make the API call to Chargify.
215
-
216
- #### Troubleshooting
217
-
218
- If you attempt to make a Chargify API request directly from the customer's browser, you may see an error such as:
219
-
220
- ```
221
- Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.
222
- ```
223
-
224
- or
225
-
226
- ```
227
- Origin 'https://example.com' is therefore not allowed access.` `The response had HTTP status code 404.
228
- ```
229
-
230
- This is an error message indicating that Cross-Origin Resource Sharing (CORS) is not enabled on the Chargify server.
231
-
232
- ### Relationship Invoicing
233
-
234
- #### API Compatibility for Relationship Invoicing
235
-
236
- This section describes the API for the new, [Relationship Invoicing](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405078794253) style of invoices introduced in January 2018.
237
-
238
- If you are an existing customer from prior to January 2018 or have not otherwise explicitly opted into this new style of invoices, you are probably looking for the legacy "Invoices" section that describes [invoice-billing legacy-style invoices](./b3A6MTQxMDgzNjQ-read-invoice).
239
-
240
- These new invoices provide a single representation of all of your Chargify billing, whether you collect automatically or via remittance.
241
-
242
- #### About Decimal Numbers
243
-
244
- In order to prevent losing precision, we serialize decimal numbers as strings instead of as JSON numbers.
245
-
246
- We recommend parsing these strings into their decimal equivalent using a decimal number library in your programming language (i.e. `BigDecimal` in Ruby) instead of relying on floating point values or arithmetic.
247
-
248
- #### About Amount Fields
249
-
250
- Fields holding amount values are given as a string representing a decimal whole currency amount.
251
-
252
- For example, `"1.23"` in currency `"USD"` would equate to `$1.23`.
253
-
254
- Not all fields will be rounded to the smallest currency denomination. Intermediate results, such as those that derive from line-level tax calculations, may hold precision up to 8 decimal places. However, the top-level totals we provide (e.g. `total_amount`) will be rounded to the smallest currency denomination.
255
-
256
- It is up to API consumers to parse the string into a decimal number representation and do any rounding necessary for your application.
257
-
258
- ##### Relationship Invoicing Summary
259
-
260
- + If your site **is** using relationship invoicing, you may only use the methods described in this section for working with invoices.
261
-
262
- + If your site is **not** using relationship invoicing, please use the legacy invoice methods:
263
-
264
- + [Invoices](./b3A6MTQxMTA0MTA-read-invoice)
265
- + [Invoices: Payments](./b3A6MTQxMTA0MTI-create-invoice-payment)
266
- + [Invoices: Charges](./b3A6MTQxMTA0MTM-create-charge)
267
- + [Invoices: Credits](./b3A6MTQxMTA0MTQ-create-invoice-credit)
268
-
269
28
  ## Install the Package
270
29
 
271
30
  Install the gem from the command line:
272
31
 
273
32
  ```ruby
274
- gem install maxio-advanced-billing-sdk -v 1.0.0
33
+ gem install maxio-advanced-billing-sdk -v 2.0.0
275
34
  ```
276
35
 
277
36
  Or add the gem to your Gemfile and run `bundle`:
278
37
 
279
38
  ```ruby
280
- gem 'maxio-advanced-billing-sdk', '1.0.0'
39
+ gem 'maxio-advanced-billing-sdk', '2.0.0'
281
40
  ```
282
41
 
283
- For additional gem details, see the [RubyGems page for the maxio-advanced-billing-sdk gem](https://rubygems.org/gems/maxio-advanced-billing-sdk/versions/1.0.0).
42
+ For additional gem details, see the [RubyGems page for the maxio-advanced-billing-sdk gem](https://rubygems.org/gems/maxio-advanced-billing-sdk/versions/2.0.0).
284
43
 
285
44
  ## Initialize the API Client
286
45
 
287
- **_Note:_** Documentation for the client can be found [here.](https://www.github.com/maxio-com/ab-ruby-sdk/tree/1.0.0/doc/client.md)
46
+ **_Note:_** Documentation for the client can be found [here.](https://www.github.com/maxio-com/ab-ruby-sdk/tree/2.0.0/doc/client.md)
288
47
 
289
48
  The following parameters are configurable for the API Client:
290
49
 
@@ -292,7 +51,7 @@ The following parameters are configurable for the API Client:
292
51
  | --- | --- | --- |
293
52
  | `subdomain` | `String` | The subdomain for your Chargify site.<br>*Default*: `'subdomain'` |
294
53
  | `domain` | `String` | The Chargify server domain.<br>*Default*: `'chargify.com'` |
295
- | `environment` | Environment | The API environment. <br> **Default: `Environment.PRODUCTION`** |
54
+ | `environment` | `Environment` | The API environment. <br> **Default: `Environment.PRODUCTION`** |
296
55
  | `connection` | `Faraday::Connection` | The Faraday connection object passed by the SDK user for making requests |
297
56
  | `adapter` | `Faraday::Adapter` | The Faraday adapter object passed by the SDK user for performing http requests |
298
57
  | `timeout` | `Float` | The value to use for connection timeout. <br> **Default: 30** |
@@ -302,15 +61,16 @@ The following parameters are configurable for the API Client:
302
61
  | `retry_statuses` | `Array` | A list of HTTP statuses to retry. <br> **Default: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524]** |
303
62
  | `retry_methods` | `Array` | A list of HTTP methods to retry. <br> **Default: %i[get put]** |
304
63
  | `http_callback` | `HttpCallBack` | The Http CallBack allows defining callables for pre and post API calls. |
305
- | `basic_auth_user_name` | `String` | The username to use with basic authentication |
306
- | `basic_auth_password` | `String` | The password to use with basic authentication |
64
+ | `basic_auth_credentials` | [`BasicAuthCredentials`](https://www.github.com/maxio-com/ab-ruby-sdk/tree/2.0.0/doc/$a/https://www.github.com/maxio-com/ab-ruby-sdk/tree/2.0.0/basic-authentication.md) | The credential object for Basic Authentication |
307
65
 
308
66
  The API client can be initialized as follows:
309
67
 
310
68
  ```ruby
311
69
  client = AdvancedBilling::Client.new(
312
- basic_auth_user_name: 'BasicAuthUserName',
313
- basic_auth_password: 'BasicAuthPassword',
70
+ basic_auth_credentials: BasicAuthCredentials.new(
71
+ username: 'BasicAuthUserName',
72
+ password: 'BasicAuthPassword'
73
+ ),
314
74
  environment: Environment::PRODUCTION,
315
75
  subdomain: 'subdomain',
316
76
  domain: 'chargify.com'
@@ -330,45 +90,47 @@ The SDK can be configured to use a different environment for making API calls. A
330
90
 
331
91
  ## Authorization
332
92
 
333
- This API uses `Basic Authentication`.
93
+ This API uses the following authentication schemes.
94
+
95
+ * [`BasicAuth (Basic Authentication)`](https://www.github.com/maxio-com/ab-ruby-sdk/tree/2.0.0/doc/$a/https://www.github.com/maxio-com/ab-ruby-sdk/tree/2.0.0/basic-authentication.md)
334
96
 
335
97
  ## List of APIs
336
98
 
337
- * [API Exports](https://www.github.com/maxio-com/ab-ruby-sdk/tree/1.0.0/doc/controllers/api-exports.md)
338
- * [Advance Invoice](https://www.github.com/maxio-com/ab-ruby-sdk/tree/1.0.0/doc/controllers/advance-invoice.md)
339
- * [Billing Portal](https://www.github.com/maxio-com/ab-ruby-sdk/tree/1.0.0/doc/controllers/billing-portal.md)
340
- * [Custom Fields](https://www.github.com/maxio-com/ab-ruby-sdk/tree/1.0.0/doc/controllers/custom-fields.md)
341
- * [Events-Based Billing Segments](https://www.github.com/maxio-com/ab-ruby-sdk/tree/1.0.0/doc/controllers/events-based-billing-segments.md)
342
- * [Payment Profiles](https://www.github.com/maxio-com/ab-ruby-sdk/tree/1.0.0/doc/controllers/payment-profiles.md)
343
- * [Product Families](https://www.github.com/maxio-com/ab-ruby-sdk/tree/1.0.0/doc/controllers/product-families.md)
344
- * [Product Price Points](https://www.github.com/maxio-com/ab-ruby-sdk/tree/1.0.0/doc/controllers/product-price-points.md)
345
- * [Proforma Invoices](https://www.github.com/maxio-com/ab-ruby-sdk/tree/1.0.0/doc/controllers/proforma-invoices.md)
346
- * [Reason Codes](https://www.github.com/maxio-com/ab-ruby-sdk/tree/1.0.0/doc/controllers/reason-codes.md)
347
- * [Referral Codes](https://www.github.com/maxio-com/ab-ruby-sdk/tree/1.0.0/doc/controllers/referral-codes.md)
348
- * [Sales Commissions](https://www.github.com/maxio-com/ab-ruby-sdk/tree/1.0.0/doc/controllers/sales-commissions.md)
349
- * [Subscription Components](https://www.github.com/maxio-com/ab-ruby-sdk/tree/1.0.0/doc/controllers/subscription-components.md)
350
- * [Subscription Groups](https://www.github.com/maxio-com/ab-ruby-sdk/tree/1.0.0/doc/controllers/subscription-groups.md)
351
- * [Subscription Group Invoice Account](https://www.github.com/maxio-com/ab-ruby-sdk/tree/1.0.0/doc/controllers/subscription-group-invoice-account.md)
352
- * [Subscription Group Status](https://www.github.com/maxio-com/ab-ruby-sdk/tree/1.0.0/doc/controllers/subscription-group-status.md)
353
- * [Subscription Invoice Account](https://www.github.com/maxio-com/ab-ruby-sdk/tree/1.0.0/doc/controllers/subscription-invoice-account.md)
354
- * [Subscription Notes](https://www.github.com/maxio-com/ab-ruby-sdk/tree/1.0.0/doc/controllers/subscription-notes.md)
355
- * [Subscription Products](https://www.github.com/maxio-com/ab-ruby-sdk/tree/1.0.0/doc/controllers/subscription-products.md)
356
- * [Subscription Status](https://www.github.com/maxio-com/ab-ruby-sdk/tree/1.0.0/doc/controllers/subscription-status.md)
357
- * [Coupons](https://www.github.com/maxio-com/ab-ruby-sdk/tree/1.0.0/doc/controllers/coupons.md)
358
- * [Components](https://www.github.com/maxio-com/ab-ruby-sdk/tree/1.0.0/doc/controllers/components.md)
359
- * [Customers](https://www.github.com/maxio-com/ab-ruby-sdk/tree/1.0.0/doc/controllers/customers.md)
360
- * [Events](https://www.github.com/maxio-com/ab-ruby-sdk/tree/1.0.0/doc/controllers/events.md)
361
- * [Insights](https://www.github.com/maxio-com/ab-ruby-sdk/tree/1.0.0/doc/controllers/insights.md)
362
- * [Invoices](https://www.github.com/maxio-com/ab-ruby-sdk/tree/1.0.0/doc/controllers/invoices.md)
363
- * [Offers](https://www.github.com/maxio-com/ab-ruby-sdk/tree/1.0.0/doc/controllers/offers.md)
364
- * [Products](https://www.github.com/maxio-com/ab-ruby-sdk/tree/1.0.0/doc/controllers/products.md)
365
- * [Sites](https://www.github.com/maxio-com/ab-ruby-sdk/tree/1.0.0/doc/controllers/sites.md)
366
- * [Subscriptions](https://www.github.com/maxio-com/ab-ruby-sdk/tree/1.0.0/doc/controllers/subscriptions.md)
367
- * [Webhooks](https://www.github.com/maxio-com/ab-ruby-sdk/tree/1.0.0/doc/controllers/webhooks.md)
99
+ * [API Exports](https://www.github.com/maxio-com/ab-ruby-sdk/tree/2.0.0/doc/controllers/api-exports.md)
100
+ * [Advance Invoice](https://www.github.com/maxio-com/ab-ruby-sdk/tree/2.0.0/doc/controllers/advance-invoice.md)
101
+ * [Billing Portal](https://www.github.com/maxio-com/ab-ruby-sdk/tree/2.0.0/doc/controllers/billing-portal.md)
102
+ * [Custom Fields](https://www.github.com/maxio-com/ab-ruby-sdk/tree/2.0.0/doc/controllers/custom-fields.md)
103
+ * [Events-Based Billing Segments](https://www.github.com/maxio-com/ab-ruby-sdk/tree/2.0.0/doc/controllers/events-based-billing-segments.md)
104
+ * [Payment Profiles](https://www.github.com/maxio-com/ab-ruby-sdk/tree/2.0.0/doc/controllers/payment-profiles.md)
105
+ * [Product Families](https://www.github.com/maxio-com/ab-ruby-sdk/tree/2.0.0/doc/controllers/product-families.md)
106
+ * [Product Price Points](https://www.github.com/maxio-com/ab-ruby-sdk/tree/2.0.0/doc/controllers/product-price-points.md)
107
+ * [Proforma Invoices](https://www.github.com/maxio-com/ab-ruby-sdk/tree/2.0.0/doc/controllers/proforma-invoices.md)
108
+ * [Reason Codes](https://www.github.com/maxio-com/ab-ruby-sdk/tree/2.0.0/doc/controllers/reason-codes.md)
109
+ * [Referral Codes](https://www.github.com/maxio-com/ab-ruby-sdk/tree/2.0.0/doc/controllers/referral-codes.md)
110
+ * [Sales Commissions](https://www.github.com/maxio-com/ab-ruby-sdk/tree/2.0.0/doc/controllers/sales-commissions.md)
111
+ * [Subscription Components](https://www.github.com/maxio-com/ab-ruby-sdk/tree/2.0.0/doc/controllers/subscription-components.md)
112
+ * [Subscription Groups](https://www.github.com/maxio-com/ab-ruby-sdk/tree/2.0.0/doc/controllers/subscription-groups.md)
113
+ * [Subscription Group Invoice Account](https://www.github.com/maxio-com/ab-ruby-sdk/tree/2.0.0/doc/controllers/subscription-group-invoice-account.md)
114
+ * [Subscription Group Status](https://www.github.com/maxio-com/ab-ruby-sdk/tree/2.0.0/doc/controllers/subscription-group-status.md)
115
+ * [Subscription Invoice Account](https://www.github.com/maxio-com/ab-ruby-sdk/tree/2.0.0/doc/controllers/subscription-invoice-account.md)
116
+ * [Subscription Notes](https://www.github.com/maxio-com/ab-ruby-sdk/tree/2.0.0/doc/controllers/subscription-notes.md)
117
+ * [Subscription Products](https://www.github.com/maxio-com/ab-ruby-sdk/tree/2.0.0/doc/controllers/subscription-products.md)
118
+ * [Subscription Status](https://www.github.com/maxio-com/ab-ruby-sdk/tree/2.0.0/doc/controllers/subscription-status.md)
119
+ * [Coupons](https://www.github.com/maxio-com/ab-ruby-sdk/tree/2.0.0/doc/controllers/coupons.md)
120
+ * [Components](https://www.github.com/maxio-com/ab-ruby-sdk/tree/2.0.0/doc/controllers/components.md)
121
+ * [Customers](https://www.github.com/maxio-com/ab-ruby-sdk/tree/2.0.0/doc/controllers/customers.md)
122
+ * [Events](https://www.github.com/maxio-com/ab-ruby-sdk/tree/2.0.0/doc/controllers/events.md)
123
+ * [Insights](https://www.github.com/maxio-com/ab-ruby-sdk/tree/2.0.0/doc/controllers/insights.md)
124
+ * [Invoices](https://www.github.com/maxio-com/ab-ruby-sdk/tree/2.0.0/doc/controllers/invoices.md)
125
+ * [Offers](https://www.github.com/maxio-com/ab-ruby-sdk/tree/2.0.0/doc/controllers/offers.md)
126
+ * [Products](https://www.github.com/maxio-com/ab-ruby-sdk/tree/2.0.0/doc/controllers/products.md)
127
+ * [Sites](https://www.github.com/maxio-com/ab-ruby-sdk/tree/2.0.0/doc/controllers/sites.md)
128
+ * [Subscriptions](https://www.github.com/maxio-com/ab-ruby-sdk/tree/2.0.0/doc/controllers/subscriptions.md)
129
+ * [Webhooks](https://www.github.com/maxio-com/ab-ruby-sdk/tree/2.0.0/doc/controllers/webhooks.md)
368
130
 
369
131
  ## Classes Documentation
370
132
 
371
- * [Utility Classes](https://www.github.com/maxio-com/ab-ruby-sdk/tree/1.0.0/doc/utility-classes.md)
372
- * [HttpResponse](https://www.github.com/maxio-com/ab-ruby-sdk/tree/1.0.0/doc/http-response.md)
373
- * [HttpRequest](https://www.github.com/maxio-com/ab-ruby-sdk/tree/1.0.0/doc/http-request.md)
133
+ * [Utility Classes](https://www.github.com/maxio-com/ab-ruby-sdk/tree/2.0.0/doc/utility-classes.md)
134
+ * [HttpResponse](https://www.github.com/maxio-com/ab-ruby-sdk/tree/2.0.0/doc/http-response.md)
135
+ * [HttpRequest](https://www.github.com/maxio-com/ab-ruby-sdk/tree/2.0.0/doc/http-request.md)
374
136
 
@@ -6,6 +6,7 @@
6
6
  module AdvancedBilling
7
7
  # advanced_billing client class.
8
8
  class Client
9
+ include CoreLibrary
9
10
  attr_reader :config, :auth_managers
10
11
 
11
12
  # Access to api_exports controller.
@@ -194,26 +195,25 @@ module AdvancedBilling
194
195
  @webhooks ||= WebhooksController.new @global_configuration
195
196
  end
196
197
 
197
- def initialize(connection: nil, adapter: :net_http_persistent, timeout: 30,
198
- max_retries: 0, retry_interval: 1, backoff_factor: 2,
199
- retry_statuses: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524],
200
- retry_methods: %i[get put], http_callback: nil,
201
- environment: Environment::PRODUCTION, subdomain: 'subdomain',
202
- domain: 'chargify.com',
203
- basic_auth_user_name: 'TODO: Replace',
204
- basic_auth_password: 'TODO: Replace', config: nil)
198
+ def initialize(
199
+ connection: nil, adapter: :net_http_persistent, timeout: 30,
200
+ max_retries: 0, retry_interval: 1, backoff_factor: 2,
201
+ retry_statuses: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524],
202
+ retry_methods: %i[get put], http_callback: nil,
203
+ environment: Environment::PRODUCTION, subdomain: 'subdomain',
204
+ domain: 'chargify.com', basic_auth_credentials: nil, config: nil
205
+ )
205
206
  @config = if config.nil?
206
- Configuration.new(connection: connection, adapter: adapter,
207
- timeout: timeout, max_retries: max_retries,
208
- retry_interval: retry_interval,
209
- backoff_factor: backoff_factor,
210
- retry_statuses: retry_statuses,
211
- retry_methods: retry_methods,
212
- http_callback: http_callback,
213
- environment: environment,
214
- subdomain: subdomain, domain: domain,
215
- basic_auth_user_name: basic_auth_user_name,
216
- basic_auth_password: basic_auth_password)
207
+ Configuration.new(
208
+ connection: connection, adapter: adapter, timeout: timeout,
209
+ max_retries: max_retries, retry_interval: retry_interval,
210
+ backoff_factor: backoff_factor,
211
+ retry_statuses: retry_statuses,
212
+ retry_methods: retry_methods, http_callback: http_callback,
213
+ environment: environment, subdomain: subdomain,
214
+ domain: domain,
215
+ basic_auth_credentials: basic_auth_credentials
216
+ )
217
217
  else
218
218
  config
219
219
  end
@@ -234,9 +234,8 @@ module AdvancedBilling
234
234
  def initialize_auth_managers(global_config)
235
235
  @auth_managers = {}
236
236
  http_client_config = global_config.client_configuration
237
- ['global'].each { |auth| @auth_managers[auth] = nil }
238
- @auth_managers['global'] = BasicAuth.new(http_client_config.basic_auth_user_name,
239
- http_client_config.basic_auth_password)
237
+ %w[BasicAuth].each { |auth| @auth_managers[auth] = nil }
238
+ @auth_managers['BasicAuth'] = BasicAuth.new(http_client_config.basic_auth_credentials)
240
239
  end
241
240
  end
242
241
  end
@@ -25,20 +25,20 @@ module AdvancedBilling
25
25
  # are configured in this class.
26
26
  class Configuration < CoreLibrary::HttpClientConfiguration
27
27
  # The attribute readers for properties.
28
- attr_reader :environment, :subdomain, :domain, :basic_auth_user_name, :basic_auth_password
28
+ attr_reader :environment, :subdomain, :domain, :basic_auth_credentials
29
29
 
30
30
  class << self
31
31
  attr_reader :environments
32
32
  end
33
33
 
34
- def initialize(connection: nil, adapter: :net_http_persistent, timeout: 30,
35
- max_retries: 0, retry_interval: 1, backoff_factor: 2,
36
- retry_statuses: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524],
37
- retry_methods: %i[get put], http_callback: nil,
38
- environment: Environment::PRODUCTION, subdomain: 'subdomain',
39
- domain: 'chargify.com',
40
- basic_auth_user_name: 'TODO: Replace',
41
- basic_auth_password: 'TODO: Replace')
34
+ def initialize(
35
+ connection: nil, adapter: :net_http_persistent, timeout: 30,
36
+ max_retries: 0, retry_interval: 1, backoff_factor: 2,
37
+ retry_statuses: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524],
38
+ retry_methods: %i[get put], http_callback: nil,
39
+ environment: Environment::PRODUCTION, subdomain: 'subdomain',
40
+ domain: 'chargify.com', basic_auth_credentials: nil
41
+ )
42
42
 
43
43
  super connection: connection, adapter: adapter, timeout: timeout,
44
44
  max_retries: max_retries, retry_interval: retry_interval,
@@ -54,11 +54,11 @@ module AdvancedBilling
54
54
  # The Chargify server domain.
55
55
  @domain = domain
56
56
 
57
- # The username to use with basic authentication
58
- @basic_auth_user_name = basic_auth_user_name
57
+ # The object holding Basic Authentication credentials
58
+ @basic_auth_credentials = basic_auth_credentials
59
59
 
60
- # The password to use with basic authentication
61
- @basic_auth_password = basic_auth_password
60
+ # Initializing Basic Authentication credentials with the provided auth parameters
61
+ @basic_auth_credentials = basic_auth_credentials
62
62
 
63
63
  # The Http Client to use for making requests.
64
64
  set_http_client CoreLibrary::FaradayClient.new(self)
@@ -68,7 +68,7 @@ module AdvancedBilling
68
68
  max_retries: nil, retry_interval: nil, backoff_factor: nil,
69
69
  retry_statuses: nil, retry_methods: nil, http_callback: nil,
70
70
  environment: nil, subdomain: nil, domain: nil,
71
- basic_auth_user_name: nil, basic_auth_password: nil)
71
+ basic_auth_credentials: nil)
72
72
  connection ||= self.connection
73
73
  adapter ||= self.adapter
74
74
  timeout ||= self.timeout
@@ -81,8 +81,7 @@ module AdvancedBilling
81
81
  environment ||= self.environment
82
82
  subdomain ||= self.subdomain
83
83
  domain ||= self.domain
84
- basic_auth_user_name ||= self.basic_auth_user_name
85
- basic_auth_password ||= self.basic_auth_password
84
+ basic_auth_credentials ||= basic_auth_credentials
86
85
 
87
86
  Configuration.new(connection: connection, adapter: adapter,
88
87
  timeout: timeout, max_retries: max_retries,
@@ -92,10 +91,10 @@ module AdvancedBilling
92
91
  retry_methods: retry_methods,
93
92
  http_callback: http_callback, environment: environment,
94
93
  subdomain: subdomain, domain: domain,
95
- basic_auth_user_name: basic_auth_user_name,
96
- basic_auth_password: basic_auth_password)
94
+ basic_auth_credentials: basic_auth_credentials)
97
95
  end
98
96
 
97
+
99
98
  # All the environments the SDK can run in.
100
99
  ENVIRONMENTS = {
101
100
  Environment::PRODUCTION => {
@@ -7,11 +7,10 @@ module AdvancedBilling
7
7
  # AdvanceInvoiceController
8
8
  class AdvanceInvoiceController < BaseController
9
9
  # Generate an invoice in advance for a subscription's next renewal date.
10
- # [Please see our
11
- # docs](reference/Chargify-API.v1.yaml/components/schemas/Invoice) for more
12
- # information on advance invoices, including eligibility on generating one;
13
- # for the most part, they function like any other invoice, except they are
14
- # issued early and have special behavior upon being voided.
10
+ # [Please see our docs]($m/Invoice) for more information on advance
11
+ # invoices, including eligibility on generating one; for the most part, they
12
+ # function like any other invoice, except they are issued early and have
13
+ # special behavior upon being voided.
15
14
  # A subscription may only have one advance invoice per billing period.
16
15
  # Attempting to issue an advance invoice when one already exists will return
17
16
  # an error.
@@ -39,7 +38,7 @@ module AdvancedBilling
39
38
  .body_param(new_parameter(body))
40
39
  .header_param(new_parameter('application/json', key: 'accept'))
41
40
  .body_serializer(proc do |param| param.to_json unless param.nil? end)
42
- .auth(Single.new('global')))
41
+ .auth(Single.new('BasicAuth')))
43
42
  .response(new_response_handler
44
43
  .deserializer(APIHelper.method(:custom_type_deserializer))
45
44
  .deserialize_into(Invoice.method(:from_hash))
@@ -68,7 +67,7 @@ module AdvancedBilling
68
67
  .is_required(true)
69
68
  .should_encode(true))
70
69
  .header_param(new_parameter('application/json', key: 'accept'))
71
- .auth(Single.new('global')))
70
+ .auth(Single.new('BasicAuth')))
72
71
  .response(new_response_handler
73
72
  .deserializer(APIHelper.method(:custom_type_deserializer))
74
73
  .deserialize_into(Invoice.method(:from_hash))
@@ -83,8 +82,7 @@ module AdvancedBilling
83
82
  # A `reason` is required in order to void, and the invoice must have an open
84
83
  # status. Voiding will cause any prepayments and credits that were applied
85
84
  # to the invoice to be returned to the subscription. For a full overview of
86
- # the impact of voiding, please [see our help
87
- # docs](reference/Chargify-API.v1.yaml/components/schemas/Invoice).
85
+ # the impact of voiding, please [see our help docs]($m/Invoice).
88
86
  # @param [Integer] subscription_id Required parameter: The Chargify id of
89
87
  # the subscription
90
88
  # @param [VoidInvoiceRequest] body Optional parameter: Example:
@@ -102,7 +100,7 @@ module AdvancedBilling
102
100
  .body_param(new_parameter(body))
103
101
  .header_param(new_parameter('application/json', key: 'accept'))
104
102
  .body_serializer(proc do |param| param.to_json unless param.nil? end)
105
- .auth(Single.new('global')))
103
+ .auth(Single.new('BasicAuth')))
106
104
  .response(new_response_handler
107
105
  .deserializer(APIHelper.method(:custom_type_deserializer))
108
106
  .deserialize_into(Invoice.method(:from_hash))