maxio-advanced-billing-sdk 4.0.0 → 5.1.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 +27 -27
- data/lib/advanced_billing/controllers/api_exports_controller.rb +66 -66
- data/lib/advanced_billing/controllers/base_controller.rb +10 -10
- data/lib/advanced_billing/controllers/billing_portal_controller.rb +37 -36
- data/lib/advanced_billing/controllers/component_price_points_controller.rb +71 -71
- data/lib/advanced_billing/controllers/components_controller.rb +122 -119
- data/lib/advanced_billing/controllers/coupons_controller.rb +103 -103
- data/lib/advanced_billing/controllers/custom_fields_controller.rb +85 -85
- data/lib/advanced_billing/controllers/customers_controller.rb +52 -48
- data/lib/advanced_billing/controllers/events_based_billing_segments_controller.rb +59 -59
- data/lib/advanced_billing/controllers/events_controller.rb +19 -18
- data/lib/advanced_billing/controllers/insights_controller.rb +21 -21
- data/lib/advanced_billing/controllers/invoices_controller.rb +116 -116
- data/lib/advanced_billing/controllers/offers_controller.rb +23 -20
- data/lib/advanced_billing/controllers/payment_profiles_controller.rb +119 -116
- data/lib/advanced_billing/controllers/product_families_controller.rb +30 -30
- data/lib/advanced_billing/controllers/product_price_points_controller.rb +73 -73
- data/lib/advanced_billing/controllers/products_controller.rb +43 -43
- data/lib/advanced_billing/controllers/proforma_invoices_controller.rb +70 -70
- data/lib/advanced_billing/controllers/reason_codes_controller.rb +40 -40
- data/lib/advanced_billing/controllers/referral_codes_controller.rb +10 -9
- data/lib/advanced_billing/controllers/sales_commissions_controller.rb +16 -16
- data/lib/advanced_billing/controllers/sites_controller.rb +14 -13
- data/lib/advanced_billing/controllers/subscription_components_controller.rb +187 -178
- data/lib/advanced_billing/controllers/subscription_group_invoice_account_controller.rb +27 -27
- data/lib/advanced_billing/controllers/subscription_group_status_controller.rb +25 -25
- data/lib/advanced_billing/controllers/subscription_groups_controller.rb +63 -63
- data/lib/advanced_billing/controllers/subscription_invoice_account_controller.rb +43 -43
- data/lib/advanced_billing/controllers/subscription_notes_controller.rb +25 -21
- data/lib/advanced_billing/controllers/subscription_products_controller.rb +22 -20
- data/lib/advanced_billing/controllers/subscription_status_controller.rb +84 -84
- data/lib/advanced_billing/controllers/subscriptions_controller.rb +175 -172
- data/lib/advanced_billing/controllers/webhooks_controller.rb +51 -50
- 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/cancellation_method.rb +4 -1
- 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/list_products_filter.rb +12 -2
- 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: 6ba3c0d15ed68288fe156ee91747d7d37a3bea2abb04c58f8c81efff0e499c9a
|
4
|
+
data.tar.gz: 11cfae4524f30775798069d3a769cc0499eaa79e51fd9d302cc4831c81eda9e1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7048102d3d068fe34da8951f64680ef995f94d4bee819379b566c4590f7061ced853a833fd60f05b5d29728e78e11bf434a096bad672480b75e0304ecaf2c319
|
7
|
+
data.tar.gz: 3da2667678e2a0cc13d8d6e9e3b6bc695363ac2bb4dd42d2651b62eed1f987322e675bd8ded3d6f850cc3c809e876b79fec408b05072d08c4f5b14e599e1dfe6
|
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.1.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.1.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.1.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.1.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.1.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.1.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.1.0/doc/controllers/api-exports.md)
|
100
|
+
* [Advance Invoice](https://www.github.com/maxio-com/ab-ruby-sdk/tree/5.1.0/doc/controllers/advance-invoice.md)
|
101
|
+
* [Billing Portal](https://www.github.com/maxio-com/ab-ruby-sdk/tree/5.1.0/doc/controllers/billing-portal.md)
|
102
|
+
* [Component Price Points](https://www.github.com/maxio-com/ab-ruby-sdk/tree/5.1.0/doc/controllers/component-price-points.md)
|
103
|
+
* [Custom Fields](https://www.github.com/maxio-com/ab-ruby-sdk/tree/5.1.0/doc/controllers/custom-fields.md)
|
104
|
+
* [Events-Based Billing Segments](https://www.github.com/maxio-com/ab-ruby-sdk/tree/5.1.0/doc/controllers/events-based-billing-segments.md)
|
105
|
+
* [Payment Profiles](https://www.github.com/maxio-com/ab-ruby-sdk/tree/5.1.0/doc/controllers/payment-profiles.md)
|
106
|
+
* [Product Families](https://www.github.com/maxio-com/ab-ruby-sdk/tree/5.1.0/doc/controllers/product-families.md)
|
107
|
+
* [Product Price Points](https://www.github.com/maxio-com/ab-ruby-sdk/tree/5.1.0/doc/controllers/product-price-points.md)
|
108
|
+
* [Proforma Invoices](https://www.github.com/maxio-com/ab-ruby-sdk/tree/5.1.0/doc/controllers/proforma-invoices.md)
|
109
|
+
* [Reason Codes](https://www.github.com/maxio-com/ab-ruby-sdk/tree/5.1.0/doc/controllers/reason-codes.md)
|
110
|
+
* [Referral Codes](https://www.github.com/maxio-com/ab-ruby-sdk/tree/5.1.0/doc/controllers/referral-codes.md)
|
111
|
+
* [Sales Commissions](https://www.github.com/maxio-com/ab-ruby-sdk/tree/5.1.0/doc/controllers/sales-commissions.md)
|
112
|
+
* [Subscription Components](https://www.github.com/maxio-com/ab-ruby-sdk/tree/5.1.0/doc/controllers/subscription-components.md)
|
113
|
+
* [Subscription Groups](https://www.github.com/maxio-com/ab-ruby-sdk/tree/5.1.0/doc/controllers/subscription-groups.md)
|
114
|
+
* [Subscription Group Invoice Account](https://www.github.com/maxio-com/ab-ruby-sdk/tree/5.1.0/doc/controllers/subscription-group-invoice-account.md)
|
115
|
+
* [Subscription Group Status](https://www.github.com/maxio-com/ab-ruby-sdk/tree/5.1.0/doc/controllers/subscription-group-status.md)
|
116
|
+
* [Subscription Invoice Account](https://www.github.com/maxio-com/ab-ruby-sdk/tree/5.1.0/doc/controllers/subscription-invoice-account.md)
|
117
|
+
* [Subscription Notes](https://www.github.com/maxio-com/ab-ruby-sdk/tree/5.1.0/doc/controllers/subscription-notes.md)
|
118
|
+
* [Subscription Products](https://www.github.com/maxio-com/ab-ruby-sdk/tree/5.1.0/doc/controllers/subscription-products.md)
|
119
|
+
* [Subscription Status](https://www.github.com/maxio-com/ab-ruby-sdk/tree/5.1.0/doc/controllers/subscription-status.md)
|
120
|
+
* [Coupons](https://www.github.com/maxio-com/ab-ruby-sdk/tree/5.1.0/doc/controllers/coupons.md)
|
121
|
+
* [Components](https://www.github.com/maxio-com/ab-ruby-sdk/tree/5.1.0/doc/controllers/components.md)
|
122
|
+
* [Customers](https://www.github.com/maxio-com/ab-ruby-sdk/tree/5.1.0/doc/controllers/customers.md)
|
123
|
+
* [Events](https://www.github.com/maxio-com/ab-ruby-sdk/tree/5.1.0/doc/controllers/events.md)
|
124
|
+
* [Insights](https://www.github.com/maxio-com/ab-ruby-sdk/tree/5.1.0/doc/controllers/insights.md)
|
125
|
+
* [Invoices](https://www.github.com/maxio-com/ab-ruby-sdk/tree/5.1.0/doc/controllers/invoices.md)
|
126
|
+
* [Offers](https://www.github.com/maxio-com/ab-ruby-sdk/tree/5.1.0/doc/controllers/offers.md)
|
127
|
+
* [Products](https://www.github.com/maxio-com/ab-ruby-sdk/tree/5.1.0/doc/controllers/products.md)
|
128
|
+
* [Sites](https://www.github.com/maxio-com/ab-ruby-sdk/tree/5.1.0/doc/controllers/sites.md)
|
129
|
+
* [Subscriptions](https://www.github.com/maxio-com/ab-ruby-sdk/tree/5.1.0/doc/controllers/subscriptions.md)
|
130
|
+
* [Webhooks](https://www.github.com/maxio-com/ab-ruby-sdk/tree/5.1.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.1.0/doc/utility-classes.md)
|
135
|
+
* [HttpResponse](https://www.github.com/maxio-com/ab-ruby-sdk/tree/5.1.0/doc/http-response.md)
|
136
|
+
* [HttpRequest](https://www.github.com/maxio-com/ab-ruby-sdk/tree/5.1.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.
|
@@ -26,7 +26,7 @@ module AdvancedBilling
|
|
26
26
|
# @param [Integer] subscription_id Required parameter: The Chargify id of
|
27
27
|
# the subscription
|
28
28
|
# @param [IssueAdvanceInvoiceRequest] body Optional parameter: Example:
|
29
|
-
# @return [Invoice] response from the API call
|
29
|
+
# @return [Invoice] response from the API call.
|
30
30
|
def issue_advance_invoice(subscription_id,
|
31
31
|
body: nil)
|
32
32
|
new_api_call_builder
|
@@ -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
|
|
@@ -59,7 +59,7 @@ module AdvancedBilling
|
|
59
59
|
# advance invoice per subscription per billing cycle.
|
60
60
|
# @param [Integer] subscription_id Required parameter: The Chargify id of
|
61
61
|
# the subscription
|
62
|
-
# @return [Invoice] response from the API call
|
62
|
+
# @return [Invoice] response from the API call.
|
63
63
|
def read_advance_invoice(subscription_id)
|
64
64
|
new_api_call_builder
|
65
65
|
.request(new_request_builder(HttpMethodEnum::GET,
|
@@ -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
|
|
@@ -88,7 +88,7 @@ module AdvancedBilling
|
|
88
88
|
# @param [Integer] subscription_id Required parameter: The Chargify id of
|
89
89
|
# the subscription
|
90
90
|
# @param [VoidInvoiceRequest] body Optional parameter: Example:
|
91
|
-
# @return [Invoice] response from the API call
|
91
|
+
# @return [Invoice] response from the API call.
|
92
92
|
def void_advance_invoice(subscription_id,
|
93
93
|
body: nil)
|
94
94
|
new_api_call_builder
|
@@ -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
|
@@ -24,7 +24,7 @@ module AdvancedBilling
|
|
24
24
|
# passing in a page parameter. Retrieve the next page by adding ?page=2 to
|
25
25
|
# the query string. If there are no results to return, then an empty result
|
26
26
|
# set will be returned. Use in query `page=1`.
|
27
|
-
# @return [Array[ProformaInvoice]] response from the API call
|
27
|
+
# @return [Array[ProformaInvoice]] response from the API call.
|
28
28
|
def list_exported_proforma_invoices(options = {})
|
29
29
|
new_api_call_builder
|
30
30
|
.request(new_request_builder(HttpMethodEnum::GET,
|
@@ -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
|
|
@@ -65,7 +65,7 @@ module AdvancedBilling
|
|
65
65
|
# passing in a page parameter. Retrieve the next page by adding ?page=2 to
|
66
66
|
# the query string. If there are no results to return, then an empty result
|
67
67
|
# set will be returned. Use in query `page=1`.
|
68
|
-
# @return [Array[Invoice]] response from the API call
|
68
|
+
# @return [Array[Invoice]] response from the API call.
|
69
69
|
def list_exported_invoices(options = {})
|
70
70
|
new_api_call_builder
|
71
71
|
.request(new_request_builder(HttpMethodEnum::GET,
|
@@ -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
|
|
@@ -106,7 +106,7 @@ module AdvancedBilling
|
|
106
106
|
# passing in a page parameter. Retrieve the next page by adding ?page=2 to
|
107
107
|
# the query string. If there are no results to return, then an empty result
|
108
108
|
# set will be returned. Use in query `page=1`.
|
109
|
-
# @return [Array[Subscription]] response from the API call
|
109
|
+
# @return [Array[Subscription]] response from the API call.
|
110
110
|
def list_exported_subscriptions(options = {})
|
111
111
|
new_api_call_builder
|
112
112
|
.request(new_request_builder(HttpMethodEnum::GET,
|
@@ -120,18 +120,18 @@ 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
|
|
132
132
|
# This API creates a proforma invoices export and returns a batchjob object.
|
133
133
|
# It is only available for Relationship Invoicing architecture.
|
134
|
-
# @return [BatchJobResponse] response from the API call
|
134
|
+
# @return [BatchJobResponse] response from the API call.
|
135
135
|
def export_proforma_invoices
|
136
136
|
new_api_call_builder
|
137
137
|
.request(new_request_builder(HttpMethodEnum::POST,
|
@@ -140,20 +140,20 @@ 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
|
|
155
155
|
# This API creates an invoices export and returns a batchjob object.
|
156
|
-
# @return [BatchJobResponse] response from the API call
|
156
|
+
# @return [BatchJobResponse] response from the API call.
|
157
157
|
def export_invoices
|
158
158
|
new_api_call_builder
|
159
159
|
.request(new_request_builder(HttpMethodEnum::POST,
|
@@ -162,20 +162,20 @@ 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
|
|
177
177
|
# This API creates a subscriptions export and returns a batchjob object.
|
178
|
-
# @return [BatchJobResponse] response from the API call
|
178
|
+
# @return [BatchJobResponse] response from the API call.
|
179
179
|
def export_subscriptions
|
180
180
|
new_api_call_builder
|
181
181
|
.request(new_request_builder(HttpMethodEnum::POST,
|
@@ -184,18 +184,18 @@ 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
|
|
196
196
|
# This API returns a batchjob object for proforma invoices export.
|
197
197
|
# @param [String] batch_id Required parameter: Id of a Batch Job.
|
198
|
-
# @return [BatchJobResponse] response from the API call
|
198
|
+
# @return [BatchJobResponse] response from the API call.
|
199
199
|
def read_proforma_invoices_export(batch_id)
|
200
200
|
new_api_call_builder
|
201
201
|
.request(new_request_builder(HttpMethodEnum::GET,
|
@@ -207,17 +207,17 @@ 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
|
|
218
218
|
# This API returns a batchjob object for invoices export.
|
219
219
|
# @param [String] batch_id Required parameter: Id of a Batch Job.
|
220
|
-
# @return [BatchJobResponse] response from the API call
|
220
|
+
# @return [BatchJobResponse] response from the API call.
|
221
221
|
def read_invoices_export(batch_id)
|
222
222
|
new_api_call_builder
|
223
223
|
.request(new_request_builder(HttpMethodEnum::GET,
|
@@ -229,17 +229,17 @@ 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
|
|
240
240
|
# This API returns a batchjob object for subscriptions export.
|
241
241
|
# @param [String] batch_id Required parameter: Id of a Batch Job.
|
242
|
-
# @return [BatchJobResponse] response from the API call
|
242
|
+
# @return [BatchJobResponse] response from the API call.
|
243
243
|
def read_subscriptions_export(batch_id)
|
244
244
|
new_api_call_builder
|
245
245
|
.request(new_request_builder(HttpMethodEnum::GET,
|
@@ -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.1.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
|