maxio-advanced-billing-sdk 4.0.0 → 5.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +45 -45
- data/lib/advanced_billing/configuration.rb +2 -2
- data/lib/advanced_billing/controllers/advance_invoice_controller.rb +24 -24
- data/lib/advanced_billing/controllers/api_exports_controller.rb +57 -57
- data/lib/advanced_billing/controllers/base_controller.rb +10 -10
- data/lib/advanced_billing/controllers/billing_portal_controller.rb +33 -32
- data/lib/advanced_billing/controllers/component_price_points_controller.rb +60 -60
- data/lib/advanced_billing/controllers/components_controller.rb +110 -107
- data/lib/advanced_billing/controllers/coupons_controller.rb +89 -89
- data/lib/advanced_billing/controllers/custom_fields_controller.rb +76 -76
- data/lib/advanced_billing/controllers/customers_controller.rb +45 -41
- data/lib/advanced_billing/controllers/events_based_billing_segments_controller.rb +53 -53
- data/lib/advanced_billing/controllers/events_controller.rb +16 -15
- data/lib/advanced_billing/controllers/insights_controller.rb +17 -17
- data/lib/advanced_billing/controllers/invoices_controller.rb +99 -99
- data/lib/advanced_billing/controllers/offers_controller.rb +18 -15
- data/lib/advanced_billing/controllers/payment_profiles_controller.rb +107 -104
- data/lib/advanced_billing/controllers/product_families_controller.rb +26 -26
- data/lib/advanced_billing/controllers/product_price_points_controller.rb +62 -62
- data/lib/advanced_billing/controllers/products_controller.rb +37 -37
- data/lib/advanced_billing/controllers/proforma_invoices_controller.rb +61 -61
- data/lib/advanced_billing/controllers/reason_codes_controller.rb +35 -35
- data/lib/advanced_billing/controllers/referral_codes_controller.rb +9 -8
- data/lib/advanced_billing/controllers/sales_commissions_controller.rb +13 -13
- data/lib/advanced_billing/controllers/sites_controller.rb +11 -10
- data/lib/advanced_billing/controllers/subscription_components_controller.rb +170 -161
- data/lib/advanced_billing/controllers/subscription_group_invoice_account_controller.rb +23 -23
- data/lib/advanced_billing/controllers/subscription_group_status_controller.rb +21 -21
- data/lib/advanced_billing/controllers/subscription_groups_controller.rb +54 -54
- data/lib/advanced_billing/controllers/subscription_invoice_account_controller.rb +37 -37
- data/lib/advanced_billing/controllers/subscription_notes_controller.rb +20 -16
- data/lib/advanced_billing/controllers/subscription_products_controller.rb +20 -18
- data/lib/advanced_billing/controllers/subscription_status_controller.rb +74 -74
- data/lib/advanced_billing/controllers/subscriptions_controller.rb +163 -160
- data/lib/advanced_billing/controllers/webhooks_controller.rb +45 -44
- data/lib/advanced_billing/exceptions/component_allocation_error_exception.rb +15 -15
- data/lib/advanced_billing/exceptions/component_price_point_error_exception.rb +15 -15
- data/lib/advanced_billing/exceptions/customer_error_response_exception.rb +15 -15
- data/lib/advanced_billing/exceptions/error_array_map_response_exception.rb +15 -15
- data/lib/advanced_billing/exceptions/error_list_response_exception.rb +15 -15
- data/lib/advanced_billing/exceptions/error_string_map_response_exception.rb +15 -15
- data/lib/advanced_billing/exceptions/event_based_billing_list_segments_errors_exception.rb +15 -15
- data/lib/advanced_billing/exceptions/event_based_billing_segment_errors_exception.rb +15 -15
- data/lib/advanced_billing/exceptions/event_based_billing_segment_exception.rb +15 -15
- data/lib/advanced_billing/exceptions/product_price_point_error_response_exception.rb +15 -15
- data/lib/advanced_billing/exceptions/proforma_bad_request_error_response_exception.rb +15 -15
- data/lib/advanced_billing/exceptions/refund_prepayment_base_errors_response_exception.rb +15 -15
- data/lib/advanced_billing/exceptions/single_error_response_exception.rb +15 -15
- data/lib/advanced_billing/exceptions/single_string_error_response_exception.rb +15 -15
- data/lib/advanced_billing/exceptions/subscription_add_coupon_error_exception.rb +15 -15
- data/lib/advanced_billing/exceptions/subscription_component_allocation_error_exception.rb +15 -15
- data/lib/advanced_billing/exceptions/subscription_group_create_error_response_exception.rb +15 -15
- data/lib/advanced_billing/exceptions/subscription_group_signup_error_response_exception.rb +15 -15
- data/lib/advanced_billing/exceptions/subscription_group_update_error_response_exception.rb +15 -15
- data/lib/advanced_billing/exceptions/subscription_remove_coupon_errors_exception.rb +15 -15
- data/lib/advanced_billing/exceptions/subscriptions_mrr_error_response_exception.rb +15 -15
- data/lib/advanced_billing/exceptions/too_many_management_link_requests_error_exception.rb +15 -15
- data/lib/advanced_billing/models/activate_event_based_component.rb +84 -0
- data/lib/advanced_billing/models/{current_vault.rb → all_vaults.rb} +28 -7
- data/lib/advanced_billing/models/allocation.rb +1 -0
- data/lib/advanced_billing/models/allocation_preview_item.rb +1 -0
- data/lib/advanced_billing/models/apple_pay_payment_profile.rb +232 -0
- data/lib/advanced_billing/models/apple_pay_vault.rb +20 -0
- data/lib/advanced_billing/models/bank_account_attributes.rb +2 -0
- data/lib/advanced_billing/models/bank_account_payment_profile.rb +25 -20
- data/lib/advanced_billing/models/bank_account_vault.rb +19 -9
- data/lib/advanced_billing/models/change_invoice_status_event_data.rb +6 -6
- data/lib/advanced_billing/models/component.rb +1 -0
- data/lib/advanced_billing/models/component_custom_price.rb +33 -14
- data/lib/advanced_billing/models/component_price_point_item.rb +3 -1
- data/lib/advanced_billing/models/create_component_price_point.rb +3 -1
- data/lib/advanced_billing/models/create_customer.rb +11 -1
- data/lib/advanced_billing/models/create_metafield.rb +2 -1
- data/lib/advanced_billing/models/create_or_update_product.rb +7 -4
- data/lib/advanced_billing/models/create_payment_profile.rb +1 -1
- data/lib/advanced_billing/models/create_prepaid_usage_component_price_point.rb +6 -5
- data/lib/advanced_billing/models/create_product_price_point.rb +5 -3
- data/lib/advanced_billing/models/create_subscription.rb +27 -25
- data/lib/advanced_billing/models/credit_card_payment_profile.rb +17 -16
- data/lib/advanced_billing/models/credit_card_vault.rb +117 -0
- data/lib/advanced_billing/models/credit_note.rb +2 -2
- data/lib/advanced_billing/models/customer.rb +11 -1
- data/lib/advanced_billing/models/customer_attributes.rb +12 -1
- data/lib/advanced_billing/models/ebb_component.rb +1 -0
- data/lib/advanced_billing/models/{extended_interval_unit.rb → expiration_interval_unit.rb} +4 -4
- data/lib/advanced_billing/models/full_subscription_group_response.rb +65 -50
- data/lib/advanced_billing/models/get_one_time_token_payment_profile.rb +1 -1
- data/lib/advanced_billing/models/invoice.rb +19 -9
- data/lib/advanced_billing/models/invoice_consolidation_level.rb +2 -2
- data/lib/advanced_billing/models/invoice_refund.rb +13 -1
- data/lib/advanced_billing/models/invoice_status.rb +2 -2
- data/lib/advanced_billing/models/invoice_tax.rb +29 -0
- data/lib/advanced_billing/models/invoice_tax_component_breakout.rb +101 -1
- data/lib/advanced_billing/models/issue_invoice_event_data.rb +6 -6
- data/lib/advanced_billing/models/metered_component.rb +4 -3
- data/lib/advanced_billing/models/offer_item.rb +3 -1
- data/lib/advanced_billing/models/on_off_component.rb +3 -2
- data/lib/advanced_billing/models/paid_invoice.rb +2 -2
- data/lib/advanced_billing/models/pay_pal_vault.rb +29 -0
- data/lib/advanced_billing/models/payment_profile_attributes.rb +5 -5
- data/lib/advanced_billing/models/payment_profile_response.rb +3 -3
- data/lib/advanced_billing/models/payment_type.rb +4 -1
- data/lib/advanced_billing/models/paypal_payment_profile.rb +242 -0
- data/lib/advanced_billing/models/prepaid_usage_component.rb +5 -4
- data/lib/advanced_billing/models/product.rb +2 -2
- data/lib/advanced_billing/models/product_price_point.rb +2 -2
- data/lib/advanced_billing/models/proforma_invoice.rb +6 -6
- data/lib/advanced_billing/models/quantity_based_component.rb +4 -3
- data/lib/advanced_billing/models/refund_invoice_event_data.rb +4 -4
- data/lib/advanced_billing/models/resent_invitation.rb +36 -0
- data/lib/advanced_billing/models/subscription.rb +13 -10
- data/lib/advanced_billing/models/subscription_component.rb +1 -0
- data/lib/advanced_billing/models/subscription_component_subscription.rb +26 -20
- data/lib/advanced_billing/models/subscription_custom_price.rb +5 -2
- data/lib/advanced_billing/models/subscription_group_bank_account.rb +2 -0
- data/lib/advanced_billing/models/subscription_group_credit_card.rb +1 -1
- data/lib/advanced_billing/models/subscription_group_signup_response.rb +39 -30
- data/lib/advanced_billing/models/subscription_state.rb +30 -30
- data/lib/advanced_billing/models/tax_configuration.rb +1 -2
- data/lib/advanced_billing/models/update_component_price_point.rb +3 -1
- data/lib/advanced_billing/models/update_customer.rb +12 -1
- data/lib/advanced_billing/models/update_payment_profile.rb +1 -1
- data/lib/advanced_billing/utilities/file_wrapper.rb +9 -9
- data/lib/advanced_billing/utilities/union_type_lookup.rb +17 -3
- data/lib/advanced_billing.rb +10 -4
- metadata +16 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e1d65f08cf91f9e362201f98d75c1155c766ed03a45e1c70c1baa0f3a7e551a2
|
4
|
+
data.tar.gz: bb434c0a91c11b861e60376bd550c3a820a64f9c2608412a5aa47530cbddb22f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '0957ea9006feffaffb79299c10f9c4e14747c265cdd2e0a7b07bfb01a9f0d05f8457d5c41769c15e009c338e065d6a216c930fbec26aa92bf6367cb3d3a45b98'
|
7
|
+
data.tar.gz: d8012a63f8e16fea5a0d4da51dbf89059d9f3d2097b81673ae7314f743f60aae965f2b00ee228dd4a1f476e57a92cdfea32fc01d9d2709233dff89b3fa24949b
|
data/README.md
CHANGED
@@ -9,8 +9,8 @@ The Maxio API returns JSON responses as the primary and recommended format, but
|
|
9
9
|
|
10
10
|
### Steps to make your first Maxio Advanced Billing API call
|
11
11
|
|
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
|
13
|
-
2. [Setup and configure authentication](https://maxio
|
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.zendesk.com/hc/en-us/articles/24250712113165-Testing-Overview) account.
|
13
|
+
2. [Setup and configure authentication](https://maxio.zendesk.com/hc/en-us/articles/24294819360525-API-Keys) credentials.
|
14
14
|
3. Submit your API request and try it out.
|
15
15
|
4. Verify results through response.
|
16
16
|
5. Test our integrations.
|
@@ -30,27 +30,27 @@ curl -u <api_key>:x -H Accept:application/json -H Content-Type:application/json
|
|
30
30
|
Install the gem from the command line:
|
31
31
|
|
32
32
|
```ruby
|
33
|
-
gem install maxio-advanced-billing-sdk -v
|
33
|
+
gem install maxio-advanced-billing-sdk -v 5.0.0
|
34
34
|
```
|
35
35
|
|
36
36
|
Or add the gem to your Gemfile and run `bundle`:
|
37
37
|
|
38
38
|
```ruby
|
39
|
-
gem 'maxio-advanced-billing-sdk', '
|
39
|
+
gem 'maxio-advanced-billing-sdk', '5.0.0'
|
40
40
|
```
|
41
41
|
|
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/
|
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/5.0.0).
|
43
43
|
|
44
44
|
## Initialize the API Client
|
45
45
|
|
46
|
-
**_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/5.0.0/doc/client.md)
|
47
47
|
|
48
48
|
The following parameters are configurable for the API Client:
|
49
49
|
|
50
50
|
| Parameter | Type | Description |
|
51
51
|
| --- | --- | --- |
|
52
|
-
| `subdomain` | `String` | The subdomain for your
|
53
|
-
| `domain` | `String` | The
|
52
|
+
| `subdomain` | `String` | The subdomain for your Advanced Billing site.<br>*Default*: `'subdomain'` |
|
53
|
+
| `domain` | `String` | The Advanced Billing server domain.<br>*Default*: `'chargify.com'` |
|
54
54
|
| `environment` | `Environment` | The API environment. <br> **Default: `Environment.PRODUCTION`** |
|
55
55
|
| `connection` | `Faraday::Connection` | The Faraday connection object passed by the SDK user for making requests |
|
56
56
|
| `adapter` | `Faraday::Adapter` | The Faraday adapter object passed by the SDK user for performing http requests |
|
@@ -61,7 +61,7 @@ The following parameters are configurable for the API Client:
|
|
61
61
|
| `retry_statuses` | `Array` | A list of HTTP statuses to retry. <br> **Default: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524]** |
|
62
62
|
| `retry_methods` | `Array` | A list of HTTP methods to retry. <br> **Default: %i[get put]** |
|
63
63
|
| `http_callback` | `HttpCallBack` | The Http CallBack allows defining callables for pre and post API calls. |
|
64
|
-
| `basic_auth_credentials` | [`BasicAuthCredentials`](https://www.github.com/maxio-com/ab-ruby-sdk/tree/
|
64
|
+
| `basic_auth_credentials` | [`BasicAuthCredentials`](https://www.github.com/maxio-com/ab-ruby-sdk/tree/5.0.0/doc/auth/basic-authentication.md) | The credential object for Basic Authentication |
|
65
65
|
|
66
66
|
The API client can be initialized as follows:
|
67
67
|
|
@@ -92,46 +92,46 @@ The SDK can be configured to use a different environment for making API calls. A
|
|
92
92
|
|
93
93
|
This API uses the following authentication schemes.
|
94
94
|
|
95
|
-
* [`BasicAuth (Basic Authentication)`](https://www.github.com/maxio-com/ab-ruby-sdk/tree/
|
95
|
+
* [`BasicAuth (Basic Authentication)`](https://www.github.com/maxio-com/ab-ruby-sdk/tree/5.0.0/doc/auth/basic-authentication.md)
|
96
96
|
|
97
97
|
## List of APIs
|
98
98
|
|
99
|
-
* [API Exports](https://www.github.com/maxio-com/ab-ruby-sdk/tree/
|
100
|
-
* [Advance Invoice](https://www.github.com/maxio-com/ab-ruby-sdk/tree/
|
101
|
-
* [Billing Portal](https://www.github.com/maxio-com/ab-ruby-sdk/tree/
|
102
|
-
* [Component Price Points](https://www.github.com/maxio-com/ab-ruby-sdk/tree/
|
103
|
-
* [Custom Fields](https://www.github.com/maxio-com/ab-ruby-sdk/tree/
|
104
|
-
* [Events-Based Billing Segments](https://www.github.com/maxio-com/ab-ruby-sdk/tree/
|
105
|
-
* [Payment Profiles](https://www.github.com/maxio-com/ab-ruby-sdk/tree/
|
106
|
-
* [Product Families](https://www.github.com/maxio-com/ab-ruby-sdk/tree/
|
107
|
-
* [Product Price Points](https://www.github.com/maxio-com/ab-ruby-sdk/tree/
|
108
|
-
* [Proforma Invoices](https://www.github.com/maxio-com/ab-ruby-sdk/tree/
|
109
|
-
* [Reason Codes](https://www.github.com/maxio-com/ab-ruby-sdk/tree/
|
110
|
-
* [Referral Codes](https://www.github.com/maxio-com/ab-ruby-sdk/tree/
|
111
|
-
* [Sales Commissions](https://www.github.com/maxio-com/ab-ruby-sdk/tree/
|
112
|
-
* [Subscription Components](https://www.github.com/maxio-com/ab-ruby-sdk/tree/
|
113
|
-
* [Subscription Groups](https://www.github.com/maxio-com/ab-ruby-sdk/tree/
|
114
|
-
* [Subscription Group Invoice Account](https://www.github.com/maxio-com/ab-ruby-sdk/tree/
|
115
|
-
* [Subscription Group Status](https://www.github.com/maxio-com/ab-ruby-sdk/tree/
|
116
|
-
* [Subscription Invoice Account](https://www.github.com/maxio-com/ab-ruby-sdk/tree/
|
117
|
-
* [Subscription Notes](https://www.github.com/maxio-com/ab-ruby-sdk/tree/
|
118
|
-
* [Subscription Products](https://www.github.com/maxio-com/ab-ruby-sdk/tree/
|
119
|
-
* [Subscription Status](https://www.github.com/maxio-com/ab-ruby-sdk/tree/
|
120
|
-
* [Coupons](https://www.github.com/maxio-com/ab-ruby-sdk/tree/
|
121
|
-
* [Components](https://www.github.com/maxio-com/ab-ruby-sdk/tree/
|
122
|
-
* [Customers](https://www.github.com/maxio-com/ab-ruby-sdk/tree/
|
123
|
-
* [Events](https://www.github.com/maxio-com/ab-ruby-sdk/tree/
|
124
|
-
* [Insights](https://www.github.com/maxio-com/ab-ruby-sdk/tree/
|
125
|
-
* [Invoices](https://www.github.com/maxio-com/ab-ruby-sdk/tree/
|
126
|
-
* [Offers](https://www.github.com/maxio-com/ab-ruby-sdk/tree/
|
127
|
-
* [Products](https://www.github.com/maxio-com/ab-ruby-sdk/tree/
|
128
|
-
* [Sites](https://www.github.com/maxio-com/ab-ruby-sdk/tree/
|
129
|
-
* [Subscriptions](https://www.github.com/maxio-com/ab-ruby-sdk/tree/
|
130
|
-
* [Webhooks](https://www.github.com/maxio-com/ab-ruby-sdk/tree/
|
99
|
+
* [API Exports](https://www.github.com/maxio-com/ab-ruby-sdk/tree/5.0.0/doc/controllers/api-exports.md)
|
100
|
+
* [Advance Invoice](https://www.github.com/maxio-com/ab-ruby-sdk/tree/5.0.0/doc/controllers/advance-invoice.md)
|
101
|
+
* [Billing Portal](https://www.github.com/maxio-com/ab-ruby-sdk/tree/5.0.0/doc/controllers/billing-portal.md)
|
102
|
+
* [Component Price Points](https://www.github.com/maxio-com/ab-ruby-sdk/tree/5.0.0/doc/controllers/component-price-points.md)
|
103
|
+
* [Custom Fields](https://www.github.com/maxio-com/ab-ruby-sdk/tree/5.0.0/doc/controllers/custom-fields.md)
|
104
|
+
* [Events-Based Billing Segments](https://www.github.com/maxio-com/ab-ruby-sdk/tree/5.0.0/doc/controllers/events-based-billing-segments.md)
|
105
|
+
* [Payment Profiles](https://www.github.com/maxio-com/ab-ruby-sdk/tree/5.0.0/doc/controllers/payment-profiles.md)
|
106
|
+
* [Product Families](https://www.github.com/maxio-com/ab-ruby-sdk/tree/5.0.0/doc/controllers/product-families.md)
|
107
|
+
* [Product Price Points](https://www.github.com/maxio-com/ab-ruby-sdk/tree/5.0.0/doc/controllers/product-price-points.md)
|
108
|
+
* [Proforma Invoices](https://www.github.com/maxio-com/ab-ruby-sdk/tree/5.0.0/doc/controllers/proforma-invoices.md)
|
109
|
+
* [Reason Codes](https://www.github.com/maxio-com/ab-ruby-sdk/tree/5.0.0/doc/controllers/reason-codes.md)
|
110
|
+
* [Referral Codes](https://www.github.com/maxio-com/ab-ruby-sdk/tree/5.0.0/doc/controllers/referral-codes.md)
|
111
|
+
* [Sales Commissions](https://www.github.com/maxio-com/ab-ruby-sdk/tree/5.0.0/doc/controllers/sales-commissions.md)
|
112
|
+
* [Subscription Components](https://www.github.com/maxio-com/ab-ruby-sdk/tree/5.0.0/doc/controllers/subscription-components.md)
|
113
|
+
* [Subscription Groups](https://www.github.com/maxio-com/ab-ruby-sdk/tree/5.0.0/doc/controllers/subscription-groups.md)
|
114
|
+
* [Subscription Group Invoice Account](https://www.github.com/maxio-com/ab-ruby-sdk/tree/5.0.0/doc/controllers/subscription-group-invoice-account.md)
|
115
|
+
* [Subscription Group Status](https://www.github.com/maxio-com/ab-ruby-sdk/tree/5.0.0/doc/controllers/subscription-group-status.md)
|
116
|
+
* [Subscription Invoice Account](https://www.github.com/maxio-com/ab-ruby-sdk/tree/5.0.0/doc/controllers/subscription-invoice-account.md)
|
117
|
+
* [Subscription Notes](https://www.github.com/maxio-com/ab-ruby-sdk/tree/5.0.0/doc/controllers/subscription-notes.md)
|
118
|
+
* [Subscription Products](https://www.github.com/maxio-com/ab-ruby-sdk/tree/5.0.0/doc/controllers/subscription-products.md)
|
119
|
+
* [Subscription Status](https://www.github.com/maxio-com/ab-ruby-sdk/tree/5.0.0/doc/controllers/subscription-status.md)
|
120
|
+
* [Coupons](https://www.github.com/maxio-com/ab-ruby-sdk/tree/5.0.0/doc/controllers/coupons.md)
|
121
|
+
* [Components](https://www.github.com/maxio-com/ab-ruby-sdk/tree/5.0.0/doc/controllers/components.md)
|
122
|
+
* [Customers](https://www.github.com/maxio-com/ab-ruby-sdk/tree/5.0.0/doc/controllers/customers.md)
|
123
|
+
* [Events](https://www.github.com/maxio-com/ab-ruby-sdk/tree/5.0.0/doc/controllers/events.md)
|
124
|
+
* [Insights](https://www.github.com/maxio-com/ab-ruby-sdk/tree/5.0.0/doc/controllers/insights.md)
|
125
|
+
* [Invoices](https://www.github.com/maxio-com/ab-ruby-sdk/tree/5.0.0/doc/controllers/invoices.md)
|
126
|
+
* [Offers](https://www.github.com/maxio-com/ab-ruby-sdk/tree/5.0.0/doc/controllers/offers.md)
|
127
|
+
* [Products](https://www.github.com/maxio-com/ab-ruby-sdk/tree/5.0.0/doc/controllers/products.md)
|
128
|
+
* [Sites](https://www.github.com/maxio-com/ab-ruby-sdk/tree/5.0.0/doc/controllers/sites.md)
|
129
|
+
* [Subscriptions](https://www.github.com/maxio-com/ab-ruby-sdk/tree/5.0.0/doc/controllers/subscriptions.md)
|
130
|
+
* [Webhooks](https://www.github.com/maxio-com/ab-ruby-sdk/tree/5.0.0/doc/controllers/webhooks.md)
|
131
131
|
|
132
132
|
## Classes Documentation
|
133
133
|
|
134
|
-
* [Utility Classes](https://www.github.com/maxio-com/ab-ruby-sdk/tree/
|
135
|
-
* [HttpResponse](https://www.github.com/maxio-com/ab-ruby-sdk/tree/
|
136
|
-
* [HttpRequest](https://www.github.com/maxio-com/ab-ruby-sdk/tree/
|
134
|
+
* [Utility Classes](https://www.github.com/maxio-com/ab-ruby-sdk/tree/5.0.0/doc/utility-classes.md)
|
135
|
+
* [HttpResponse](https://www.github.com/maxio-com/ab-ruby-sdk/tree/5.0.0/doc/http-response.md)
|
136
|
+
* [HttpRequest](https://www.github.com/maxio-com/ab-ruby-sdk/tree/5.0.0/doc/http-request.md)
|
137
137
|
|
@@ -48,10 +48,10 @@ module AdvancedBilling
|
|
48
48
|
# Current API environment
|
49
49
|
@environment = String(environment)
|
50
50
|
|
51
|
-
# The subdomain for your
|
51
|
+
# The subdomain for your Advanced Billing site.
|
52
52
|
@subdomain = subdomain
|
53
53
|
|
54
|
-
# The
|
54
|
+
# The Advanced Billing server domain.
|
55
55
|
@domain = domain
|
56
56
|
|
57
57
|
# The object holding Basic Authentication credentials
|
@@ -8,11 +8,11 @@ module AdvancedBilling
|
|
8
8
|
class AdvanceInvoiceController < BaseController
|
9
9
|
# Generate an invoice in advance for a subscription's next renewal date.
|
10
10
|
# [Please see our
|
11
|
-
# docs](https://maxio
|
12
|
-
#
|
13
|
-
#
|
14
|
-
#
|
15
|
-
#
|
11
|
+
# docs](https://maxio.zendesk.com/hc/en-us/articles/24252026404749-Issue-Inv
|
12
|
+
# oice-In-Advance) for more information on advance invoices, including
|
13
|
+
# eligibility on generating one; for the most part, they function like any
|
14
|
+
# other invoice, except they are issued early and have special behavior upon
|
15
|
+
# being voided.
|
16
16
|
# A subscription may only have one advance invoice per billing period.
|
17
17
|
# Attempting to issue an advance invoice when one already exists will return
|
18
18
|
# an error.
|
@@ -42,15 +42,15 @@ module AdvancedBilling
|
|
42
42
|
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
43
43
|
.auth(Single.new('BasicAuth')))
|
44
44
|
.response(new_response_handler
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
45
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
46
|
+
.deserialize_into(Invoice.method(:from_hash))
|
47
|
+
.local_error_template('404',
|
48
|
+
'Not Found:\'{$response.body}\'',
|
49
|
+
APIException)
|
50
|
+
.local_error_template('422',
|
51
|
+
'HTTP Response Not OK. Status code: {$statusCode}.'\
|
52
|
+
' Response: \'{$response.body}\'.',
|
53
|
+
ErrorListResponseException))
|
54
54
|
.execute
|
55
55
|
end
|
56
56
|
|
@@ -71,11 +71,11 @@ module AdvancedBilling
|
|
71
71
|
.header_param(new_parameter('application/json', key: 'accept'))
|
72
72
|
.auth(Single.new('BasicAuth')))
|
73
73
|
.response(new_response_handler
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
74
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
75
|
+
.deserialize_into(Invoice.method(:from_hash))
|
76
|
+
.local_error_template('404',
|
77
|
+
'Not Found:\'{$response.body}\'',
|
78
|
+
APIException))
|
79
79
|
.execute
|
80
80
|
end
|
81
81
|
|
@@ -104,11 +104,11 @@ module AdvancedBilling
|
|
104
104
|
.body_serializer(proc do |param| param.to_json unless param.nil? end)
|
105
105
|
.auth(Single.new('BasicAuth')))
|
106
106
|
.response(new_response_handler
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
107
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
108
|
+
.deserialize_into(Invoice.method(:from_hash))
|
109
|
+
.local_error_template('404',
|
110
|
+
'Not Found:\'{$response.body}\'',
|
111
|
+
APIException))
|
112
112
|
.execute
|
113
113
|
end
|
114
114
|
end
|
@@ -38,12 +38,12 @@ module AdvancedBilling
|
|
38
38
|
.header_param(new_parameter('application/json', key: 'accept'))
|
39
39
|
.auth(Single.new('BasicAuth')))
|
40
40
|
.response(new_response_handler
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
41
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
42
|
+
.deserialize_into(ProformaInvoice.method(:from_hash))
|
43
|
+
.is_response_array(true)
|
44
|
+
.local_error_template('404',
|
45
|
+
'Not Found:\'{$response.body}\'',
|
46
|
+
APIException))
|
47
47
|
.execute
|
48
48
|
end
|
49
49
|
|
@@ -79,12 +79,12 @@ module AdvancedBilling
|
|
79
79
|
.header_param(new_parameter('application/json', key: 'accept'))
|
80
80
|
.auth(Single.new('BasicAuth')))
|
81
81
|
.response(new_response_handler
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
82
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
83
|
+
.deserialize_into(Invoice.method(:from_hash))
|
84
|
+
.is_response_array(true)
|
85
|
+
.local_error_template('404',
|
86
|
+
'Not Found:\'{$response.body}\'',
|
87
|
+
APIException))
|
88
88
|
.execute
|
89
89
|
end
|
90
90
|
|
@@ -120,12 +120,12 @@ module AdvancedBilling
|
|
120
120
|
.header_param(new_parameter('application/json', key: 'accept'))
|
121
121
|
.auth(Single.new('BasicAuth')))
|
122
122
|
.response(new_response_handler
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
123
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
124
|
+
.deserialize_into(Subscription.method(:from_hash))
|
125
|
+
.is_response_array(true)
|
126
|
+
.local_error_template('404',
|
127
|
+
'Not Found:\'{$response.body}\'',
|
128
|
+
APIException))
|
129
129
|
.execute
|
130
130
|
end
|
131
131
|
|
@@ -140,15 +140,15 @@ module AdvancedBilling
|
|
140
140
|
.header_param(new_parameter('application/json', key: 'accept'))
|
141
141
|
.auth(Single.new('BasicAuth')))
|
142
142
|
.response(new_response_handler
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
143
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
144
|
+
.deserialize_into(BatchJobResponse.method(:from_hash))
|
145
|
+
.local_error_template('404',
|
146
|
+
'Not Found:\'{$response.body}\'',
|
147
|
+
APIException)
|
148
|
+
.local_error_template('409',
|
149
|
+
'HTTP Response Not OK. Status code: {$statusCode}.'\
|
150
|
+
' Response: \'{$response.body}\'.',
|
151
|
+
SingleErrorResponseException))
|
152
152
|
.execute
|
153
153
|
end
|
154
154
|
|
@@ -162,15 +162,15 @@ module AdvancedBilling
|
|
162
162
|
.header_param(new_parameter('application/json', key: 'accept'))
|
163
163
|
.auth(Single.new('BasicAuth')))
|
164
164
|
.response(new_response_handler
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
165
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
166
|
+
.deserialize_into(BatchJobResponse.method(:from_hash))
|
167
|
+
.local_error_template('404',
|
168
|
+
'Not Found:\'{$response.body}\'',
|
169
|
+
APIException)
|
170
|
+
.local_error_template('409',
|
171
|
+
'HTTP Response Not OK. Status code: {$statusCode}.'\
|
172
|
+
' Response: \'{$response.body}\'.',
|
173
|
+
SingleErrorResponseException))
|
174
174
|
.execute
|
175
175
|
end
|
176
176
|
|
@@ -184,12 +184,12 @@ module AdvancedBilling
|
|
184
184
|
.header_param(new_parameter('application/json', key: 'accept'))
|
185
185
|
.auth(Single.new('BasicAuth')))
|
186
186
|
.response(new_response_handler
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
187
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
188
|
+
.deserialize_into(BatchJobResponse.method(:from_hash))
|
189
|
+
.local_error_template('409',
|
190
|
+
'HTTP Response Not OK. Status code: {$statusCode}.'\
|
191
|
+
' Response: \'{$response.body}\'.',
|
192
|
+
SingleErrorResponseException))
|
193
193
|
.execute
|
194
194
|
end
|
195
195
|
|
@@ -207,11 +207,11 @@ module AdvancedBilling
|
|
207
207
|
.header_param(new_parameter('application/json', key: 'accept'))
|
208
208
|
.auth(Single.new('BasicAuth')))
|
209
209
|
.response(new_response_handler
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
210
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
211
|
+
.deserialize_into(BatchJobResponse.method(:from_hash))
|
212
|
+
.local_error_template('404',
|
213
|
+
'Not Found:\'{$response.body}\'',
|
214
|
+
APIException))
|
215
215
|
.execute
|
216
216
|
end
|
217
217
|
|
@@ -229,11 +229,11 @@ module AdvancedBilling
|
|
229
229
|
.header_param(new_parameter('application/json', key: 'accept'))
|
230
230
|
.auth(Single.new('BasicAuth')))
|
231
231
|
.response(new_response_handler
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
232
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
233
|
+
.deserialize_into(BatchJobResponse.method(:from_hash))
|
234
|
+
.local_error_template('404',
|
235
|
+
'Not Found:\'{$response.body}\'',
|
236
|
+
APIException))
|
237
237
|
.execute
|
238
238
|
end
|
239
239
|
|
@@ -251,11 +251,11 @@ module AdvancedBilling
|
|
251
251
|
.header_param(new_parameter('application/json', key: 'accept'))
|
252
252
|
.auth(Single.new('BasicAuth')))
|
253
253
|
.response(new_response_handler
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
254
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
255
|
+
.deserialize_into(BatchJobResponse.method(:from_hash))
|
256
|
+
.local_error_template('404',
|
257
|
+
'Not Found:\'{$response.body}\'',
|
258
|
+
APIException))
|
259
259
|
.execute
|
260
260
|
end
|
261
261
|
end
|
@@ -10,7 +10,7 @@ module AdvancedBilling
|
|
10
10
|
attr_accessor :config, :http_call_back
|
11
11
|
|
12
12
|
def self.user_agent
|
13
|
-
'AB SDK Ruby:
|
13
|
+
'AB SDK Ruby:5.0.0 on OS {os-info}'
|
14
14
|
end
|
15
15
|
|
16
16
|
def self.user_agent_parameters
|
@@ -40,15 +40,15 @@ module AdvancedBilling
|
|
40
40
|
end
|
41
41
|
|
42
42
|
# Creates a new builder for the Api Call instance.
|
43
|
-
# @return [ApiCall] The instance of ApiCall.
|
44
|
-
def new_api_call_builder
|
45
|
-
@api_call.new_builder
|
46
|
-
end
|
47
|
-
|
48
|
-
# Creates a new instance of the request builder.
|
49
|
-
# @param [String] http_method The HTTP method to use in the request.
|
50
|
-
# @param [String] path The endpoint path to use in the request.
|
51
|
-
# @param [String] server The server to extract the base uri for the request.
|
43
|
+
# @return [ApiCall] The instance of ApiCall.
|
44
|
+
def new_api_call_builder
|
45
|
+
@api_call.new_builder
|
46
|
+
end
|
47
|
+
|
48
|
+
# Creates a new instance of the request builder.
|
49
|
+
# @param [String] http_method The HTTP method to use in the request.
|
50
|
+
# @param [String] path The endpoint path to use in the request.
|
51
|
+
# @param [String] server The server to extract the base uri for the request.
|
52
52
|
# @return [RequestBuilder] The instance of RequestBuilder.
|
53
53
|
def new_request_builder(http_method, path, server)
|
54
54
|
RequestBuilder.new
|
@@ -7,9 +7,10 @@ module AdvancedBilling
|
|
7
7
|
# BillingPortalController
|
8
8
|
class BillingPortalController < BaseController
|
9
9
|
# ## Billing Portal Documentation
|
10
|
-
# Full documentation on how the Billing Portal operates within the
|
11
|
-
# UI can be located
|
12
|
-
# [here](https://
|
10
|
+
# Full documentation on how the Billing Portal operates within the Advanced
|
11
|
+
# Billing UI can be located
|
12
|
+
# [here](https://maxio.zendesk.com/hc/en-us/articles/24252412965133-Billing-
|
13
|
+
# Portal-Overview).
|
13
14
|
# This documentation is focused on how the to configure the Billing Portal
|
14
15
|
# Settings, as well as Subscriber Interaction and Merchant Management of the
|
15
16
|
# Billing Portal.
|
@@ -25,12 +26,12 @@ module AdvancedBilling
|
|
25
26
|
# If you need to provide your customer their Management URL through other
|
26
27
|
# means, you can retrieve it via the API. Because the URL is
|
27
28
|
# cryptographically signed with a timestamp, it is not possible for
|
28
|
-
# merchants to generate the URL without requesting it from
|
29
|
+
# merchants to generate the URL without requesting it from Advanced Billing.
|
29
30
|
# In order to prevent abuse & overuse, we ask that you request a new URL
|
30
31
|
# only when absolutely necessary. Management URLs are good for 65 days, so
|
31
32
|
# you should re-use a previously generated one as much as possible. If you
|
32
33
|
# use the URL frequently (such as to display on your website), please **do
|
33
|
-
# not** make an API request to
|
34
|
+
# not** make an API request to Advanced Billing every time.
|
34
35
|
# @param [Integer] customer_id Required parameter: The Chargify id of the
|
35
36
|
# customer
|
36
37
|
# @param [AutoInvite] auto_invite Optional parameter: When set to 1, an
|
@@ -50,12 +51,12 @@ module AdvancedBilling
|
|
50
51
|
.header_param(new_parameter('application/json', key: 'accept'))
|
51
52
|
.auth(Single.new('BasicAuth')))
|
52
53
|
.response(new_response_handler
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
54
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
55
|
+
.deserialize_into(CustomerResponse.method(:from_hash))
|
56
|
+
.local_error_template('422',
|
57
|
+
'HTTP Response Not OK. Status code: {$statusCode}.'\
|
58
|
+
' Response: \'{$response.body}\'.',
|
59
|
+
ErrorListResponseException))
|
59
60
|
.execute
|
60
61
|
end
|
61
62
|
|
@@ -85,16 +86,16 @@ module AdvancedBilling
|
|
85
86
|
.header_param(new_parameter('application/json', key: 'accept'))
|
86
87
|
.auth(Single.new('BasicAuth')))
|
87
88
|
.response(new_response_handler
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
89
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
90
|
+
.deserialize_into(PortalManagementLink.method(:from_hash))
|
91
|
+
.local_error_template('422',
|
92
|
+
'HTTP Response Not OK. Status code: {$statusCode}.'\
|
93
|
+
' Response: \'{$response.body}\'.',
|
94
|
+
ErrorListResponseException)
|
95
|
+
.local_error_template('429',
|
96
|
+
'HTTP Response Not OK. Status code: {$statusCode}.'\
|
97
|
+
' Response: \'{$response.body}\'.',
|
98
|
+
TooManyManagementLinkRequestsErrorException))
|
98
99
|
.execute
|
99
100
|
end
|
100
101
|
|
@@ -123,15 +124,15 @@ module AdvancedBilling
|
|
123
124
|
.header_param(new_parameter('application/json', key: 'accept'))
|
124
125
|
.auth(Single.new('BasicAuth')))
|
125
126
|
.response(new_response_handler
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
127
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
128
|
+
.deserialize_into(ResentInvitation.method(:from_hash))
|
129
|
+
.local_error_template('404',
|
130
|
+
'Not Found:\'{$response.body}\'',
|
131
|
+
APIException)
|
132
|
+
.local_error_template('422',
|
133
|
+
'HTTP Response Not OK. Status code: {$statusCode}.'\
|
134
|
+
' Response: \'{$response.body}\'.',
|
135
|
+
ErrorListResponseException))
|
135
136
|
.execute
|
136
137
|
end
|
137
138
|
|
@@ -154,8 +155,8 @@ module AdvancedBilling
|
|
154
155
|
.header_param(new_parameter('application/json', key: 'accept'))
|
155
156
|
.auth(Single.new('BasicAuth')))
|
156
157
|
.response(new_response_handler
|
157
|
-
|
158
|
-
|
158
|
+
.deserializer(APIHelper.method(:custom_type_deserializer))
|
159
|
+
.deserialize_into(RevokedInvitation.method(:from_hash)))
|
159
160
|
.execute
|
160
161
|
end
|
161
162
|
end
|