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
@@ -47,16 +47,18 @@ module AdvancedBilling
|
|
47
47
|
# resulting from these events to take manual action when needed.
|
48
48
|
# * `unpaid` - Indicates an unpaid subscription. A subscription is
|
49
49
|
# marked unpaid if the retry period expires and you have configured your
|
50
|
-
# [Dunning](https://maxio
|
51
|
-
#
|
50
|
+
# [Dunning](https://maxio.zendesk.com/hc/en-us/articles/24287076583565-Dunni
|
51
|
+
# ng-Overview) settings to have a Final Action of `mark the subscription
|
52
|
+
# unpaid`.
|
52
53
|
# * **End of Life States**
|
53
54
|
# * `canceled` - Indicates a canceled subscription. This may happen at
|
54
55
|
# your request (via the API or the web interface) or due to the expiration
|
55
56
|
# of the
|
56
|
-
# [Dunning](https://maxio
|
57
|
-
#
|
58
|
-
# [Reactivation](https://maxio
|
59
|
-
#
|
57
|
+
# [Dunning](https://maxio.zendesk.com/hc/en-us/articles/24287076583565-Dunni
|
58
|
+
# ng-Overview) process without payment. See the
|
59
|
+
# [Reactivation](https://maxio.zendesk.com/hc/en-us/articles/24252109503629-
|
60
|
+
# Reactivating-and-Resuming) documentation for info on how to restart a
|
61
|
+
# canceled subscription.
|
60
62
|
# While a subscription is canceled, its period will not advance, it will
|
61
63
|
# not accrue any new charges, and Advanced Billing will not attempt to
|
62
64
|
# collect the overdue balance.
|
@@ -78,11 +80,12 @@ module AdvancedBilling
|
|
78
80
|
# subscription that completed a no-obligation trial and did not have a card
|
79
81
|
# on file at the expiration of the trial period. See [Product Pricing – No
|
80
82
|
# Obligation
|
81
|
-
# Trials](https://maxio
|
82
|
-
# ) for more details.
|
83
|
+
# Trials](https://maxio.zendesk.com/hc/en-us/articles/24261076617869-Product
|
84
|
+
# -Editing) for more details.
|
83
85
|
# See [Subscription
|
84
|
-
# States](https://maxio
|
85
|
-
# ) for more info about subscription states and state
|
86
|
+
# States](https://maxio.zendesk.com/hc/en-us/articles/24252119027853-Subscri
|
87
|
+
# ption-States) for more info about subscription states and state
|
88
|
+
# transitions.
|
86
89
|
# @return [SubscriptionState]
|
87
90
|
attr_accessor :state
|
88
91
|
|
@@ -44,16 +44,18 @@ module AdvancedBilling
|
|
44
44
|
# resulting from these events to take manual action when needed.
|
45
45
|
# * `unpaid` - Indicates an unpaid subscription. A subscription is
|
46
46
|
# marked unpaid if the retry period expires and you have configured your
|
47
|
-
# [Dunning](https://maxio
|
48
|
-
#
|
47
|
+
# [Dunning](https://maxio.zendesk.com/hc/en-us/articles/24287076583565-Dunni
|
48
|
+
# ng-Overview) settings to have a Final Action of `mark the subscription
|
49
|
+
# unpaid`.
|
49
50
|
# * **End of Life States**
|
50
51
|
# * `canceled` - Indicates a canceled subscription. This may happen at
|
51
52
|
# your request (via the API or the web interface) or due to the expiration
|
52
53
|
# of the
|
53
|
-
# [Dunning](https://maxio
|
54
|
-
#
|
55
|
-
# [Reactivation](https://maxio
|
56
|
-
#
|
54
|
+
# [Dunning](https://maxio.zendesk.com/hc/en-us/articles/24287076583565-Dunni
|
55
|
+
# ng-Overview) process without payment. See the
|
56
|
+
# [Reactivation](https://maxio.zendesk.com/hc/en-us/articles/24252109503629-
|
57
|
+
# Reactivating-and-Resuming) documentation for info on how to restart a
|
58
|
+
# canceled subscription.
|
57
59
|
# While a subscription is canceled, its period will not advance, it will
|
58
60
|
# not accrue any new charges, and Advanced Billing will not attempt to
|
59
61
|
# collect the overdue balance.
|
@@ -75,11 +77,12 @@ module AdvancedBilling
|
|
75
77
|
# subscription that completed a no-obligation trial and did not have a card
|
76
78
|
# on file at the expiration of the trial period. See [Product Pricing – No
|
77
79
|
# Obligation
|
78
|
-
# Trials](https://maxio
|
79
|
-
# ) for more details.
|
80
|
+
# Trials](https://maxio.zendesk.com/hc/en-us/articles/24261076617869-Product
|
81
|
+
# -Editing) for more details.
|
80
82
|
# See [Subscription
|
81
|
-
# States](https://maxio
|
82
|
-
# ) for more info about subscription states and state
|
83
|
+
# States](https://maxio.zendesk.com/hc/en-us/articles/24252119027853-Subscri
|
84
|
+
# ption-States) for more info about subscription states and state
|
85
|
+
# transitions.
|
83
86
|
# @return [SubscriptionState]
|
84
87
|
attr_accessor :state
|
85
88
|
|
@@ -116,16 +119,18 @@ module AdvancedBilling
|
|
116
119
|
# resulting from these events to take manual action when needed.
|
117
120
|
# * `unpaid` - Indicates an unpaid subscription. A subscription is
|
118
121
|
# marked unpaid if the retry period expires and you have configured your
|
119
|
-
# [Dunning](https://maxio
|
120
|
-
#
|
122
|
+
# [Dunning](https://maxio.zendesk.com/hc/en-us/articles/24287076583565-Dunni
|
123
|
+
# ng-Overview) settings to have a Final Action of `mark the subscription
|
124
|
+
# unpaid`.
|
121
125
|
# * **End of Life States**
|
122
126
|
# * `canceled` - Indicates a canceled subscription. This may happen at
|
123
127
|
# your request (via the API or the web interface) or due to the expiration
|
124
128
|
# of the
|
125
|
-
# [Dunning](https://maxio
|
126
|
-
#
|
127
|
-
# [Reactivation](https://maxio
|
128
|
-
#
|
129
|
+
# [Dunning](https://maxio.zendesk.com/hc/en-us/articles/24287076583565-Dunni
|
130
|
+
# ng-Overview) process without payment. See the
|
131
|
+
# [Reactivation](https://maxio.zendesk.com/hc/en-us/articles/24252109503629-
|
132
|
+
# Reactivating-and-Resuming) documentation for info on how to restart a
|
133
|
+
# canceled subscription.
|
129
134
|
# While a subscription is canceled, its period will not advance, it will
|
130
135
|
# not accrue any new charges, and Advanced Billing will not attempt to
|
131
136
|
# collect the overdue balance.
|
@@ -147,11 +152,12 @@ module AdvancedBilling
|
|
147
152
|
# subscription that completed a no-obligation trial and did not have a card
|
148
153
|
# on file at the expiration of the trial period. See [Product Pricing – No
|
149
154
|
# Obligation
|
150
|
-
# Trials](https://maxio
|
151
|
-
# ) for more details.
|
155
|
+
# Trials](https://maxio.zendesk.com/hc/en-us/articles/24261076617869-Product
|
156
|
+
# -Editing) for more details.
|
152
157
|
# See [Subscription
|
153
|
-
# States](https://maxio
|
154
|
-
# ) for more info about subscription states and state
|
158
|
+
# States](https://maxio.zendesk.com/hc/en-us/articles/24252119027853-Subscri
|
159
|
+
# ption-States) for more info about subscription states and state
|
160
|
+
# transitions.
|
155
161
|
# @return [DateTime]
|
156
162
|
attr_accessor :updated_at
|
157
163
|
|
@@ -55,7 +55,7 @@ module AdvancedBilling
|
|
55
55
|
attr_accessor :expiration_interval
|
56
56
|
|
57
57
|
# (Optional)
|
58
|
-
# @return [
|
58
|
+
# @return [ExpirationIntervalUnit]
|
59
59
|
attr_accessor :expiration_interval_unit
|
60
60
|
|
61
61
|
# (Optional)
|
@@ -99,7 +99,10 @@ module AdvancedBilling
|
|
99
99
|
|
100
100
|
# An array for nullable fields
|
101
101
|
def self.nullables
|
102
|
-
[
|
102
|
+
%w[
|
103
|
+
interval_unit
|
104
|
+
expiration_interval_unit
|
105
|
+
]
|
103
106
|
end
|
104
107
|
|
105
108
|
def initialize(price_in_cents:, interval:, interval_unit:, name: SKIP,
|
@@ -73,10 +73,12 @@ module AdvancedBilling
|
|
73
73
|
attr_accessor :chargify_token
|
74
74
|
|
75
75
|
# The vault that stores the payment profile with the provided vault_token.
|
76
|
+
# Use `bogus` for testing.
|
76
77
|
# @return [BankAccountVault]
|
77
78
|
attr_accessor :current_vault
|
78
79
|
|
79
80
|
# The vault that stores the payment profile with the provided vault_token.
|
81
|
+
# Use `bogus` for testing.
|
80
82
|
# @return [String]
|
81
83
|
attr_accessor :gateway_handle
|
82
84
|
|
@@ -31,7 +31,7 @@ module AdvancedBilling
|
|
31
31
|
|
32
32
|
# The vault that stores the payment profile with the provided `vault_token`.
|
33
33
|
# Use `bogus` for testing.
|
34
|
-
# @return [
|
34
|
+
# @return [CreditCardVault]
|
35
35
|
attr_accessor :current_vault
|
36
36
|
|
37
37
|
# The vault that stores the payment profile with the provided `vault_token`.
|
@@ -71,16 +71,18 @@ module AdvancedBilling
|
|
71
71
|
# resulting from these events to take manual action when needed.
|
72
72
|
# * `unpaid` - Indicates an unpaid subscription. A subscription is
|
73
73
|
# marked unpaid if the retry period expires and you have configured your
|
74
|
-
# [Dunning](https://maxio
|
75
|
-
#
|
74
|
+
# [Dunning](https://maxio.zendesk.com/hc/en-us/articles/24287076583565-Dunni
|
75
|
+
# ng-Overview) settings to have a Final Action of `mark the subscription
|
76
|
+
# unpaid`.
|
76
77
|
# * **End of Life States**
|
77
78
|
# * `canceled` - Indicates a canceled subscription. This may happen at
|
78
79
|
# your request (via the API or the web interface) or due to the expiration
|
79
80
|
# of the
|
80
|
-
# [Dunning](https://maxio
|
81
|
-
#
|
82
|
-
# [Reactivation](https://maxio
|
83
|
-
#
|
81
|
+
# [Dunning](https://maxio.zendesk.com/hc/en-us/articles/24287076583565-Dunni
|
82
|
+
# ng-Overview) process without payment. See the
|
83
|
+
# [Reactivation](https://maxio.zendesk.com/hc/en-us/articles/24252109503629-
|
84
|
+
# Reactivating-and-Resuming) documentation for info on how to restart a
|
85
|
+
# canceled subscription.
|
84
86
|
# While a subscription is canceled, its period will not advance, it will
|
85
87
|
# not accrue any new charges, and Advanced Billing will not attempt to
|
86
88
|
# collect the overdue balance.
|
@@ -102,11 +104,12 @@ module AdvancedBilling
|
|
102
104
|
# subscription that completed a no-obligation trial and did not have a card
|
103
105
|
# on file at the expiration of the trial period. See [Product Pricing – No
|
104
106
|
# Obligation
|
105
|
-
# Trials](https://maxio
|
106
|
-
# ) for more details.
|
107
|
+
# Trials](https://maxio.zendesk.com/hc/en-us/articles/24261076617869-Product
|
108
|
+
# -Editing) for more details.
|
107
109
|
# See [Subscription
|
108
|
-
# States](https://maxio
|
109
|
-
# ) for more info about subscription states and state
|
110
|
+
# States](https://maxio.zendesk.com/hc/en-us/articles/24252119027853-Subscri
|
111
|
+
# ption-States) for more info about subscription states and state
|
112
|
+
# transitions.
|
110
113
|
# @return [SubscriptionState]
|
111
114
|
attr_accessor :state
|
112
115
|
|
@@ -143,16 +146,18 @@ module AdvancedBilling
|
|
143
146
|
# resulting from these events to take manual action when needed.
|
144
147
|
# * `unpaid` - Indicates an unpaid subscription. A subscription is
|
145
148
|
# marked unpaid if the retry period expires and you have configured your
|
146
|
-
# [Dunning](https://maxio
|
147
|
-
#
|
149
|
+
# [Dunning](https://maxio.zendesk.com/hc/en-us/articles/24287076583565-Dunni
|
150
|
+
# ng-Overview) settings to have a Final Action of `mark the subscription
|
151
|
+
# unpaid`.
|
148
152
|
# * **End of Life States**
|
149
153
|
# * `canceled` - Indicates a canceled subscription. This may happen at
|
150
154
|
# your request (via the API or the web interface) or due to the expiration
|
151
155
|
# of the
|
152
|
-
# [Dunning](https://maxio
|
153
|
-
#
|
154
|
-
# [Reactivation](https://maxio
|
155
|
-
#
|
156
|
+
# [Dunning](https://maxio.zendesk.com/hc/en-us/articles/24287076583565-Dunni
|
157
|
+
# ng-Overview) process without payment. See the
|
158
|
+
# [Reactivation](https://maxio.zendesk.com/hc/en-us/articles/24252109503629-
|
159
|
+
# Reactivating-and-Resuming) documentation for info on how to restart a
|
160
|
+
# canceled subscription.
|
156
161
|
# While a subscription is canceled, its period will not advance, it will
|
157
162
|
# not accrue any new charges, and Advanced Billing will not attempt to
|
158
163
|
# collect the overdue balance.
|
@@ -174,11 +179,12 @@ module AdvancedBilling
|
|
174
179
|
# subscription that completed a no-obligation trial and did not have a card
|
175
180
|
# on file at the expiration of the trial period. See [Product Pricing – No
|
176
181
|
# Obligation
|
177
|
-
# Trials](https://maxio
|
178
|
-
# ) for more details.
|
182
|
+
# Trials](https://maxio.zendesk.com/hc/en-us/articles/24261076617869-Product
|
183
|
+
# -Editing) for more details.
|
179
184
|
# See [Subscription
|
180
|
-
# States](https://maxio
|
181
|
-
# ) for more info about subscription states and state
|
185
|
+
# States](https://maxio.zendesk.com/hc/en-us/articles/24252119027853-Subscri
|
186
|
+
# ption-States) for more info about subscription states and state
|
187
|
+
# transitions.
|
182
188
|
# @return [TrueClass | FalseClass]
|
183
189
|
attr_accessor :cancel_at_end_of_period
|
184
190
|
|
@@ -215,16 +221,18 @@ module AdvancedBilling
|
|
215
221
|
# resulting from these events to take manual action when needed.
|
216
222
|
# * `unpaid` - Indicates an unpaid subscription. A subscription is
|
217
223
|
# marked unpaid if the retry period expires and you have configured your
|
218
|
-
# [Dunning](https://maxio
|
219
|
-
#
|
224
|
+
# [Dunning](https://maxio.zendesk.com/hc/en-us/articles/24287076583565-Dunni
|
225
|
+
# ng-Overview) settings to have a Final Action of `mark the subscription
|
226
|
+
# unpaid`.
|
220
227
|
# * **End of Life States**
|
221
228
|
# * `canceled` - Indicates a canceled subscription. This may happen at
|
222
229
|
# your request (via the API or the web interface) or due to the expiration
|
223
230
|
# of the
|
224
|
-
# [Dunning](https://maxio
|
225
|
-
#
|
226
|
-
# [Reactivation](https://maxio
|
227
|
-
#
|
231
|
+
# [Dunning](https://maxio.zendesk.com/hc/en-us/articles/24287076583565-Dunni
|
232
|
+
# ng-Overview) process without payment. See the
|
233
|
+
# [Reactivation](https://maxio.zendesk.com/hc/en-us/articles/24252109503629-
|
234
|
+
# Reactivating-and-Resuming) documentation for info on how to restart a
|
235
|
+
# canceled subscription.
|
228
236
|
# While a subscription is canceled, its period will not advance, it will
|
229
237
|
# not accrue any new charges, and Advanced Billing will not attempt to
|
230
238
|
# collect the overdue balance.
|
@@ -246,11 +254,12 @@ module AdvancedBilling
|
|
246
254
|
# subscription that completed a no-obligation trial and did not have a card
|
247
255
|
# on file at the expiration of the trial period. See [Product Pricing – No
|
248
256
|
# Obligation
|
249
|
-
# Trials](https://maxio
|
250
|
-
# ) for more details.
|
257
|
+
# Trials](https://maxio.zendesk.com/hc/en-us/articles/24261076617869-Product
|
258
|
+
# -Editing) for more details.
|
251
259
|
# See [Subscription
|
252
|
-
# States](https://maxio
|
253
|
-
# ) for more info about subscription states and state
|
260
|
+
# States](https://maxio.zendesk.com/hc/en-us/articles/24252119027853-Subscri
|
261
|
+
# ption-States) for more info about subscription states and state
|
262
|
+
# transitions.
|
254
263
|
# @return [Array[SubscriptionGroupItem]]
|
255
264
|
attr_accessor :subscriptions
|
256
265
|
|
@@ -31,36 +31,36 @@ module AdvancedBilling
|
|
31
31
|
# when needed. * `unpaid` - Indicates an unpaid subscription. A
|
32
32
|
# subscription is marked unpaid if the retry period expires and you have
|
33
33
|
# configured your
|
34
|
-
# [Dunning](https://maxio
|
35
|
-
# ) settings to have a Final Action of `mark the subscription
|
36
|
-
# of Life States** * `canceled` - Indicates a canceled
|
37
|
-
# may happen at your request (via the API or the web
|
38
|
-
# expiration of the
|
39
|
-
# [Dunning](https://maxio
|
40
|
-
# ) process without payment. See the
|
41
|
-
# [Reactivation](https://maxio
|
42
|
-
#
|
43
|
-
# While a subscription is canceled, its period will not
|
44
|
-
# accrue any new charges, and Advanced Billing will not
|
45
|
-
# overdue balance. * `expired` - Indicates a
|
46
|
-
# due to running its normal life cycle. Some
|
47
|
-
# have an expiration period. An expired
|
48
|
-
# active until it fulfilled its full
|
49
|
-
# Indicates that signup has failed. (You
|
50
|
-
# signup_failure webhook.) * `on_hold` - Indicates
|
51
|
-
# billing has been temporarily stopped. While it is
|
52
|
-
# subscription will resume and return to active status, this
|
53
|
-
# as an “End of Life” state because the customer is not
|
54
|
-
# during this time. * `suspended` - Indicates that a
|
55
|
-
# has used up all their prepayment balance. If a
|
56
|
-
# will return to an active state. *
|
57
|
-
# trial_ended
|
58
|
-
# did not have a card on file at the
|
59
|
-
# [Product Pricing – No Obligation
|
60
|
-
# Trials](https://maxio
|
61
|
-
# for more details. See [Subscription
|
62
|
-
# States](https://maxio
|
63
|
-
# for more info about subscription states and state transitions.
|
34
|
+
# [Dunning](https://maxio.zendesk.com/hc/en-us/articles/24287076583565-Dunning
|
35
|
+
# -Overview) settings to have a Final Action of `mark the subscription
|
36
|
+
# unpaid`. * **End of Life States** * `canceled` - Indicates a canceled
|
37
|
+
# subscription. This may happen at your request (via the API or the web
|
38
|
+
# interface) or due to the expiration of the
|
39
|
+
# [Dunning](https://maxio.zendesk.com/hc/en-us/articles/24287076583565-Dunning
|
40
|
+
# -Overview) process without payment. See the
|
41
|
+
# [Reactivation](https://maxio.zendesk.com/hc/en-us/articles/24252109503629-Re
|
42
|
+
# activating-and-Resuming) documentation for info on how to restart a canceled
|
43
|
+
# subscription. While a subscription is canceled, its period will not
|
44
|
+
# advance, it will not accrue any new charges, and Advanced Billing will not
|
45
|
+
# attempt to collect the overdue balance. * `expired` - Indicates a
|
46
|
+
# subscription that has expired due to running its normal life cycle. Some
|
47
|
+
# products may be configured to have an expiration period. An expired
|
48
|
+
# subscription then is one that stayed active until it fulfilled its full
|
49
|
+
# period. * `failed_to_create` - Indicates that signup has failed. (You
|
50
|
+
# may see this state in a signup_failure webhook.) * `on_hold` - Indicates
|
51
|
+
# that a subscription’s billing has been temporarily stopped. While it is
|
52
|
+
# expected that the subscription will resume and return to active status, this
|
53
|
+
# is still treated as an “End of Life” state because the customer is not
|
54
|
+
# paying for services during this time. * `suspended` - Indicates that a
|
55
|
+
# prepaid subscription has used up all their prepayment balance. If a
|
56
|
+
# prepayment is applied, it will return to an active state. *
|
57
|
+
# `trial_ended` - A subscription in a trial_ended state is a subscription that
|
58
|
+
# completed a no-obligation trial and did not have a card on file at the
|
59
|
+
# expiration of the trial period. See [Product Pricing – No Obligation
|
60
|
+
# Trials](https://maxio.zendesk.com/hc/en-us/articles/24261076617869-Product-E
|
61
|
+
# diting) for more details. See [Subscription
|
62
|
+
# States](https://maxio.zendesk.com/hc/en-us/articles/24252119027853-Subscript
|
63
|
+
# ion-States) for more info about subscription states and state transitions.
|
64
64
|
class SubscriptionState
|
65
65
|
SUBSCRIPTION_STATE = [
|
66
66
|
# TODO: Write general description for PENDING
|
@@ -19,8 +19,7 @@ module AdvancedBilling
|
|
19
19
|
|
20
20
|
# Returns `true` when Chargify has been properly configured to charge tax
|
21
21
|
# using the specified tax system. More details about taxes:
|
22
|
-
# https://maxio
|
23
|
-
# ntroduction
|
22
|
+
# https://maxio.zendesk.com/hc/en-us/articles/24287012608909-Taxes-Overview
|
24
23
|
# @return [TrueClass | FalseClass]
|
25
24
|
attr_accessor :fully_configured
|
26
25
|
|
@@ -86,6 +86,10 @@ module AdvancedBilling
|
|
86
86
|
# @return [TrueClass | FalseClass]
|
87
87
|
attr_accessor :verified
|
88
88
|
|
89
|
+
# The Salesforce ID of the customer
|
90
|
+
# @return [String]
|
91
|
+
attr_accessor :salesforce_id
|
92
|
+
|
89
93
|
# A mapping from model property names to API property names.
|
90
94
|
def self.names
|
91
95
|
@_hash = {} if @_hash.nil?
|
@@ -108,6 +112,7 @@ module AdvancedBilling
|
|
108
112
|
@_hash['tax_exempt_reason'] = 'tax_exempt_reason'
|
109
113
|
@_hash['parent_id'] = 'parent_id'
|
110
114
|
@_hash['verified'] = 'verified'
|
115
|
+
@_hash['salesforce_id'] = 'salesforce_id'
|
111
116
|
@_hash
|
112
117
|
end
|
113
118
|
|
@@ -133,6 +138,7 @@ module AdvancedBilling
|
|
133
138
|
tax_exempt_reason
|
134
139
|
parent_id
|
135
140
|
verified
|
141
|
+
salesforce_id
|
136
142
|
]
|
137
143
|
end
|
138
144
|
|
@@ -141,6 +147,7 @@ module AdvancedBilling
|
|
141
147
|
%w[
|
142
148
|
parent_id
|
143
149
|
verified
|
150
|
+
salesforce_id
|
144
151
|
]
|
145
152
|
end
|
146
153
|
|
@@ -149,7 +156,8 @@ module AdvancedBilling
|
|
149
156
|
address: SKIP, address_2: SKIP, city: SKIP, state: SKIP,
|
150
157
|
zip: SKIP, country: SKIP, phone: SKIP, locale: SKIP,
|
151
158
|
vat_number: SKIP, tax_exempt: SKIP, tax_exempt_reason: SKIP,
|
152
|
-
parent_id: SKIP, verified: SKIP,
|
159
|
+
parent_id: SKIP, verified: SKIP, salesforce_id: SKIP,
|
160
|
+
additional_properties: {})
|
153
161
|
@first_name = first_name unless first_name == SKIP
|
154
162
|
@last_name = last_name unless last_name == SKIP
|
155
163
|
@email = email unless email == SKIP
|
@@ -169,6 +177,7 @@ module AdvancedBilling
|
|
169
177
|
@tax_exempt_reason = tax_exempt_reason unless tax_exempt_reason == SKIP
|
170
178
|
@parent_id = parent_id unless parent_id == SKIP
|
171
179
|
@verified = verified unless verified == SKIP
|
180
|
+
@salesforce_id = salesforce_id unless salesforce_id == SKIP
|
172
181
|
|
173
182
|
# Add additional model properties to the instance.
|
174
183
|
additional_properties.each do |_name, _value|
|
@@ -201,6 +210,7 @@ module AdvancedBilling
|
|
201
210
|
hash.key?('tax_exempt_reason') ? hash['tax_exempt_reason'] : SKIP
|
202
211
|
parent_id = hash.key?('parent_id') ? hash['parent_id'] : SKIP
|
203
212
|
verified = hash.key?('verified') ? hash['verified'] : SKIP
|
213
|
+
salesforce_id = hash.key?('salesforce_id') ? hash['salesforce_id'] : SKIP
|
204
214
|
|
205
215
|
# Clean out expected properties from Hash.
|
206
216
|
names.each_value { |k| hash.delete(k) }
|
@@ -225,6 +235,7 @@ module AdvancedBilling
|
|
225
235
|
tax_exempt_reason: tax_exempt_reason,
|
226
236
|
parent_id: parent_id,
|
227
237
|
verified: verified,
|
238
|
+
salesforce_id: salesforce_id,
|
228
239
|
additional_properties: hash)
|
229
240
|
end
|
230
241
|
end
|
@@ -39,7 +39,7 @@ module AdvancedBilling
|
|
39
39
|
|
40
40
|
# The vault that stores the payment profile with the provided `vault_token`.
|
41
41
|
# Use `bogus` for testing.
|
42
|
-
# @return [
|
42
|
+
# @return [AllVaults]
|
43
43
|
attr_accessor :current_vault
|
44
44
|
|
45
45
|
# The credit card or bank account billing street address (i.e. 123 Main
|
@@ -5,12 +5,12 @@
|
|
5
5
|
|
6
6
|
module AdvancedBilling
|
7
7
|
# A utility to allow users to set the content-type for files
|
8
|
-
class FileWrapper < CoreLibrary::FileWrapper
|
9
|
-
# The constructor.
|
10
|
-
# @param [File] file The file to be sent in the request.
|
11
|
-
# @param [string] content_type The content type of the provided file.
|
12
|
-
def initialize(file, content_type: 'application/octet-stream')
|
13
|
-
super
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
8
|
+
class FileWrapper < CoreLibrary::FileWrapper
|
9
|
+
# The constructor.
|
10
|
+
# @param [File] file The file to be sent in the request.
|
11
|
+
# @param [string] content_type The content type of the provided file.
|
12
|
+
def initialize(file, content_type: 'application/octet-stream')
|
13
|
+
super
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -690,10 +690,24 @@ module AdvancedBilling
|
|
690
690
|
)
|
691
691
|
),
|
692
692
|
|
693
|
-
:
|
693
|
+
:PaymentProfile => AnyOf.new(
|
694
694
|
[
|
695
|
-
LeafType.new(
|
696
|
-
|
695
|
+
LeafType.new(ApplePayPaymentProfile, UnionTypeContext.new(
|
696
|
+
discriminator_value: 'apple_pay',
|
697
|
+
discriminator: 'payment_type'
|
698
|
+
)),
|
699
|
+
LeafType.new(BankAccountPaymentProfile, UnionTypeContext.new(
|
700
|
+
discriminator_value: 'bank_account',
|
701
|
+
discriminator: 'payment_type'
|
702
|
+
)),
|
703
|
+
LeafType.new(CreditCardPaymentProfile, UnionTypeContext.new(
|
704
|
+
discriminator_value: 'credit_card',
|
705
|
+
discriminator: 'payment_type'
|
706
|
+
)),
|
707
|
+
LeafType.new(PaypalPaymentProfile, UnionTypeContext.new(
|
708
|
+
discriminator_value: 'paypal_account',
|
709
|
+
discriminator: 'payment_type'
|
710
|
+
))
|
697
711
|
]
|
698
712
|
),
|
699
713
|
|
data/lib/advanced_billing.rb
CHANGED
@@ -51,9 +51,14 @@ require_relative 'advanced_billing/models/remove_payment_event'
|
|
51
51
|
require_relative 'advanced_billing/models/void_invoice_event'
|
52
52
|
require_relative 'advanced_billing/models/void_remainder_event'
|
53
53
|
require_relative 'advanced_billing/models/list_invoice_events_response'
|
54
|
+
require_relative 'advanced_billing/models/apple_pay_payment_profile'
|
55
|
+
require_relative 'advanced_billing/models/bank_account_payment_profile'
|
56
|
+
require_relative 'advanced_billing/models/credit_card_payment_profile'
|
57
|
+
require_relative 'advanced_billing/models/paypal_payment_profile'
|
54
58
|
require_relative 'advanced_billing/models/account_balance'
|
55
59
|
require_relative 'advanced_billing/models/account_balances'
|
56
60
|
require_relative 'advanced_billing/models/ach_agreement'
|
61
|
+
require_relative 'advanced_billing/models/activate_event_based_component'
|
57
62
|
require_relative 'advanced_billing/models/activate_subscription_request'
|
58
63
|
require_relative 'advanced_billing/models/add_coupons_request'
|
59
64
|
require_relative 'advanced_billing/models/add_subscription_to_a_group'
|
@@ -75,7 +80,6 @@ require_relative 'advanced_billing/models/apply_payment_event_data'
|
|
75
80
|
require_relative 'advanced_billing/models/attribute_error'
|
76
81
|
require_relative 'advanced_billing/models/auto_resume'
|
77
82
|
require_relative 'advanced_billing/models/bank_account_attributes'
|
78
|
-
require_relative 'advanced_billing/models/bank_account_payment_profile'
|
79
83
|
require_relative 'advanced_billing/models/bank_account_response'
|
80
84
|
require_relative 'advanced_billing/models/bank_account_verification'
|
81
85
|
require_relative 'advanced_billing/models/bank_account_verification_request'
|
@@ -200,7 +204,6 @@ require_relative 'advanced_billing/models/create_usage_request'
|
|
200
204
|
require_relative 'advanced_billing/models/created_prepayment'
|
201
205
|
require_relative 'advanced_billing/models/credit_account_balance_changed'
|
202
206
|
require_relative 'advanced_billing/models/credit_card_attributes'
|
203
|
-
require_relative 'advanced_billing/models/credit_card_payment_profile'
|
204
207
|
require_relative 'advanced_billing/models/credit_note'
|
205
208
|
require_relative 'advanced_billing/models/credit_note_application'
|
206
209
|
require_relative 'advanced_billing/models/credit_note_line_item'
|
@@ -528,8 +531,10 @@ require_relative 'advanced_billing/models/void_invoice_request'
|
|
528
531
|
require_relative 'advanced_billing/models/void_remainder_event_data'
|
529
532
|
require_relative 'advanced_billing/models/webhook'
|
530
533
|
require_relative 'advanced_billing/models/webhook_response'
|
534
|
+
require_relative 'advanced_billing/models/all_vaults'
|
531
535
|
require_relative 'advanced_billing/models/allocation_preview_direction'
|
532
536
|
require_relative 'advanced_billing/models/allocation_preview_line_item_kind'
|
537
|
+
require_relative 'advanced_billing/models/apple_pay_vault'
|
533
538
|
require_relative 'advanced_billing/models/auto_invite'
|
534
539
|
require_relative 'advanced_billing/models/bank_account_holder_type'
|
535
540
|
require_relative 'advanced_billing/models/bank_account_type'
|
@@ -547,18 +552,18 @@ require_relative 'advanced_billing/models/create_invoice_status'
|
|
547
552
|
require_relative 'advanced_billing/models/create_prepayment_method'
|
548
553
|
require_relative 'advanced_billing/models/' \
|
549
554
|
'create_signup_proforma_preview_include'
|
555
|
+
require_relative 'advanced_billing/models/credit_card_vault'
|
550
556
|
require_relative 'advanced_billing/models/credit_note_status'
|
551
557
|
require_relative 'advanced_billing/models/credit_scheme'
|
552
558
|
require_relative 'advanced_billing/models/credit_type'
|
553
559
|
require_relative 'advanced_billing/models/currency_price_role'
|
554
|
-
require_relative 'advanced_billing/models/current_vault'
|
555
560
|
require_relative 'advanced_billing/models/custom_field_owner'
|
556
561
|
require_relative 'advanced_billing/models/debit_note_role'
|
557
562
|
require_relative 'advanced_billing/models/debit_note_status'
|
558
563
|
require_relative 'advanced_billing/models/direction'
|
559
564
|
require_relative 'advanced_billing/models/discount_type'
|
560
565
|
require_relative 'advanced_billing/models/event_type'
|
561
|
-
require_relative 'advanced_billing/models/
|
566
|
+
require_relative 'advanced_billing/models/expiration_interval_unit'
|
562
567
|
require_relative 'advanced_billing/models/failed_payment_action'
|
563
568
|
require_relative 'advanced_billing/models/first_charge_type'
|
564
569
|
require_relative 'advanced_billing/models/group_target_type'
|
@@ -590,6 +595,7 @@ require_relative 'advanced_billing/models/list_subscription_components_include'
|
|
590
595
|
require_relative 'advanced_billing/models/list_subscription_components_sort'
|
591
596
|
require_relative 'advanced_billing/models/metafield_input'
|
592
597
|
require_relative 'advanced_billing/models/payment_type'
|
598
|
+
require_relative 'advanced_billing/models/pay_pal_vault'
|
593
599
|
require_relative 'advanced_billing/models/prepayment_method'
|
594
600
|
require_relative 'advanced_billing/models/price_point_type'
|
595
601
|
require_relative 'advanced_billing/models/pricing_scheme'
|