maxio-advanced-billing-sdk 4.0.0 → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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
@@ -45,9 +45,9 @@ module AdvancedBilling
|
|
45
45
|
|
46
46
|
# (Not required for ‘per_unit’ pricing schemes) One or more price brackets.
|
47
47
|
# See [Price Bracket
|
48
|
-
# Rules](https://maxio
|
49
|
-
# price-bracket-rules) for an overview of how price
|
50
|
-
# different pricing schemes.
|
48
|
+
# Rules](https://maxio.zendesk.com/hc/en-us/articles/24261149166733-Componen
|
49
|
+
# t-Pricing-Schemes#price-bracket-rules) for an overview of how price
|
50
|
+
# brackets work for different pricing schemes.
|
51
51
|
# @return [Array[Price]]
|
52
52
|
attr_accessor :prices
|
53
53
|
|
@@ -170,6 +170,7 @@ module AdvancedBilling
|
|
170
170
|
%w[
|
171
171
|
upgrade_charge
|
172
172
|
downgrade_credit
|
173
|
+
interval_unit
|
173
174
|
]
|
174
175
|
end
|
175
176
|
|
@@ -32,8 +32,8 @@ module AdvancedBilling
|
|
32
32
|
|
33
33
|
# (Not required for ‘per_unit’ pricing schemes) One or more price brackets.
|
34
34
|
# See [Price Bracket
|
35
|
-
# Rules](https://
|
36
|
-
#
|
35
|
+
# Rules](https://maxio.zendesk.com/hc/en-us/articles/24261191737101-Price-Po
|
36
|
+
# ints-Components) for an overview of how price brackets work for different
|
37
37
|
# pricing schemes.
|
38
38
|
# @return [Array[Price]]
|
39
39
|
attr_accessor :prices
|
@@ -155,6 +155,7 @@ module AdvancedBilling
|
|
155
155
|
%w[
|
156
156
|
upgrade_charge
|
157
157
|
downgrade_credit
|
158
|
+
interval_unit
|
158
159
|
]
|
159
160
|
end
|
160
161
|
|
@@ -14,8 +14,8 @@ module AdvancedBilling
|
|
14
14
|
attr_accessor :invoice_id
|
15
15
|
|
16
16
|
# The current status of the invoice. See [Invoice
|
17
|
-
# Statuses](https://maxio
|
18
|
-
#
|
17
|
+
# Statuses](https://maxio.zendesk.com/hc/en-us/articles/24252287829645-Advan
|
18
|
+
# ced-Billing-Invoices-Overview#invoice-statuses) for more.
|
19
19
|
# @return [InvoiceStatus]
|
20
20
|
attr_accessor :status
|
21
21
|
|
@@ -0,0 +1,29 @@
|
|
1
|
+
# advanced_billing
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
module AdvancedBilling
|
7
|
+
# The vault that stores the payment profile with the provided vault_token.
|
8
|
+
class PayPalVault
|
9
|
+
PAY_PAL_VAULT = [
|
10
|
+
# TODO: Write general description for BRAINTREE_BLUE
|
11
|
+
BRAINTREE_BLUE = 'braintree_blue'.freeze,
|
12
|
+
|
13
|
+
# TODO: Write general description for PAYPAL
|
14
|
+
PAYPAL = 'paypal'.freeze,
|
15
|
+
|
16
|
+
# TODO: Write general description for MODUSLINK
|
17
|
+
MODUSLINK = 'moduslink'.freeze,
|
18
|
+
|
19
|
+
# TODO: Write general description for PAYPAL_COMPLETE
|
20
|
+
PAYPAL_COMPLETE = 'paypal_complete'.freeze
|
21
|
+
].freeze
|
22
|
+
|
23
|
+
def self.validate(value)
|
24
|
+
return false if value.nil?
|
25
|
+
|
26
|
+
PAY_PAL_VAULT.include?(value)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -9,22 +9,22 @@ module AdvancedBilling
|
|
9
9
|
SKIP = Object.new
|
10
10
|
private_constant :SKIP
|
11
11
|
|
12
|
-
# (Optional) Token received after sending billing
|
12
|
+
# (Optional) Token received after sending billing information using
|
13
13
|
# chargify.js. This token must be passed as a sole attribute of
|
14
14
|
# `payment_profile_attributes` (i.e. tok_9g6hw85pnpt6knmskpwp4ttt)
|
15
15
|
# @return [String]
|
16
16
|
attr_accessor :chargify_token
|
17
17
|
|
18
|
-
# (Optional) Token received after sending billing
|
18
|
+
# (Optional) Token received after sending billing information using
|
19
19
|
# chargify.js. This token must be passed as a sole attribute of
|
20
20
|
# `payment_profile_attributes` (i.e. tok_9g6hw85pnpt6knmskpwp4ttt)
|
21
21
|
# @return [Integer]
|
22
22
|
attr_accessor :id
|
23
23
|
|
24
|
-
# (Optional) Token received after sending billing
|
24
|
+
# (Optional) Token received after sending billing information using
|
25
25
|
# chargify.js. This token must be passed as a sole attribute of
|
26
26
|
# `payment_profile_attributes` (i.e. tok_9g6hw85pnpt6knmskpwp4ttt)
|
27
|
-
# @return [
|
27
|
+
# @return [PaymentType]
|
28
28
|
attr_accessor :payment_type
|
29
29
|
|
30
30
|
# (Optional) First name on card or bank account. If omitted, the first_name
|
@@ -108,7 +108,7 @@ module AdvancedBilling
|
|
108
108
|
|
109
109
|
# (Optional, used only for Subscription Import) The vault that stores the
|
110
110
|
# payment profile with the provided vault_token.
|
111
|
-
# @return [
|
111
|
+
# @return [AllVaults]
|
112
112
|
attr_accessor :current_vault
|
113
113
|
|
114
114
|
# (Optional, used only for Subscription Import) The “token” provided by your
|
@@ -45,7 +45,7 @@ module AdvancedBilling
|
|
45
45
|
|
46
46
|
# Extract variables from the hash.
|
47
47
|
payment_profile = hash.key?('payment_profile') ? APIHelper.deserialize_union_type(
|
48
|
-
UnionTypeLookUp.get(:
|
48
|
+
UnionTypeLookUp.get(:PaymentProfile), hash['payment_profile']
|
49
49
|
) : nil
|
50
50
|
|
51
51
|
# Clean out expected properties from Hash.
|
@@ -60,13 +60,13 @@ module AdvancedBilling
|
|
60
60
|
# @param [PaymentProfileResponse | Hash] The value against the validation is performed.
|
61
61
|
def self.validate(value)
|
62
62
|
if value.instance_of? self
|
63
|
-
return UnionTypeLookUp.get(:
|
63
|
+
return UnionTypeLookUp.get(:PaymentProfile)
|
64
64
|
.validate(value.payment_profile)
|
65
65
|
end
|
66
66
|
|
67
67
|
return false unless value.instance_of? Hash
|
68
68
|
|
69
|
-
UnionTypeLookUp.get(:
|
69
|
+
UnionTypeLookUp.get(:PaymentProfile)
|
70
70
|
.validate(value['payment_profile'])
|
71
71
|
end
|
72
72
|
end
|
@@ -14,7 +14,10 @@ module AdvancedBilling
|
|
14
14
|
BANK_ACCOUNT = 'bank_account'.freeze,
|
15
15
|
|
16
16
|
# TODO: Write general description for PAYPAL_ACCOUNT
|
17
|
-
PAYPAL_ACCOUNT = 'paypal_account'.freeze
|
17
|
+
PAYPAL_ACCOUNT = 'paypal_account'.freeze,
|
18
|
+
|
19
|
+
# TODO: Write general description for APPLE_PAY
|
20
|
+
APPLE_PAY = 'apple_pay'.freeze
|
18
21
|
].freeze
|
19
22
|
|
20
23
|
def self.validate(value)
|
@@ -0,0 +1,242 @@
|
|
1
|
+
# advanced_billing
|
2
|
+
#
|
3
|
+
# This file was automatically generated by APIMATIC v2.0
|
4
|
+
# ( https://apimatic.io ).
|
5
|
+
|
6
|
+
module AdvancedBilling
|
7
|
+
# PaypalPaymentProfile Model.
|
8
|
+
class PaypalPaymentProfile < BaseModel
|
9
|
+
SKIP = Object.new
|
10
|
+
private_constant :SKIP
|
11
|
+
|
12
|
+
# The Chargify-assigned ID of the stored PayPal payment profile.
|
13
|
+
# @return [Integer]
|
14
|
+
attr_accessor :id
|
15
|
+
|
16
|
+
# The first name of the PayPal account holder
|
17
|
+
# @return [String]
|
18
|
+
attr_accessor :first_name
|
19
|
+
|
20
|
+
# The last name of the PayPal account holder
|
21
|
+
# @return [String]
|
22
|
+
attr_accessor :last_name
|
23
|
+
|
24
|
+
# The Chargify-assigned id for the customer record to which the PayPal
|
25
|
+
# account belongs
|
26
|
+
# @return [Integer]
|
27
|
+
attr_accessor :customer_id
|
28
|
+
|
29
|
+
# The vault that stores the payment profile with the provided vault_token.
|
30
|
+
# @return [PayPalVault]
|
31
|
+
attr_accessor :current_vault
|
32
|
+
|
33
|
+
# The “token” provided by your vault storage for an already stored payment
|
34
|
+
# profile
|
35
|
+
# @return [String]
|
36
|
+
attr_accessor :vault_token
|
37
|
+
|
38
|
+
# The current billing street address for the PayPal account
|
39
|
+
# @return [String]
|
40
|
+
attr_accessor :billing_address
|
41
|
+
|
42
|
+
# The current billing address city for the PayPal account
|
43
|
+
# @return [String]
|
44
|
+
attr_accessor :billing_city
|
45
|
+
|
46
|
+
# The current billing address state for the PayPal account
|
47
|
+
# @return [String]
|
48
|
+
attr_accessor :billing_state
|
49
|
+
|
50
|
+
# The current billing address zip code for the PayPal account
|
51
|
+
# @return [String]
|
52
|
+
attr_accessor :billing_zip
|
53
|
+
|
54
|
+
# The current billing address country for the PayPal account
|
55
|
+
# @return [String]
|
56
|
+
attr_accessor :billing_country
|
57
|
+
|
58
|
+
# The current billing address country for the PayPal account
|
59
|
+
# @return [String]
|
60
|
+
attr_accessor :customer_vault_token
|
61
|
+
|
62
|
+
# The current billing street address, second line, for the PayPal account
|
63
|
+
# @return [String]
|
64
|
+
attr_accessor :billing_address_2
|
65
|
+
|
66
|
+
# The current billing street address, second line, for the PayPal account
|
67
|
+
# @return [PaymentType]
|
68
|
+
attr_accessor :payment_type
|
69
|
+
|
70
|
+
# The current billing street address, second line, for the PayPal account
|
71
|
+
# @return [Integer]
|
72
|
+
attr_accessor :site_gateway_setting_id
|
73
|
+
|
74
|
+
# The current billing street address, second line, for the PayPal account
|
75
|
+
# @return [String]
|
76
|
+
attr_accessor :gateway_handle
|
77
|
+
|
78
|
+
# The current billing street address, second line, for the PayPal account
|
79
|
+
# @return [String]
|
80
|
+
attr_accessor :paypal_email
|
81
|
+
|
82
|
+
# A mapping from model property names to API property names.
|
83
|
+
def self.names
|
84
|
+
@_hash = {} if @_hash.nil?
|
85
|
+
@_hash['id'] = 'id'
|
86
|
+
@_hash['first_name'] = 'first_name'
|
87
|
+
@_hash['last_name'] = 'last_name'
|
88
|
+
@_hash['customer_id'] = 'customer_id'
|
89
|
+
@_hash['current_vault'] = 'current_vault'
|
90
|
+
@_hash['vault_token'] = 'vault_token'
|
91
|
+
@_hash['billing_address'] = 'billing_address'
|
92
|
+
@_hash['billing_city'] = 'billing_city'
|
93
|
+
@_hash['billing_state'] = 'billing_state'
|
94
|
+
@_hash['billing_zip'] = 'billing_zip'
|
95
|
+
@_hash['billing_country'] = 'billing_country'
|
96
|
+
@_hash['customer_vault_token'] = 'customer_vault_token'
|
97
|
+
@_hash['billing_address_2'] = 'billing_address_2'
|
98
|
+
@_hash['payment_type'] = 'payment_type'
|
99
|
+
@_hash['site_gateway_setting_id'] = 'site_gateway_setting_id'
|
100
|
+
@_hash['gateway_handle'] = 'gateway_handle'
|
101
|
+
@_hash['paypal_email'] = 'paypal_email'
|
102
|
+
@_hash
|
103
|
+
end
|
104
|
+
|
105
|
+
# An array for optional fields
|
106
|
+
def self.optionals
|
107
|
+
%w[
|
108
|
+
id
|
109
|
+
first_name
|
110
|
+
last_name
|
111
|
+
customer_id
|
112
|
+
current_vault
|
113
|
+
vault_token
|
114
|
+
billing_address
|
115
|
+
billing_city
|
116
|
+
billing_state
|
117
|
+
billing_zip
|
118
|
+
billing_country
|
119
|
+
customer_vault_token
|
120
|
+
billing_address_2
|
121
|
+
site_gateway_setting_id
|
122
|
+
gateway_handle
|
123
|
+
paypal_email
|
124
|
+
]
|
125
|
+
end
|
126
|
+
|
127
|
+
# An array for nullable fields
|
128
|
+
def self.nullables
|
129
|
+
%w[
|
130
|
+
billing_address
|
131
|
+
billing_city
|
132
|
+
billing_state
|
133
|
+
billing_zip
|
134
|
+
billing_country
|
135
|
+
customer_vault_token
|
136
|
+
billing_address_2
|
137
|
+
site_gateway_setting_id
|
138
|
+
gateway_handle
|
139
|
+
]
|
140
|
+
end
|
141
|
+
|
142
|
+
def initialize(payment_type: PaymentType::PAYPAL_ACCOUNT, id: SKIP,
|
143
|
+
first_name: SKIP, last_name: SKIP, customer_id: SKIP,
|
144
|
+
current_vault: SKIP, vault_token: SKIP,
|
145
|
+
billing_address: SKIP, billing_city: SKIP,
|
146
|
+
billing_state: SKIP, billing_zip: SKIP,
|
147
|
+
billing_country: SKIP, customer_vault_token: SKIP,
|
148
|
+
billing_address_2: SKIP, site_gateway_setting_id: SKIP,
|
149
|
+
gateway_handle: SKIP, paypal_email: SKIP,
|
150
|
+
additional_properties: {})
|
151
|
+
@id = id unless id == SKIP
|
152
|
+
@first_name = first_name unless first_name == SKIP
|
153
|
+
@last_name = last_name unless last_name == SKIP
|
154
|
+
@customer_id = customer_id unless customer_id == SKIP
|
155
|
+
@current_vault = current_vault unless current_vault == SKIP
|
156
|
+
@vault_token = vault_token unless vault_token == SKIP
|
157
|
+
@billing_address = billing_address unless billing_address == SKIP
|
158
|
+
@billing_city = billing_city unless billing_city == SKIP
|
159
|
+
@billing_state = billing_state unless billing_state == SKIP
|
160
|
+
@billing_zip = billing_zip unless billing_zip == SKIP
|
161
|
+
@billing_country = billing_country unless billing_country == SKIP
|
162
|
+
@customer_vault_token = customer_vault_token unless customer_vault_token == SKIP
|
163
|
+
@billing_address_2 = billing_address_2 unless billing_address_2 == SKIP
|
164
|
+
@payment_type = payment_type
|
165
|
+
@site_gateway_setting_id = site_gateway_setting_id unless site_gateway_setting_id == SKIP
|
166
|
+
@gateway_handle = gateway_handle unless gateway_handle == SKIP
|
167
|
+
@paypal_email = paypal_email unless paypal_email == SKIP
|
168
|
+
|
169
|
+
# Add additional model properties to the instance.
|
170
|
+
additional_properties.each do |_name, _value|
|
171
|
+
instance_variable_set("@#{_name}", _value)
|
172
|
+
end
|
173
|
+
end
|
174
|
+
|
175
|
+
# Creates an instance of the object from a hash.
|
176
|
+
def self.from_hash(hash)
|
177
|
+
return nil unless hash
|
178
|
+
|
179
|
+
# Extract variables from the hash.
|
180
|
+
payment_type = hash['payment_type'] ||= PaymentType::PAYPAL_ACCOUNT
|
181
|
+
id = hash.key?('id') ? hash['id'] : SKIP
|
182
|
+
first_name = hash.key?('first_name') ? hash['first_name'] : SKIP
|
183
|
+
last_name = hash.key?('last_name') ? hash['last_name'] : SKIP
|
184
|
+
customer_id = hash.key?('customer_id') ? hash['customer_id'] : SKIP
|
185
|
+
current_vault = hash.key?('current_vault') ? hash['current_vault'] : SKIP
|
186
|
+
vault_token = hash.key?('vault_token') ? hash['vault_token'] : SKIP
|
187
|
+
billing_address =
|
188
|
+
hash.key?('billing_address') ? hash['billing_address'] : SKIP
|
189
|
+
billing_city = hash.key?('billing_city') ? hash['billing_city'] : SKIP
|
190
|
+
billing_state = hash.key?('billing_state') ? hash['billing_state'] : SKIP
|
191
|
+
billing_zip = hash.key?('billing_zip') ? hash['billing_zip'] : SKIP
|
192
|
+
billing_country =
|
193
|
+
hash.key?('billing_country') ? hash['billing_country'] : SKIP
|
194
|
+
customer_vault_token =
|
195
|
+
hash.key?('customer_vault_token') ? hash['customer_vault_token'] : SKIP
|
196
|
+
billing_address_2 =
|
197
|
+
hash.key?('billing_address_2') ? hash['billing_address_2'] : SKIP
|
198
|
+
site_gateway_setting_id =
|
199
|
+
hash.key?('site_gateway_setting_id') ? hash['site_gateway_setting_id'] : SKIP
|
200
|
+
gateway_handle =
|
201
|
+
hash.key?('gateway_handle') ? hash['gateway_handle'] : SKIP
|
202
|
+
paypal_email = hash.key?('paypal_email') ? hash['paypal_email'] : SKIP
|
203
|
+
|
204
|
+
# Clean out expected properties from Hash.
|
205
|
+
names.each_value { |k| hash.delete(k) }
|
206
|
+
|
207
|
+
# Create object from extracted values.
|
208
|
+
PaypalPaymentProfile.new(payment_type: payment_type,
|
209
|
+
id: id,
|
210
|
+
first_name: first_name,
|
211
|
+
last_name: last_name,
|
212
|
+
customer_id: customer_id,
|
213
|
+
current_vault: current_vault,
|
214
|
+
vault_token: vault_token,
|
215
|
+
billing_address: billing_address,
|
216
|
+
billing_city: billing_city,
|
217
|
+
billing_state: billing_state,
|
218
|
+
billing_zip: billing_zip,
|
219
|
+
billing_country: billing_country,
|
220
|
+
customer_vault_token: customer_vault_token,
|
221
|
+
billing_address_2: billing_address_2,
|
222
|
+
site_gateway_setting_id: site_gateway_setting_id,
|
223
|
+
gateway_handle: gateway_handle,
|
224
|
+
paypal_email: paypal_email,
|
225
|
+
additional_properties: hash)
|
226
|
+
end
|
227
|
+
|
228
|
+
# Validates an instance of the object from a given value.
|
229
|
+
# @param [PaypalPaymentProfile | Hash] The value against the validation is performed.
|
230
|
+
def self.validate(value)
|
231
|
+
if value.instance_of? self
|
232
|
+
return APIHelper.valid_type?(value.payment_type,
|
233
|
+
->(val) { PaymentType.validate(val) })
|
234
|
+
end
|
235
|
+
|
236
|
+
return false unless value.instance_of? Hash
|
237
|
+
|
238
|
+
APIHelper.valid_type?(value['payment_type'],
|
239
|
+
->(val) { PaymentType.validate(val) })
|
240
|
+
end
|
241
|
+
end
|
242
|
+
end
|
@@ -45,9 +45,9 @@ module AdvancedBilling
|
|
45
45
|
|
46
46
|
# (Not required for ‘per_unit’ pricing schemes) One or more price brackets.
|
47
47
|
# See [Price Bracket
|
48
|
-
# Rules](https://
|
49
|
-
#
|
50
|
-
# different pricing schemes.
|
48
|
+
# Rules](https://maxio.zendesk.com/hc/en-us/articles/24261149166733-Componen
|
49
|
+
# t-Pricing-Schemes#price-bracket-rules) for an overview of how price
|
50
|
+
# brackets work for different pricing schemes.
|
51
51
|
# @return [Array[Price]]
|
52
52
|
attr_accessor :prices
|
53
53
|
|
@@ -116,7 +116,7 @@ module AdvancedBilling
|
|
116
116
|
# (only for prepaid usage components where rollover_prepaid_remainder is
|
117
117
|
# true) The number of `expiration_interval_unit`s after which rollover
|
118
118
|
# amounts should expire
|
119
|
-
# @return [
|
119
|
+
# @return [ExpirationIntervalUnit]
|
120
120
|
attr_accessor :expiration_interval_unit
|
121
121
|
|
122
122
|
# (only for prepaid usage components where rollover_prepaid_remainder is
|
@@ -197,6 +197,7 @@ module AdvancedBilling
|
|
197
197
|
%w[
|
198
198
|
upgrade_charge
|
199
199
|
downgrade_credit
|
200
|
+
expiration_interval_unit
|
200
201
|
]
|
201
202
|
end
|
202
203
|
|
@@ -44,8 +44,8 @@ module AdvancedBilling
|
|
44
44
|
attr_accessor :expiration_interval
|
45
45
|
|
46
46
|
# A string representing the expiration interval unit for this product,
|
47
|
-
# either month or
|
48
|
-
# @return [
|
47
|
+
# either month, day or never
|
48
|
+
# @return [ExpirationIntervalUnit]
|
49
49
|
attr_accessor :expiration_interval_unit
|
50
50
|
|
51
51
|
# Timestamp indicating when this product was created
|
@@ -76,8 +76,8 @@ module AdvancedBilling
|
|
76
76
|
attr_accessor :expiration_interval
|
77
77
|
|
78
78
|
# A string representing the expiration interval unit for this product price
|
79
|
-
# point, either month or
|
80
|
-
# @return [
|
79
|
+
# point, either month, day or never
|
80
|
+
# @return [ExpirationIntervalUnit]
|
81
81
|
attr_accessor :expiration_interval_unit
|
82
82
|
|
83
83
|
# The product id this price point belongs to
|
@@ -77,8 +77,8 @@ module AdvancedBilling
|
|
77
77
|
# "Parent" invoices do not have lines of their own, but they have subtotals
|
78
78
|
# and totals which aggregate the member invoice segments.
|
79
79
|
# See also the [invoice consolidation
|
80
|
-
# documentation](https://
|
81
|
-
#
|
80
|
+
# documentation](https://maxio.zendesk.com/hc/en-us/articles/24252269909389-
|
81
|
+
# Invoice-Consolidation).
|
82
82
|
# @return [InvoiceConsolidationLevel]
|
83
83
|
attr_accessor :consolidation_level
|
84
84
|
|
@@ -92,8 +92,8 @@ module AdvancedBilling
|
|
92
92
|
# "Parent" invoices do not have lines of their own, but they have subtotals
|
93
93
|
# and totals which aggregate the member invoice segments.
|
94
94
|
# See also the [invoice consolidation
|
95
|
-
# documentation](https://
|
96
|
-
#
|
95
|
+
# documentation](https://maxio.zendesk.com/hc/en-us/articles/24252269909389-
|
96
|
+
# Invoice-Consolidation).
|
97
97
|
# @return [String]
|
98
98
|
attr_accessor :product_name
|
99
99
|
|
@@ -107,8 +107,8 @@ module AdvancedBilling
|
|
107
107
|
# "Parent" invoices do not have lines of their own, but they have subtotals
|
108
108
|
# and totals which aggregate the member invoice segments.
|
109
109
|
# See also the [invoice consolidation
|
110
|
-
# documentation](https://
|
111
|
-
#
|
110
|
+
# documentation](https://maxio.zendesk.com/hc/en-us/articles/24252269909389-
|
111
|
+
# Invoice-Consolidation).
|
112
112
|
# @return [String]
|
113
113
|
attr_accessor :product_family_name
|
114
114
|
|
@@ -45,9 +45,9 @@ module AdvancedBilling
|
|
45
45
|
|
46
46
|
# (Not required for ‘per_unit’ pricing schemes) One or more price brackets.
|
47
47
|
# See [Price Bracket
|
48
|
-
# Rules](https://
|
49
|
-
# bracket-rules) for an overview of how price
|
50
|
-
# pricing schemes.
|
48
|
+
# Rules](https://maxio.zendesk.com/hc/en-us/articles/24261149166733-Componen
|
49
|
+
# t-Pricing-Schemes#price-bracket-rules) for an overview of how price
|
50
|
+
# brackets work for different pricing schemes.
|
51
51
|
# @return [Array[Price]]
|
52
52
|
attr_accessor :prices
|
53
53
|
|
@@ -176,6 +176,7 @@ module AdvancedBilling
|
|
176
176
|
%w[
|
177
177
|
upgrade_charge
|
178
178
|
downgrade_credit
|
179
|
+
interval_unit
|
179
180
|
]
|
180
181
|
end
|
181
182
|
|
@@ -24,8 +24,8 @@ module AdvancedBilling
|
|
24
24
|
# "Parent" invoices do not have lines of their own, but they have subtotals
|
25
25
|
# and totals which aggregate the member invoice segments.
|
26
26
|
# See also the [invoice consolidation
|
27
|
-
# documentation](https://
|
28
|
-
#
|
27
|
+
# documentation](https://maxio.zendesk.com/hc/en-us/articles/24252269909389-
|
28
|
+
# Invoice-Consolidation).
|
29
29
|
# @return [InvoiceConsolidationLevel]
|
30
30
|
attr_accessor :consolidation_level
|
31
31
|
|
@@ -39,8 +39,8 @@ module AdvancedBilling
|
|
39
39
|
# "Parent" invoices do not have lines of their own, but they have subtotals
|
40
40
|
# and totals which aggregate the member invoice segments.
|
41
41
|
# See also the [invoice consolidation
|
42
|
-
# documentation](https://
|
43
|
-
#
|
42
|
+
# documentation](https://maxio.zendesk.com/hc/en-us/articles/24252269909389-
|
43
|
+
# Invoice-Consolidation).
|
44
44
|
# @return [CreditNote]
|
45
45
|
attr_accessor :credit_note_attributes
|
46
46
|
|
@@ -3,6 +3,7 @@
|
|
3
3
|
# This file was automatically generated by APIMATIC v2.0
|
4
4
|
# ( https://apimatic.io ).
|
5
5
|
|
6
|
+
require 'date'
|
6
7
|
module AdvancedBilling
|
7
8
|
# ResentInvitation Model.
|
8
9
|
class ResentInvitation < BaseModel
|
@@ -25,6 +26,14 @@ module AdvancedBilling
|
|
25
26
|
# @return [Integer]
|
26
27
|
attr_accessor :uninvited_count
|
27
28
|
|
29
|
+
# TODO: Write general description for this method
|
30
|
+
# @return [DateTime]
|
31
|
+
attr_accessor :last_invite_sent_at
|
32
|
+
|
33
|
+
# TODO: Write general description for this method
|
34
|
+
# @return [DateTime]
|
35
|
+
attr_accessor :last_invite_accepted_at
|
36
|
+
|
28
37
|
# A mapping from model property names to API property names.
|
29
38
|
def self.names
|
30
39
|
@_hash = {} if @_hash.nil?
|
@@ -32,6 +41,8 @@ module AdvancedBilling
|
|
32
41
|
@_hash['last_accepted_at'] = 'last_accepted_at'
|
33
42
|
@_hash['send_invite_link_text'] = 'send_invite_link_text'
|
34
43
|
@_hash['uninvited_count'] = 'uninvited_count'
|
44
|
+
@_hash['last_invite_sent_at'] = 'last_invite_sent_at'
|
45
|
+
@_hash['last_invite_accepted_at'] = 'last_invite_accepted_at'
|
35
46
|
@_hash
|
36
47
|
end
|
37
48
|
|
@@ -42,6 +53,8 @@ module AdvancedBilling
|
|
42
53
|
last_accepted_at
|
43
54
|
send_invite_link_text
|
44
55
|
uninvited_count
|
56
|
+
last_invite_sent_at
|
57
|
+
last_invite_accepted_at
|
45
58
|
]
|
46
59
|
end
|
47
60
|
|
@@ -52,11 +65,14 @@ module AdvancedBilling
|
|
52
65
|
|
53
66
|
def initialize(last_sent_at: SKIP, last_accepted_at: SKIP,
|
54
67
|
send_invite_link_text: SKIP, uninvited_count: SKIP,
|
68
|
+
last_invite_sent_at: SKIP, last_invite_accepted_at: SKIP,
|
55
69
|
additional_properties: {})
|
56
70
|
@last_sent_at = last_sent_at unless last_sent_at == SKIP
|
57
71
|
@last_accepted_at = last_accepted_at unless last_accepted_at == SKIP
|
58
72
|
@send_invite_link_text = send_invite_link_text unless send_invite_link_text == SKIP
|
59
73
|
@uninvited_count = uninvited_count unless uninvited_count == SKIP
|
74
|
+
@last_invite_sent_at = last_invite_sent_at unless last_invite_sent_at == SKIP
|
75
|
+
@last_invite_accepted_at = last_invite_accepted_at unless last_invite_accepted_at == SKIP
|
60
76
|
|
61
77
|
# Add additional model properties to the instance.
|
62
78
|
additional_properties.each do |_name, _value|
|
@@ -76,6 +92,16 @@ module AdvancedBilling
|
|
76
92
|
hash.key?('send_invite_link_text') ? hash['send_invite_link_text'] : SKIP
|
77
93
|
uninvited_count =
|
78
94
|
hash.key?('uninvited_count') ? hash['uninvited_count'] : SKIP
|
95
|
+
last_invite_sent_at = if hash.key?('last_invite_sent_at')
|
96
|
+
(DateTimeHelper.from_rfc3339(hash['last_invite_sent_at']) if hash['last_invite_sent_at'])
|
97
|
+
else
|
98
|
+
SKIP
|
99
|
+
end
|
100
|
+
last_invite_accepted_at = if hash.key?('last_invite_accepted_at')
|
101
|
+
(DateTimeHelper.from_rfc3339(hash['last_invite_accepted_at']) if hash['last_invite_accepted_at'])
|
102
|
+
else
|
103
|
+
SKIP
|
104
|
+
end
|
79
105
|
|
80
106
|
# Clean out expected properties from Hash.
|
81
107
|
names.each_value { |k| hash.delete(k) }
|
@@ -85,7 +111,17 @@ module AdvancedBilling
|
|
85
111
|
last_accepted_at: last_accepted_at,
|
86
112
|
send_invite_link_text: send_invite_link_text,
|
87
113
|
uninvited_count: uninvited_count,
|
114
|
+
last_invite_sent_at: last_invite_sent_at,
|
115
|
+
last_invite_accepted_at: last_invite_accepted_at,
|
88
116
|
additional_properties: hash)
|
89
117
|
end
|
118
|
+
|
119
|
+
def to_custom_last_invite_sent_at
|
120
|
+
DateTimeHelper.to_rfc3339(last_invite_sent_at)
|
121
|
+
end
|
122
|
+
|
123
|
+
def to_custom_last_invite_accepted_at
|
124
|
+
DateTimeHelper.to_rfc3339(last_invite_accepted_at)
|
125
|
+
end
|
90
126
|
end
|
91
127
|
end
|