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.
- checksums.yaml +4 -4
- data/README.md +59 -297
- data/lib/advanced_billing/client.rb +21 -22
- data/lib/advanced_billing/configuration.rb +17 -18
- data/lib/advanced_billing/controllers/advance_invoice_controller.rb +8 -10
- data/lib/advanced_billing/controllers/api_exports_controller.rb +9 -9
- data/lib/advanced_billing/controllers/base_controller.rb +2 -1
- data/lib/advanced_billing/controllers/billing_portal_controller.rb +4 -4
- data/lib/advanced_billing/controllers/components_controller.rb +22 -22
- data/lib/advanced_billing/controllers/coupons_controller.rb +14 -14
- data/lib/advanced_billing/controllers/custom_fields_controller.rb +9 -9
- data/lib/advanced_billing/controllers/customers_controller.rb +7 -7
- data/lib/advanced_billing/controllers/events_based_billing_segments_controller.rb +6 -6
- data/lib/advanced_billing/controllers/events_controller.rb +3 -3
- data/lib/advanced_billing/controllers/insights_controller.rb +4 -4
- data/lib/advanced_billing/controllers/invoices_controller.rb +24 -20
- data/lib/advanced_billing/controllers/offers_controller.rb +5 -5
- data/lib/advanced_billing/controllers/payment_profiles_controller.rb +12 -12
- data/lib/advanced_billing/controllers/product_families_controller.rb +4 -4
- data/lib/advanced_billing/controllers/product_price_points_controller.rb +11 -11
- data/lib/advanced_billing/controllers/products_controller.rb +6 -6
- data/lib/advanced_billing/controllers/proforma_invoices_controller.rb +44 -25
- data/lib/advanced_billing/controllers/reason_codes_controller.rb +5 -5
- data/lib/advanced_billing/controllers/referral_codes_controller.rb +2 -2
- data/lib/advanced_billing/controllers/sales_commissions_controller.rb +3 -3
- data/lib/advanced_billing/controllers/sites_controller.rb +3 -3
- data/lib/advanced_billing/controllers/subscription_components_controller.rb +37 -31
- data/lib/advanced_billing/controllers/subscription_group_invoice_account_controller.rb +4 -4
- data/lib/advanced_billing/controllers/subscription_group_status_controller.rb +4 -4
- data/lib/advanced_billing/controllers/subscription_groups_controller.rb +23 -16
- data/lib/advanced_billing/controllers/subscription_invoice_account_controller.rb +11 -7
- data/lib/advanced_billing/controllers/subscription_notes_controller.rb +5 -5
- data/lib/advanced_billing/controllers/subscription_products_controller.rb +2 -2
- data/lib/advanced_billing/controllers/subscription_status_controller.rb +10 -10
- data/lib/advanced_billing/controllers/subscriptions_controller.rb +12 -12
- data/lib/advanced_billing/controllers/webhooks_controller.rb +8 -8
- data/lib/advanced_billing/exceptions/subscription_group_create_error_response_exception.rb +34 -0
- data/lib/advanced_billing/http/auth/basic_auth.rb +27 -6
- data/lib/advanced_billing/models/account_balance.rb +44 -3
- data/lib/advanced_billing/models/account_balances.rb +24 -2
- data/lib/advanced_billing/models/ach_agreement.rb +12 -2
- data/lib/advanced_billing/models/activate_subscription_request.rb +12 -2
- data/lib/advanced_billing/models/add_coupons_request.rb +12 -2
- data/lib/advanced_billing/models/add_subscription_to_a_group.rb +12 -2
- data/lib/advanced_billing/models/address_change.rb +12 -2
- data/lib/advanced_billing/models/agreement_acceptance.rb +12 -2
- data/lib/advanced_billing/models/allocate_components.rb +12 -2
- data/lib/advanced_billing/models/allocation.rb +56 -2
- data/lib/advanced_billing/models/allocation_expiration_date.rb +23 -4
- data/lib/advanced_billing/models/allocation_preview.rb +33 -6
- data/lib/advanced_billing/models/allocation_preview_item.rb +12 -2
- data/lib/advanced_billing/models/allocation_preview_line_item.rb +12 -2
- data/lib/advanced_billing/models/allocation_preview_response.rb +12 -2
- data/lib/advanced_billing/models/allocation_response.rb +12 -2
- data/lib/advanced_billing/models/allocation_settings.rb +12 -2
- data/lib/advanced_billing/models/applied_credit_note_data.rb +12 -2
- data/lib/advanced_billing/models/apply_credit_note_event_data.rb +12 -2
- data/lib/advanced_billing/models/apply_debit_note_event_data.rb +12 -2
- data/lib/advanced_billing/models/apply_payment_event_data.rb +12 -2
- data/lib/advanced_billing/models/attribute_error.rb +12 -2
- data/lib/advanced_billing/models/auto_resume.rb +12 -2
- data/lib/advanced_billing/models/bank_account_attributes.rb +12 -2
- data/lib/advanced_billing/models/bank_account_payment_profile.rb +13 -2
- data/lib/advanced_billing/models/bank_account_response.rb +12 -2
- data/lib/advanced_billing/models/bank_account_verification.rb +12 -2
- data/lib/advanced_billing/models/bank_account_verification_request.rb +12 -2
- data/lib/advanced_billing/models/base_refund_error.rb +12 -2
- data/lib/advanced_billing/models/base_string_error.rb +12 -2
- data/lib/advanced_billing/models/batch_job.rb +33 -6
- data/lib/advanced_billing/models/batch_job_response.rb +12 -2
- data/lib/advanced_billing/models/billing_address.rb +12 -2
- data/lib/advanced_billing/models/billing_manifest.rb +33 -6
- data/lib/advanced_billing/models/billing_manifest_item.rb +12 -2
- data/lib/advanced_billing/models/billing_schedule.rb +12 -2
- data/lib/advanced_billing/models/breakouts.rb +12 -2
- data/lib/advanced_billing/models/{bulk_component_s_price_point_assignment.rb → bulk_components_price_point_assignment.rb} +16 -6
- data/lib/advanced_billing/models/bulk_create_product_price_points_request.rb +12 -2
- data/lib/advanced_billing/models/bulk_create_product_price_points_response.rb +12 -2
- data/lib/advanced_billing/models/bulk_create_segments.rb +12 -2
- data/lib/advanced_billing/models/bulk_update_segments.rb +12 -2
- data/lib/advanced_billing/models/bulk_update_segments_item.rb +12 -2
- data/lib/advanced_billing/models/calendar_billing.rb +12 -2
- data/lib/advanced_billing/models/cancel_grouped_subscriptions_request.rb +12 -2
- data/lib/advanced_billing/models/cancellation_options.rb +12 -2
- data/lib/advanced_billing/models/cancellation_request.rb +12 -2
- data/lib/advanced_billing/models/change_invoice_collection_method_event_data.rb +12 -2
- data/lib/advanced_billing/models/chargify_ebb.rb +33 -6
- data/lib/advanced_billing/models/component.rb +22 -4
- data/lib/advanced_billing/models/component_allocation_change.rb +12 -2
- data/lib/advanced_billing/models/component_allocation_error_item.rb +12 -2
- data/lib/advanced_billing/models/component_cost_data.rb +12 -2
- data/lib/advanced_billing/models/component_cost_data_rate_tier.rb +12 -2
- data/lib/advanced_billing/models/component_currency_price.rb +12 -2
- data/lib/advanced_billing/models/component_currency_prices_response.rb +12 -2
- data/lib/advanced_billing/models/component_custom_price.rb +12 -2
- data/lib/advanced_billing/models/component_price.rb +12 -2
- data/lib/advanced_billing/models/component_price_point.rb +12 -2
- data/lib/advanced_billing/models/{component_s_price_point_assignment.rb → component_price_point_assignment.rb} +17 -7
- data/lib/advanced_billing/models/component_price_point_error_item.rb +12 -2
- data/lib/advanced_billing/models/component_price_point_item.rb +12 -2
- data/lib/advanced_billing/models/component_price_point_response.rb +12 -2
- data/lib/advanced_billing/models/component_price_points_response.rb +12 -2
- data/lib/advanced_billing/models/component_response.rb +12 -2
- data/lib/advanced_billing/models/consolidated_invoice.rb +12 -2
- data/lib/advanced_billing/models/count_response.rb +12 -2
- data/lib/advanced_billing/models/coupon.rb +78 -12
- data/lib/advanced_billing/models/coupon_currency.rb +12 -2
- data/lib/advanced_billing/models/coupon_currency_request.rb +12 -2
- data/lib/advanced_billing/models/coupon_currency_response.rb +12 -2
- data/lib/advanced_billing/models/coupon_response.rb +12 -2
- data/lib/advanced_billing/models/coupon_restriction.rb +12 -2
- data/lib/advanced_billing/models/coupon_subcodes.rb +12 -2
- data/lib/advanced_billing/models/coupon_subcodes_response.rb +12 -2
- data/lib/advanced_billing/models/coupon_usage.rb +12 -2
- data/lib/advanced_billing/models/create_allocation.rb +12 -2
- data/lib/advanced_billing/models/create_allocation_request.rb +12 -2
- data/lib/advanced_billing/models/create_component_price_point.rb +12 -2
- data/lib/advanced_billing/models/create_component_price_point_request.rb +12 -2
- data/lib/advanced_billing/models/create_component_price_points_request.rb +12 -2
- data/lib/advanced_billing/models/create_currency_price.rb +12 -2
- data/lib/advanced_billing/models/create_currency_prices_request.rb +12 -2
- data/lib/advanced_billing/models/create_customer.rb +12 -2
- data/lib/advanced_billing/models/create_customer_request.rb +12 -2
- data/lib/advanced_billing/models/create_ebb_component.rb +12 -2
- data/lib/advanced_billing/models/create_invoice.rb +12 -2
- data/lib/advanced_billing/models/create_invoice_address.rb +12 -2
- data/lib/advanced_billing/models/create_invoice_coupon.rb +12 -2
- data/lib/advanced_billing/models/create_invoice_item.rb +12 -2
- data/lib/advanced_billing/models/create_invoice_payment.rb +23 -2
- data/lib/advanced_billing/models/create_invoice_payment_application.rb +12 -2
- data/lib/advanced_billing/models/create_invoice_payment_request.rb +12 -2
- data/lib/advanced_billing/models/create_invoice_request.rb +12 -2
- data/lib/advanced_billing/models/create_metadata.rb +12 -2
- data/lib/advanced_billing/models/create_metadata_request.rb +12 -2
- data/lib/advanced_billing/models/create_metafield.rb +12 -2
- data/lib/advanced_billing/models/create_metafields_request.rb +12 -2
- data/lib/advanced_billing/models/create_metered_component.rb +12 -2
- data/lib/advanced_billing/models/create_multi_invoice_payment.rb +12 -2
- data/lib/advanced_billing/models/create_multi_invoice_payment_request.rb +12 -2
- data/lib/advanced_billing/models/create_offer.rb +12 -2
- data/lib/advanced_billing/models/create_offer_component.rb +12 -2
- data/lib/advanced_billing/models/create_offer_request.rb +12 -2
- data/lib/advanced_billing/models/create_on_off_component.rb +12 -2
- data/lib/advanced_billing/models/create_or_update_coupon.rb +12 -2
- data/lib/advanced_billing/models/{update_endpoint.rb → create_or_update_endpoint.rb} +14 -4
- data/lib/advanced_billing/models/{update_endpoint_request.rb → create_or_update_endpoint_request.rb} +15 -5
- data/lib/advanced_billing/models/create_or_update_flat_amount_coupon.rb +29 -2
- data/lib/advanced_billing/models/create_or_update_percentage_coupon.rb +29 -2
- data/lib/advanced_billing/models/create_or_update_product.rb +86 -4
- data/lib/advanced_billing/models/create_or_update_product_request.rb +12 -2
- data/lib/advanced_billing/models/create_or_update_segment_price.rb +12 -2
- data/lib/advanced_billing/models/create_payment.rb +14 -4
- data/lib/advanced_billing/models/create_payment_profile.rb +12 -2
- data/lib/advanced_billing/models/create_payment_profile_request.rb +12 -2
- data/lib/advanced_billing/models/create_prepaid_component.rb +12 -2
- data/lib/advanced_billing/models/create_prepaid_usage_component_price_point.rb +12 -2
- data/lib/advanced_billing/models/create_prepayment.rb +13 -3
- data/lib/advanced_billing/models/create_prepayment_method.rb +44 -0
- data/lib/advanced_billing/models/create_prepayment_request.rb +12 -2
- data/lib/advanced_billing/models/create_prepayment_response.rb +12 -2
- data/lib/advanced_billing/models/create_product_currency_price.rb +12 -2
- data/lib/advanced_billing/models/create_product_currency_prices_request.rb +12 -2
- data/lib/advanced_billing/models/create_product_family.rb +12 -2
- data/lib/advanced_billing/models/create_product_family_request.rb +12 -2
- data/lib/advanced_billing/models/create_product_price_point.rb +16 -6
- data/lib/advanced_billing/models/create_product_price_point_request.rb +12 -2
- data/lib/advanced_billing/models/create_quantity_based_component.rb +12 -2
- data/lib/advanced_billing/models/create_reason_code.rb +12 -2
- data/lib/advanced_billing/models/create_reason_code_request.rb +12 -2
- data/lib/advanced_billing/models/create_segment.rb +12 -2
- data/lib/advanced_billing/models/create_segment_request.rb +12 -2
- data/lib/advanced_billing/models/create_signup_proforma_preview_include.rb +20 -0
- data/lib/advanced_billing/models/create_subscription.rb +22 -4
- data/lib/advanced_billing/models/create_subscription_component.rb +12 -2
- data/lib/advanced_billing/models/create_subscription_group.rb +15 -20
- data/lib/advanced_billing/models/create_subscription_group_request.rb +12 -2
- data/lib/advanced_billing/models/create_subscription_request.rb +12 -2
- data/lib/advanced_billing/models/create_usage.rb +12 -2
- data/lib/advanced_billing/models/create_usage_request.rb +12 -2
- data/lib/advanced_billing/models/created_prepayment.rb +23 -4
- data/lib/advanced_billing/models/credit_account_balance_changed.rb +22 -5
- data/lib/advanced_billing/models/credit_card_attributes.rb +12 -2
- data/lib/advanced_billing/models/credit_card_payment_profile.rb +12 -2
- data/lib/advanced_billing/models/credit_note.rb +12 -2
- data/lib/advanced_billing/models/credit_note1.rb +12 -2
- data/lib/advanced_billing/models/credit_note_application.rb +23 -5
- data/lib/advanced_billing/models/credit_note_line_item.rb +38 -4
- data/lib/advanced_billing/models/credit_scheme_request.rb +12 -2
- data/lib/advanced_billing/models/currency_price.rb +12 -2
- data/lib/advanced_billing/models/currency_prices_response.rb +12 -2
- data/lib/advanced_billing/models/custom_field_value_change.rb +12 -2
- data/lib/advanced_billing/models/customer.rb +63 -15
- data/lib/advanced_billing/models/customer1.rb +13 -2
- data/lib/advanced_billing/models/customer_attributes.rb +12 -2
- data/lib/advanced_billing/models/customer_change.rb +12 -2
- data/lib/advanced_billing/models/customer_changes_preview_response.rb +12 -2
- data/lib/advanced_billing/models/customer_custom_fields_change.rb +12 -2
- data/lib/advanced_billing/models/customer_error.rb +12 -2
- data/lib/advanced_billing/models/customer_payer_change.rb +12 -2
- data/lib/advanced_billing/models/customer_response.rb +12 -2
- data/lib/advanced_billing/models/deduct_service_credit.rb +12 -2
- data/lib/advanced_billing/models/deduct_service_credit_request.rb +12 -2
- data/lib/advanced_billing/models/delayed_cancellation_response.rb +12 -2
- data/lib/advanced_billing/models/delete_subscription_group_response.rb +12 -2
- data/lib/advanced_billing/models/dunner_data.rb +29 -7
- data/lib/advanced_billing/models/dunning_step_data.rb +12 -2
- data/lib/advanced_billing/models/dunning_step_reached.rb +12 -2
- data/lib/advanced_billing/models/ebb_component.rb +12 -2
- data/lib/advanced_billing/models/ebb_event.rb +12 -2
- data/lib/advanced_billing/models/enable_webhooks_request.rb +12 -2
- data/lib/advanced_billing/models/enable_webhooks_response.rb +12 -2
- data/lib/advanced_billing/models/endpoint.rb +12 -2
- data/lib/advanced_billing/models/endpoint_response.rb +12 -2
- data/lib/advanced_billing/models/errors.rb +12 -2
- data/lib/advanced_billing/models/event.rb +23 -5
- data/lib/advanced_billing/models/event_based_billing_segment_error.rb +12 -2
- data/lib/advanced_billing/models/event_response.rb +12 -2
- data/lib/advanced_billing/models/full_subscription_group_response.rb +369 -11
- data/lib/advanced_billing/models/get_one_time_token_payment_profile.rb +12 -2
- data/lib/advanced_billing/models/get_one_time_token_request.rb +12 -2
- data/lib/advanced_billing/models/group_billing.rb +12 -2
- data/lib/advanced_billing/models/group_settings.rb +12 -2
- data/lib/advanced_billing/models/group_target.rb +12 -2
- data/lib/advanced_billing/models/group_type.rb +23 -0
- data/lib/advanced_billing/models/invoice.rb +12 -2
- data/lib/advanced_billing/models/invoice_address.rb +12 -2
- data/lib/advanced_billing/models/invoice_balance_item.rb +12 -2
- data/lib/advanced_billing/models/invoice_credit.rb +12 -2
- data/lib/advanced_billing/models/invoice_custom_field.rb +12 -2
- data/lib/advanced_billing/models/invoice_customer.rb +13 -2
- data/lib/advanced_billing/models/invoice_discount.rb +14 -4
- data/lib/advanced_billing/models/invoice_discount_breakout.rb +12 -2
- data/lib/advanced_billing/models/invoice_discount_source_type.rb +26 -0
- data/lib/advanced_billing/models/invoice_discount_type.rb +26 -0
- data/lib/advanced_billing/models/invoice_display_settings.rb +12 -2
- data/lib/advanced_billing/models/invoice_event.rb +23 -4
- data/lib/advanced_billing/models/invoice_event_data.rb +12 -2
- data/lib/advanced_billing/models/invoice_event_payment.rb +12 -2
- data/lib/advanced_billing/models/invoice_event_payment1.rb +12 -2
- data/lib/advanced_billing/models/invoice_issued.rb +27 -15
- data/lib/advanced_billing/models/invoice_line_item.rb +22 -2
- data/lib/advanced_billing/models/invoice_line_item_component_cost_data.rb +12 -2
- data/lib/advanced_billing/models/invoice_line_item_event_data.rb +12 -2
- data/lib/advanced_billing/models/invoice_line_item_pricing_detail.rb +12 -2
- data/lib/advanced_billing/models/invoice_payer.rb +12 -2
- data/lib/advanced_billing/models/invoice_payer_change.rb +12 -2
- data/lib/advanced_billing/models/invoice_payment.rb +12 -2
- data/lib/advanced_billing/models/invoice_payment_application.rb +12 -2
- data/lib/advanced_billing/models/invoice_payment_method.rb +12 -2
- data/lib/advanced_billing/models/invoice_pre_payment.rb +25 -5
- data/lib/advanced_billing/models/invoice_previous_balance.rb +12 -2
- data/lib/advanced_billing/models/invoice_refund.rb +34 -2
- data/lib/advanced_billing/models/invoice_response.rb +12 -2
- data/lib/advanced_billing/models/invoice_seller.rb +12 -2
- data/lib/advanced_billing/models/invoice_tax.rb +13 -3
- data/lib/advanced_billing/models/invoice_tax_breakout.rb +23 -2
- data/lib/advanced_billing/models/invoice_tax_component_breakout.rb +12 -2
- data/lib/advanced_billing/models/issue_advance_invoice_request.rb +12 -2
- data/lib/advanced_billing/models/issue_invoice_event_data.rb +12 -2
- data/lib/advanced_billing/models/issue_invoice_request.rb +12 -2
- data/lib/advanced_billing/models/issue_service_credit.rb +12 -2
- data/lib/advanced_billing/models/issue_service_credit_request.rb +12 -2
- data/lib/advanced_billing/models/item_price_point_changed.rb +12 -2
- data/lib/advanced_billing/models/item_price_point_data.rb +12 -2
- data/lib/advanced_billing/models/list_components_price_points_response.rb +12 -2
- data/lib/advanced_billing/models/list_credit_notes_response.rb +12 -2
- data/lib/advanced_billing/models/list_invoice_events_response.rb +12 -2
- data/lib/advanced_billing/models/list_invoices_response.rb +12 -2
- data/lib/advanced_billing/models/list_metafields_response.rb +12 -2
- data/lib/advanced_billing/models/list_mrr_response.rb +12 -2
- data/lib/advanced_billing/models/list_mrr_response_result.rb +12 -2
- data/lib/advanced_billing/models/list_offers_response.rb +12 -2
- data/lib/advanced_billing/models/list_product_price_points_response.rb +12 -2
- data/lib/advanced_billing/models/list_proforma_invoices_meta.rb +90 -0
- data/lib/advanced_billing/models/list_proforma_invoices_response.rb +79 -0
- data/lib/advanced_billing/models/list_public_keys_meta.rb +12 -2
- data/lib/advanced_billing/models/list_public_keys_response.rb +12 -2
- data/lib/advanced_billing/models/list_sale_rep_item.rb +12 -2
- data/lib/advanced_billing/models/list_segments_response.rb +12 -2
- data/lib/advanced_billing/models/list_subcription_group_prepayment_item.rb +25 -12
- data/lib/advanced_billing/models/list_subscription_components_response.rb +12 -2
- data/lib/advanced_billing/models/list_subscription_group_prepayment.rb +12 -2
- data/lib/advanced_billing/models/list_subscription_group_prepayment_response.rb +12 -2
- data/lib/advanced_billing/models/list_subscription_groups_item.rb +33 -5
- data/lib/advanced_billing/models/list_subscription_groups_meta.rb +12 -2
- data/lib/advanced_billing/models/list_subscription_groups_response.rb +12 -2
- data/lib/advanced_billing/models/metadata.rb +23 -4
- data/lib/advanced_billing/models/metafield.rb +12 -2
- data/lib/advanced_billing/models/metafield_scope.rb +12 -2
- data/lib/advanced_billing/models/metered_component.rb +12 -2
- data/lib/advanced_billing/models/metered_usage.rb +12 -2
- data/lib/advanced_billing/models/movement.rb +23 -4
- data/lib/advanced_billing/models/movement_line_item.rb +12 -2
- data/lib/advanced_billing/models/mrr.rb +23 -4
- data/lib/advanced_billing/models/mrr_movement.rb +12 -2
- data/lib/advanced_billing/models/mrr_response.rb +12 -2
- data/lib/advanced_billing/models/multi_invoice_payment.rb +12 -2
- data/lib/advanced_billing/models/multi_invoice_payment_response.rb +12 -2
- data/lib/advanced_billing/models/nested_subscription_group.rb +12 -2
- data/lib/advanced_billing/models/net_terms.rb +12 -2
- data/lib/advanced_billing/models/offer.rb +43 -8
- data/lib/advanced_billing/models/offer_discount.rb +12 -2
- data/lib/advanced_billing/models/offer_item.rb +12 -2
- data/lib/advanced_billing/models/offer_response.rb +12 -2
- data/lib/advanced_billing/models/offer_signup_page.rb +12 -2
- data/lib/advanced_billing/models/on_off_component.rb +12 -2
- data/lib/advanced_billing/models/organization_address.rb +12 -2
- data/lib/advanced_billing/models/origin_invoice.rb +12 -2
- data/lib/advanced_billing/models/overage_pricing.rb +12 -2
- data/lib/advanced_billing/models/override_subscription.rb +12 -2
- data/lib/advanced_billing/models/override_subscription_request.rb +12 -2
- data/lib/advanced_billing/models/paginated_metadata.rb +12 -2
- data/lib/advanced_billing/models/{payment.rb → paid_invoice.rb} +23 -13
- data/lib/advanced_billing/models/pause_request.rb +12 -2
- data/lib/advanced_billing/models/payer_attributes.rb +13 -3
- data/lib/advanced_billing/models/payer_error.rb +12 -2
- data/lib/advanced_billing/models/payment_collection_method_changed.rb +12 -2
- data/lib/advanced_billing/models/payment_for_allocation.rb +12 -2
- data/lib/advanced_billing/models/payment_method_apple_pay.rb +12 -2
- data/lib/advanced_billing/models/payment_method_bank_account.rb +12 -2
- data/lib/advanced_billing/models/payment_method_credit_card.rb +12 -2
- data/lib/advanced_billing/models/payment_method_external.rb +12 -2
- data/lib/advanced_billing/models/payment_method_paypal.rb +12 -2
- data/lib/advanced_billing/models/payment_profile_attributes.rb +12 -2
- data/lib/advanced_billing/models/payment_profile_response.rb +12 -2
- data/lib/advanced_billing/models/payment_related_events.rb +12 -2
- data/lib/advanced_billing/models/pending_cancellation_change.rb +22 -5
- data/lib/advanced_billing/models/portal_management_link.rb +53 -12
- data/lib/advanced_billing/models/prepaid_component_price_point.rb +12 -2
- data/lib/advanced_billing/models/prepaid_configuration.rb +12 -2
- data/lib/advanced_billing/models/prepaid_configuration_response.rb +12 -2
- data/lib/advanced_billing/models/prepaid_subscription_balance_changed.rb +12 -2
- data/lib/advanced_billing/models/prepaid_usage.rb +12 -2
- data/lib/advanced_billing/models/prepaid_usage_allocation_detail.rb +12 -2
- data/lib/advanced_billing/models/prepaid_usage_component.rb +12 -2
- data/lib/advanced_billing/models/prepayment.rb +21 -4
- data/lib/advanced_billing/models/prepayment_account_balance_changed.rb +12 -2
- data/lib/advanced_billing/models/prepayment_aggregated_error.rb +12 -2
- data/lib/advanced_billing/models/prepayment_method.rb +3 -6
- data/lib/advanced_billing/models/prepayment_response.rb +12 -2
- data/lib/advanced_billing/models/prepayments_response.rb +12 -2
- data/lib/advanced_billing/models/preview_allocations_request.rb +12 -2
- data/lib/advanced_billing/models/price.rb +12 -2
- data/lib/advanced_billing/models/price_point.rb +12 -2
- data/lib/advanced_billing/models/product.rb +14 -4
- data/lib/advanced_billing/models/product_family.rb +33 -6
- data/lib/advanced_billing/models/product_family_response.rb +12 -2
- data/lib/advanced_billing/models/product_price_point.rb +16 -6
- data/lib/advanced_billing/models/product_price_point_errors.rb +12 -2
- data/lib/advanced_billing/models/product_price_point_response.rb +12 -2
- data/lib/advanced_billing/models/product_response.rb +12 -2
- data/lib/advanced_billing/models/proforma_error.rb +12 -2
- data/lib/advanced_billing/models/proforma_invoice.rb +87 -19
- data/lib/advanced_billing/models/proforma_invoice_credit.rb +12 -2
- data/lib/advanced_billing/models/proforma_invoice_discount.rb +37 -7
- data/lib/advanced_billing/models/proforma_invoice_discount_source_type.rb +23 -0
- data/lib/advanced_billing/models/proforma_invoice_issued.rb +23 -6
- data/lib/advanced_billing/models/proforma_invoice_payment.rb +12 -2
- data/lib/advanced_billing/models/proforma_invoice_role.rb +30 -0
- data/lib/advanced_billing/models/proforma_invoice_status.rb +26 -0
- data/lib/advanced_billing/models/proforma_invoice_tax.rb +15 -5
- data/lib/advanced_billing/models/proforma_invoice_tax_source_type.rb +23 -0
- data/lib/advanced_billing/models/proration.rb +12 -2
- data/lib/advanced_billing/models/public_key.rb +23 -4
- data/lib/advanced_billing/models/public_signup_page.rb +12 -2
- data/lib/advanced_billing/models/quantity_based_component.rb +12 -2
- data/lib/advanced_billing/models/reactivate_subscription_group_request.rb +12 -2
- data/lib/advanced_billing/models/reactivate_subscription_group_response.rb +23 -5
- data/lib/advanced_billing/models/reactivate_subscription_request.rb +12 -2
- data/lib/advanced_billing/models/reactivation_billing.rb +12 -2
- data/lib/advanced_billing/models/reason_code.rb +33 -6
- data/lib/advanced_billing/models/reason_code_response.rb +12 -2
- data/lib/advanced_billing/models/reason_codes_json_response.rb +12 -2
- data/lib/advanced_billing/models/record_payment_request.rb +12 -2
- data/lib/advanced_billing/models/{payment_response.rb → record_payment_response.rb} +33 -9
- data/lib/advanced_billing/models/referral_code.rb +12 -2
- data/lib/advanced_billing/models/referral_validation_response.rb +12 -2
- data/lib/advanced_billing/models/refund.rb +12 -2
- data/lib/advanced_billing/models/refund_consolidated_invoice.rb +12 -2
- data/lib/advanced_billing/models/refund_invoice.rb +12 -2
- data/lib/advanced_billing/models/refund_invoice_event_data.rb +12 -2
- data/lib/advanced_billing/models/refund_invoice_request.rb +12 -2
- data/lib/advanced_billing/models/refund_prepayment.rb +12 -2
- data/lib/advanced_billing/models/refund_prepayment_aggregated_error.rb +12 -2
- data/lib/advanced_billing/models/refund_prepayment_base_refund_error.rb +12 -2
- data/lib/advanced_billing/models/refund_prepayment_request.rb +12 -2
- data/lib/advanced_billing/models/refund_success.rb +12 -2
- data/lib/advanced_billing/models/remove_payment_event_data.rb +12 -2
- data/lib/advanced_billing/models/renewal_preview.rb +23 -5
- data/lib/advanced_billing/models/renewal_preview_component.rb +12 -2
- data/lib/advanced_billing/models/renewal_preview_line_item.rb +12 -2
- data/lib/advanced_billing/models/renewal_preview_request.rb +12 -2
- data/lib/advanced_billing/models/renewal_preview_response.rb +12 -2
- data/lib/advanced_billing/models/replay_webhooks_request.rb +12 -2
- data/lib/advanced_billing/models/replay_webhooks_response.rb +12 -2
- data/lib/advanced_billing/models/resent_invitation.rb +12 -2
- data/lib/advanced_billing/models/resume_options.rb +12 -2
- data/lib/advanced_billing/models/revoked_invitation.rb +12 -2
- data/lib/advanced_billing/models/sale_rep.rb +12 -2
- data/lib/advanced_billing/models/sale_rep_item_mrr.rb +12 -2
- data/lib/advanced_billing/models/sale_rep_settings.rb +12 -2
- data/lib/advanced_billing/models/sale_rep_subscription.rb +12 -2
- data/lib/advanced_billing/models/segment.rb +33 -6
- data/lib/advanced_billing/models/segment_price.rb +12 -2
- data/lib/advanced_billing/models/segment_response.rb +12 -2
- data/lib/advanced_billing/models/seller.rb +12 -2
- data/lib/advanced_billing/models/send_invoice_request.rb +12 -2
- data/lib/advanced_billing/models/service_credit.rb +12 -2
- data/lib/advanced_billing/models/service_credit_response.rb +12 -2
- data/lib/advanced_billing/models/shipping_address.rb +12 -2
- data/lib/advanced_billing/models/signup_proforma_preview.rb +12 -2
- data/lib/advanced_billing/models/signup_proforma_preview_response.rb +12 -2
- data/lib/advanced_billing/models/site.rb +12 -2
- data/lib/advanced_billing/models/site_response.rb +12 -2
- data/lib/advanced_billing/models/site_statistics.rb +16 -6
- data/lib/advanced_billing/models/site_summary.rb +12 -2
- data/lib/advanced_billing/models/subscription.rb +12 -2
- data/lib/advanced_billing/models/subscription_component.rb +22 -4
- data/lib/advanced_billing/models/subscription_component_allocation_error_item.rb +12 -2
- data/lib/advanced_billing/models/subscription_component_response.rb +12 -2
- data/lib/advanced_billing/models/subscription_component_subscription.rb +23 -4
- data/lib/advanced_billing/models/subscription_custom_price.rb +12 -2
- data/lib/advanced_billing/models/subscription_group.rb +38 -10
- data/lib/advanced_billing/models/subscription_group_balances.rb +12 -2
- data/lib/advanced_billing/models/subscription_group_bank_account.rb +12 -2
- data/lib/advanced_billing/models/subscription_group_component_custom_price.rb +12 -2
- data/lib/advanced_billing/models/subscription_group_credit_card.rb +12 -2
- data/lib/advanced_billing/models/subscription_group_customer.rb +12 -2
- data/lib/advanced_billing/models/subscription_group_include.rb +20 -0
- data/lib/advanced_billing/models/subscription_group_item.rb +12 -2
- data/lib/advanced_billing/models/subscription_group_member_error.rb +12 -2
- data/lib/advanced_billing/models/subscription_group_members_array_error.rb +72 -0
- data/lib/advanced_billing/models/subscription_group_payment_profile.rb +12 -2
- data/lib/advanced_billing/models/subscription_group_prepayment.rb +12 -2
- data/lib/advanced_billing/models/subscription_group_prepayment_request.rb +12 -2
- data/lib/advanced_billing/models/subscription_group_prepayment_response.rb +12 -2
- data/lib/advanced_billing/models/subscription_group_response.rb +12 -2
- data/lib/advanced_billing/models/subscription_group_signup.rb +12 -2
- data/lib/advanced_billing/models/subscription_group_signup_component.rb +12 -2
- data/lib/advanced_billing/models/subscription_group_signup_error.rb +12 -2
- data/lib/advanced_billing/models/subscription_group_signup_failure.rb +12 -2
- data/lib/advanced_billing/models/subscription_group_signup_failure_data.rb +12 -2
- data/lib/advanced_billing/models/subscription_group_signup_item.rb +12 -2
- data/lib/advanced_billing/models/subscription_group_signup_request.rb +12 -2
- data/lib/advanced_billing/models/subscription_group_signup_response.rb +231 -9
- data/lib/advanced_billing/models/subscription_group_signup_success.rb +12 -2
- data/lib/advanced_billing/models/subscription_group_signup_success_data.rb +21 -5
- data/lib/advanced_billing/models/subscription_group_single_error.rb +73 -0
- data/lib/advanced_billing/models/subscription_group_subscription_error.rb +66 -2
- data/lib/advanced_billing/models/subscription_group_update_error.rb +12 -2
- data/lib/advanced_billing/models/subscription_groups_list_include.rb +20 -0
- data/lib/advanced_billing/models/subscription_included_coupon.rb +12 -2
- data/lib/advanced_billing/models/subscription_migration_preview.rb +12 -2
- data/lib/advanced_billing/models/subscription_migration_preview_options.rb +23 -5
- data/lib/advanced_billing/models/subscription_migration_preview_request.rb +12 -2
- data/lib/advanced_billing/models/subscription_migration_preview_response.rb +12 -2
- data/lib/advanced_billing/models/subscription_mrr.rb +12 -2
- data/lib/advanced_billing/models/subscription_mrr_breakout.rb +12 -2
- data/lib/advanced_billing/models/subscription_mrr_response.rb +12 -2
- data/lib/advanced_billing/models/subscription_note.rb +33 -6
- data/lib/advanced_billing/models/subscription_note_response.rb +12 -2
- data/lib/advanced_billing/models/subscription_preview.rb +12 -2
- data/lib/advanced_billing/models/subscription_preview_response.rb +12 -2
- data/lib/advanced_billing/models/subscription_product_change.rb +12 -2
- data/lib/advanced_billing/models/subscription_product_migration.rb +12 -2
- data/lib/advanced_billing/models/subscription_product_migration_request.rb +12 -2
- data/lib/advanced_billing/models/subscription_response.rb +12 -2
- data/lib/advanced_billing/models/subscription_state_change.rb +12 -2
- data/lib/advanced_billing/models/tax_configuration.rb +12 -2
- data/lib/advanced_billing/models/too_many_management_link_requests.rb +12 -2
- data/lib/advanced_billing/models/update_allocation_expiration_date.rb +12 -2
- data/lib/advanced_billing/models/update_component.rb +12 -2
- data/lib/advanced_billing/models/update_component_price_point.rb +12 -2
- data/lib/advanced_billing/models/update_component_price_point_request.rb +12 -2
- data/lib/advanced_billing/models/update_component_request.rb +12 -2
- data/lib/advanced_billing/models/update_coupon_currency.rb +12 -2
- data/lib/advanced_billing/models/update_currency_price.rb +12 -2
- data/lib/advanced_billing/models/update_currency_prices_request.rb +12 -2
- data/lib/advanced_billing/models/update_customer.rb +12 -2
- data/lib/advanced_billing/models/update_customer_request.rb +12 -2
- data/lib/advanced_billing/models/update_metadata.rb +12 -2
- data/lib/advanced_billing/models/update_metadata_request.rb +12 -2
- data/lib/advanced_billing/models/update_metafield.rb +12 -2
- data/lib/advanced_billing/models/update_metafields_request.rb +12 -2
- data/lib/advanced_billing/models/update_payment_profile.rb +12 -2
- data/lib/advanced_billing/models/update_payment_profile_request.rb +12 -2
- data/lib/advanced_billing/models/update_price.rb +12 -2
- data/lib/advanced_billing/models/update_product_price_point.rb +12 -2
- data/lib/advanced_billing/models/update_product_price_point_request.rb +12 -2
- data/lib/advanced_billing/models/update_reason_code.rb +12 -2
- data/lib/advanced_billing/models/update_reason_code_request.rb +12 -2
- data/lib/advanced_billing/models/update_segment.rb +12 -2
- data/lib/advanced_billing/models/update_segment_request.rb +12 -2
- data/lib/advanced_billing/models/update_subscription.rb +23 -5
- data/lib/advanced_billing/models/update_subscription_component.rb +12 -2
- data/lib/advanced_billing/models/update_subscription_group.rb +12 -2
- data/lib/advanced_billing/models/update_subscription_group_request.rb +12 -2
- data/lib/advanced_billing/models/update_subscription_note.rb +12 -2
- data/lib/advanced_billing/models/update_subscription_note_request.rb +12 -2
- data/lib/advanced_billing/models/update_subscription_request.rb +12 -2
- data/lib/advanced_billing/models/upsert_prepaid_configuration.rb +12 -2
- data/lib/advanced_billing/models/upsert_prepaid_configuration_request.rb +12 -2
- data/lib/advanced_billing/models/usage.rb +12 -2
- data/lib/advanced_billing/models/usage_response.rb +12 -2
- data/lib/advanced_billing/models/void_invoice.rb +12 -2
- data/lib/advanced_billing/models/void_invoice_event_data.rb +12 -2
- data/lib/advanced_billing/models/void_invoice_request.rb +12 -2
- data/lib/advanced_billing/models/void_remainder_event_data.rb +12 -2
- data/lib/advanced_billing/models/webhook.rb +53 -10
- data/lib/advanced_billing/models/webhook_response.rb +12 -2
- data/lib/advanced_billing/utilities/union_type_lookup.rb +20 -8
- data/lib/advanced_billing.rb +25 -12
- metadata +24 -11
- data/lib/advanced_billing/models/proforma_invoice_discount_breakout.rb +0 -62
- data/lib/advanced_billing/models/proforma_invoice_preview.rb +0 -484
- 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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 56ad6bf7a546dec06d225320086160fc7268eabaa8494758580cb136cd957526
|
4
|
+
data.tar.gz: 5c251518ad00a555d27146b7c2f317ac169474ecf303e4de1216b44e84189f4d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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
|
-
|
10
|
+
### Steps to make your first Maxio Advanced Billing API call
|
9
11
|
|
10
|
-
|
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
|
-
|
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
|
-
|
20
|
+
#### Example
|
15
21
|
|
16
|
-
|
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
|
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', '
|
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/
|
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/
|
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
|
-
| `
|
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
|
-
|
313
|
-
|
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
|
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/
|
338
|
-
* [Advance Invoice](https://www.github.com/maxio-com/ab-ruby-sdk/tree/
|
339
|
-
* [Billing Portal](https://www.github.com/maxio-com/ab-ruby-sdk/tree/
|
340
|
-
* [Custom Fields](https://www.github.com/maxio-com/ab-ruby-sdk/tree/
|
341
|
-
* [Events-Based Billing Segments](https://www.github.com/maxio-com/ab-ruby-sdk/tree/
|
342
|
-
* [Payment Profiles](https://www.github.com/maxio-com/ab-ruby-sdk/tree/
|
343
|
-
* [Product Families](https://www.github.com/maxio-com/ab-ruby-sdk/tree/
|
344
|
-
* [Product Price Points](https://www.github.com/maxio-com/ab-ruby-sdk/tree/
|
345
|
-
* [Proforma Invoices](https://www.github.com/maxio-com/ab-ruby-sdk/tree/
|
346
|
-
* [Reason Codes](https://www.github.com/maxio-com/ab-ruby-sdk/tree/
|
347
|
-
* [Referral Codes](https://www.github.com/maxio-com/ab-ruby-sdk/tree/
|
348
|
-
* [Sales Commissions](https://www.github.com/maxio-com/ab-ruby-sdk/tree/
|
349
|
-
* [Subscription Components](https://www.github.com/maxio-com/ab-ruby-sdk/tree/
|
350
|
-
* [Subscription Groups](https://www.github.com/maxio-com/ab-ruby-sdk/tree/
|
351
|
-
* [Subscription Group Invoice Account](https://www.github.com/maxio-com/ab-ruby-sdk/tree/
|
352
|
-
* [Subscription Group Status](https://www.github.com/maxio-com/ab-ruby-sdk/tree/
|
353
|
-
* [Subscription Invoice Account](https://www.github.com/maxio-com/ab-ruby-sdk/tree/
|
354
|
-
* [Subscription Notes](https://www.github.com/maxio-com/ab-ruby-sdk/tree/
|
355
|
-
* [Subscription Products](https://www.github.com/maxio-com/ab-ruby-sdk/tree/
|
356
|
-
* [Subscription Status](https://www.github.com/maxio-com/ab-ruby-sdk/tree/
|
357
|
-
* [Coupons](https://www.github.com/maxio-com/ab-ruby-sdk/tree/
|
358
|
-
* [Components](https://www.github.com/maxio-com/ab-ruby-sdk/tree/
|
359
|
-
* [Customers](https://www.github.com/maxio-com/ab-ruby-sdk/tree/
|
360
|
-
* [Events](https://www.github.com/maxio-com/ab-ruby-sdk/tree/
|
361
|
-
* [Insights](https://www.github.com/maxio-com/ab-ruby-sdk/tree/
|
362
|
-
* [Invoices](https://www.github.com/maxio-com/ab-ruby-sdk/tree/
|
363
|
-
* [Offers](https://www.github.com/maxio-com/ab-ruby-sdk/tree/
|
364
|
-
* [Products](https://www.github.com/maxio-com/ab-ruby-sdk/tree/
|
365
|
-
* [Sites](https://www.github.com/maxio-com/ab-ruby-sdk/tree/
|
366
|
-
* [Subscriptions](https://www.github.com/maxio-com/ab-ruby-sdk/tree/
|
367
|
-
* [Webhooks](https://www.github.com/maxio-com/ab-ruby-sdk/tree/
|
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/
|
372
|
-
* [HttpResponse](https://www.github.com/maxio-com/ab-ruby-sdk/tree/
|
373
|
-
* [HttpRequest](https://www.github.com/maxio-com/ab-ruby-sdk/tree/
|
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(
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
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(
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
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
|
-
[
|
238
|
-
@auth_managers['
|
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, :
|
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(
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
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
|
58
|
-
@
|
57
|
+
# The object holding Basic Authentication credentials
|
58
|
+
@basic_auth_credentials = basic_auth_credentials
|
59
59
|
|
60
|
-
#
|
61
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
#
|
12
|
-
#
|
13
|
-
#
|
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('
|
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('
|
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('
|
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))
|