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.
Files changed (129) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +45 -45
  3. data/lib/advanced_billing/configuration.rb +2 -2
  4. data/lib/advanced_billing/controllers/advance_invoice_controller.rb +27 -27
  5. data/lib/advanced_billing/controllers/api_exports_controller.rb +66 -66
  6. data/lib/advanced_billing/controllers/base_controller.rb +10 -10
  7. data/lib/advanced_billing/controllers/billing_portal_controller.rb +37 -36
  8. data/lib/advanced_billing/controllers/component_price_points_controller.rb +71 -71
  9. data/lib/advanced_billing/controllers/components_controller.rb +122 -119
  10. data/lib/advanced_billing/controllers/coupons_controller.rb +103 -103
  11. data/lib/advanced_billing/controllers/custom_fields_controller.rb +85 -85
  12. data/lib/advanced_billing/controllers/customers_controller.rb +52 -48
  13. data/lib/advanced_billing/controllers/events_based_billing_segments_controller.rb +59 -59
  14. data/lib/advanced_billing/controllers/events_controller.rb +19 -18
  15. data/lib/advanced_billing/controllers/insights_controller.rb +21 -21
  16. data/lib/advanced_billing/controllers/invoices_controller.rb +116 -116
  17. data/lib/advanced_billing/controllers/offers_controller.rb +23 -20
  18. data/lib/advanced_billing/controllers/payment_profiles_controller.rb +119 -116
  19. data/lib/advanced_billing/controllers/product_families_controller.rb +30 -30
  20. data/lib/advanced_billing/controllers/product_price_points_controller.rb +73 -73
  21. data/lib/advanced_billing/controllers/products_controller.rb +43 -43
  22. data/lib/advanced_billing/controllers/proforma_invoices_controller.rb +70 -70
  23. data/lib/advanced_billing/controllers/reason_codes_controller.rb +40 -40
  24. data/lib/advanced_billing/controllers/referral_codes_controller.rb +10 -9
  25. data/lib/advanced_billing/controllers/sales_commissions_controller.rb +16 -16
  26. data/lib/advanced_billing/controllers/sites_controller.rb +14 -13
  27. data/lib/advanced_billing/controllers/subscription_components_controller.rb +187 -178
  28. data/lib/advanced_billing/controllers/subscription_group_invoice_account_controller.rb +27 -27
  29. data/lib/advanced_billing/controllers/subscription_group_status_controller.rb +25 -25
  30. data/lib/advanced_billing/controllers/subscription_groups_controller.rb +63 -63
  31. data/lib/advanced_billing/controllers/subscription_invoice_account_controller.rb +43 -43
  32. data/lib/advanced_billing/controllers/subscription_notes_controller.rb +25 -21
  33. data/lib/advanced_billing/controllers/subscription_products_controller.rb +22 -20
  34. data/lib/advanced_billing/controllers/subscription_status_controller.rb +84 -84
  35. data/lib/advanced_billing/controllers/subscriptions_controller.rb +175 -172
  36. data/lib/advanced_billing/controllers/webhooks_controller.rb +51 -50
  37. data/lib/advanced_billing/exceptions/component_allocation_error_exception.rb +15 -15
  38. data/lib/advanced_billing/exceptions/component_price_point_error_exception.rb +15 -15
  39. data/lib/advanced_billing/exceptions/customer_error_response_exception.rb +15 -15
  40. data/lib/advanced_billing/exceptions/error_array_map_response_exception.rb +15 -15
  41. data/lib/advanced_billing/exceptions/error_list_response_exception.rb +15 -15
  42. data/lib/advanced_billing/exceptions/error_string_map_response_exception.rb +15 -15
  43. data/lib/advanced_billing/exceptions/event_based_billing_list_segments_errors_exception.rb +15 -15
  44. data/lib/advanced_billing/exceptions/event_based_billing_segment_errors_exception.rb +15 -15
  45. data/lib/advanced_billing/exceptions/event_based_billing_segment_exception.rb +15 -15
  46. data/lib/advanced_billing/exceptions/product_price_point_error_response_exception.rb +15 -15
  47. data/lib/advanced_billing/exceptions/proforma_bad_request_error_response_exception.rb +15 -15
  48. data/lib/advanced_billing/exceptions/refund_prepayment_base_errors_response_exception.rb +15 -15
  49. data/lib/advanced_billing/exceptions/single_error_response_exception.rb +15 -15
  50. data/lib/advanced_billing/exceptions/single_string_error_response_exception.rb +15 -15
  51. data/lib/advanced_billing/exceptions/subscription_add_coupon_error_exception.rb +15 -15
  52. data/lib/advanced_billing/exceptions/subscription_component_allocation_error_exception.rb +15 -15
  53. data/lib/advanced_billing/exceptions/subscription_group_create_error_response_exception.rb +15 -15
  54. data/lib/advanced_billing/exceptions/subscription_group_signup_error_response_exception.rb +15 -15
  55. data/lib/advanced_billing/exceptions/subscription_group_update_error_response_exception.rb +15 -15
  56. data/lib/advanced_billing/exceptions/subscription_remove_coupon_errors_exception.rb +15 -15
  57. data/lib/advanced_billing/exceptions/subscriptions_mrr_error_response_exception.rb +15 -15
  58. data/lib/advanced_billing/exceptions/too_many_management_link_requests_error_exception.rb +15 -15
  59. data/lib/advanced_billing/models/activate_event_based_component.rb +84 -0
  60. data/lib/advanced_billing/models/{current_vault.rb → all_vaults.rb} +28 -7
  61. data/lib/advanced_billing/models/allocation.rb +1 -0
  62. data/lib/advanced_billing/models/allocation_preview_item.rb +1 -0
  63. data/lib/advanced_billing/models/apple_pay_payment_profile.rb +232 -0
  64. data/lib/advanced_billing/models/apple_pay_vault.rb +20 -0
  65. data/lib/advanced_billing/models/bank_account_attributes.rb +2 -0
  66. data/lib/advanced_billing/models/bank_account_payment_profile.rb +25 -20
  67. data/lib/advanced_billing/models/bank_account_vault.rb +19 -9
  68. data/lib/advanced_billing/models/cancellation_method.rb +4 -1
  69. data/lib/advanced_billing/models/change_invoice_status_event_data.rb +6 -6
  70. data/lib/advanced_billing/models/component.rb +1 -0
  71. data/lib/advanced_billing/models/component_custom_price.rb +33 -14
  72. data/lib/advanced_billing/models/component_price_point_item.rb +3 -1
  73. data/lib/advanced_billing/models/create_component_price_point.rb +3 -1
  74. data/lib/advanced_billing/models/create_customer.rb +11 -1
  75. data/lib/advanced_billing/models/create_metafield.rb +2 -1
  76. data/lib/advanced_billing/models/create_or_update_product.rb +7 -4
  77. data/lib/advanced_billing/models/create_payment_profile.rb +1 -1
  78. data/lib/advanced_billing/models/create_prepaid_usage_component_price_point.rb +6 -5
  79. data/lib/advanced_billing/models/create_product_price_point.rb +5 -3
  80. data/lib/advanced_billing/models/create_subscription.rb +27 -25
  81. data/lib/advanced_billing/models/credit_card_payment_profile.rb +17 -16
  82. data/lib/advanced_billing/models/credit_card_vault.rb +117 -0
  83. data/lib/advanced_billing/models/credit_note.rb +2 -2
  84. data/lib/advanced_billing/models/customer.rb +11 -1
  85. data/lib/advanced_billing/models/customer_attributes.rb +12 -1
  86. data/lib/advanced_billing/models/ebb_component.rb +1 -0
  87. data/lib/advanced_billing/models/{extended_interval_unit.rb → expiration_interval_unit.rb} +4 -4
  88. data/lib/advanced_billing/models/full_subscription_group_response.rb +65 -50
  89. data/lib/advanced_billing/models/get_one_time_token_payment_profile.rb +1 -1
  90. data/lib/advanced_billing/models/invoice.rb +19 -9
  91. data/lib/advanced_billing/models/invoice_consolidation_level.rb +2 -2
  92. data/lib/advanced_billing/models/invoice_refund.rb +13 -1
  93. data/lib/advanced_billing/models/invoice_status.rb +2 -2
  94. data/lib/advanced_billing/models/invoice_tax.rb +29 -0
  95. data/lib/advanced_billing/models/invoice_tax_component_breakout.rb +101 -1
  96. data/lib/advanced_billing/models/issue_invoice_event_data.rb +6 -6
  97. data/lib/advanced_billing/models/list_products_filter.rb +12 -2
  98. data/lib/advanced_billing/models/metered_component.rb +4 -3
  99. data/lib/advanced_billing/models/offer_item.rb +3 -1
  100. data/lib/advanced_billing/models/on_off_component.rb +3 -2
  101. data/lib/advanced_billing/models/paid_invoice.rb +2 -2
  102. data/lib/advanced_billing/models/pay_pal_vault.rb +29 -0
  103. data/lib/advanced_billing/models/payment_profile_attributes.rb +5 -5
  104. data/lib/advanced_billing/models/payment_profile_response.rb +3 -3
  105. data/lib/advanced_billing/models/payment_type.rb +4 -1
  106. data/lib/advanced_billing/models/paypal_payment_profile.rb +242 -0
  107. data/lib/advanced_billing/models/prepaid_usage_component.rb +5 -4
  108. data/lib/advanced_billing/models/product.rb +2 -2
  109. data/lib/advanced_billing/models/product_price_point.rb +2 -2
  110. data/lib/advanced_billing/models/proforma_invoice.rb +6 -6
  111. data/lib/advanced_billing/models/quantity_based_component.rb +4 -3
  112. data/lib/advanced_billing/models/refund_invoice_event_data.rb +4 -4
  113. data/lib/advanced_billing/models/resent_invitation.rb +36 -0
  114. data/lib/advanced_billing/models/subscription.rb +13 -10
  115. data/lib/advanced_billing/models/subscription_component.rb +1 -0
  116. data/lib/advanced_billing/models/subscription_component_subscription.rb +26 -20
  117. data/lib/advanced_billing/models/subscription_custom_price.rb +5 -2
  118. data/lib/advanced_billing/models/subscription_group_bank_account.rb +2 -0
  119. data/lib/advanced_billing/models/subscription_group_credit_card.rb +1 -1
  120. data/lib/advanced_billing/models/subscription_group_signup_response.rb +39 -30
  121. data/lib/advanced_billing/models/subscription_state.rb +30 -30
  122. data/lib/advanced_billing/models/tax_configuration.rb +1 -2
  123. data/lib/advanced_billing/models/update_component_price_point.rb +3 -1
  124. data/lib/advanced_billing/models/update_customer.rb +12 -1
  125. data/lib/advanced_billing/models/update_payment_profile.rb +1 -1
  126. data/lib/advanced_billing/utilities/file_wrapper.rb +9 -9
  127. data/lib/advanced_billing/utilities/union_type_lookup.rb +17 -3
  128. data/lib/advanced_billing.rb +10 -4
  129. metadata +16 -10
@@ -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
@@ -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-chargify.zendesk.com/hc/en-us/articles/54055051410
51
- # 05) settings to have a Final Action of `mark the subscription unpaid`.
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-chargify.zendesk.com/hc/en-us/articles/54055051410
57
- # 05) process without payment. See the
58
- # [Reactivation](https://maxio-chargify.zendesk.com/hc/en-us/articles/540455
59
- # 9291021) documentation for info on how to restart a canceled subscription.
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-chargify.zendesk.com/hc/en-us/articles/5405246782221
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-chargify.zendesk.com/hc/en-us/articles/5404222005773
85
- # ) for more info about subscription states and state transitions.
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
 
@@ -279,6 +279,7 @@ module AdvancedBilling
279
279
  price_point_name
280
280
  use_site_exchange_rate
281
281
  description
282
+ interval_unit
282
283
  ]
283
284
  end
284
285
 
@@ -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-chargify.zendesk.com/hc/en-us/articles/54055051410
48
- # 05) settings to have a Final Action of `mark the subscription unpaid`.
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-chargify.zendesk.com/hc/en-us/articles/54055051410
54
- # 05) process without payment. See the
55
- # [Reactivation](https://maxio-chargify.zendesk.com/hc/en-us/articles/540455
56
- # 9291021) documentation for info on how to restart a canceled subscription.
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-chargify.zendesk.com/hc/en-us/articles/5405246782221
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-chargify.zendesk.com/hc/en-us/articles/5404222005773
82
- # ) for more info about subscription states and state transitions.
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-chargify.zendesk.com/hc/en-us/articles/54055051410
120
- # 05) settings to have a Final Action of `mark the subscription unpaid`.
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-chargify.zendesk.com/hc/en-us/articles/54055051410
126
- # 05) process without payment. See the
127
- # [Reactivation](https://maxio-chargify.zendesk.com/hc/en-us/articles/540455
128
- # 9291021) documentation for info on how to restart a canceled subscription.
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-chargify.zendesk.com/hc/en-us/articles/5405246782221
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-chargify.zendesk.com/hc/en-us/articles/5404222005773
154
- # ) for more info about subscription states and state transitions.
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 [IntervalUnit]
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 [CurrentVault]
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-chargify.zendesk.com/hc/en-us/articles/54055051410
75
- # 05) settings to have a Final Action of `mark the subscription unpaid`.
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-chargify.zendesk.com/hc/en-us/articles/54055051410
81
- # 05) process without payment. See the
82
- # [Reactivation](https://maxio-chargify.zendesk.com/hc/en-us/articles/540455
83
- # 9291021) documentation for info on how to restart a canceled subscription.
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-chargify.zendesk.com/hc/en-us/articles/5405246782221
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-chargify.zendesk.com/hc/en-us/articles/5404222005773
109
- # ) for more info about subscription states and state transitions.
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-chargify.zendesk.com/hc/en-us/articles/54055051410
147
- # 05) settings to have a Final Action of `mark the subscription unpaid`.
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-chargify.zendesk.com/hc/en-us/articles/54055051410
153
- # 05) process without payment. See the
154
- # [Reactivation](https://maxio-chargify.zendesk.com/hc/en-us/articles/540455
155
- # 9291021) documentation for info on how to restart a canceled subscription.
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-chargify.zendesk.com/hc/en-us/articles/5405246782221
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-chargify.zendesk.com/hc/en-us/articles/5404222005773
181
- # ) for more info about subscription states and state transitions.
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-chargify.zendesk.com/hc/en-us/articles/54055051410
219
- # 05) settings to have a Final Action of `mark the subscription unpaid`.
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-chargify.zendesk.com/hc/en-us/articles/54055051410
225
- # 05) process without payment. See the
226
- # [Reactivation](https://maxio-chargify.zendesk.com/hc/en-us/articles/540455
227
- # 9291021) documentation for info on how to restart a canceled subscription.
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-chargify.zendesk.com/hc/en-us/articles/5405246782221
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-chargify.zendesk.com/hc/en-us/articles/5404222005773
253
- # ) for more info about subscription states and state transitions.
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-chargify.zendesk.com/hc/en-us/articles/5405505141005
35
- # ) settings to have a Final Action of `mark the subscription unpaid`. * **End
36
- # of Life States** * `canceled` - Indicates a canceled subscription. This
37
- # may happen at your request (via the API or the web interface) or due to the
38
- # expiration of the
39
- # [Dunning](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405505141005
40
- # ) process without payment. See the
41
- # [Reactivation](https://maxio-chargify.zendesk.com/hc/en-us/articles/54045592
42
- # 91021) documentation for info on how to restart a canceled subscription.
43
- # While a subscription is canceled, its period will not advance, it will not
44
- # accrue any new charges, and Advanced Billing will not attempt to collect the
45
- # overdue balance. * `expired` - Indicates a subscription that has expired
46
- # due to running its normal life cycle. Some products may be configured to
47
- # have an expiration period. An expired subscription then is one that stayed
48
- # active until it fulfilled its full period. * `failed_to_create` -
49
- # Indicates that signup has failed. (You may see this state in a
50
- # signup_failure webhook.) * `on_hold` - Indicates that a subscription’s
51
- # billing has been temporarily stopped. While it is expected that the
52
- # subscription will resume and return to active status, this is still treated
53
- # as an “End of Life” state because the customer is not paying for services
54
- # during this time. * `suspended` - Indicates that a prepaid subscription
55
- # has used up all their prepayment balance. If a prepayment is applied, it
56
- # will return to an active state. * `trial_ended` - A subscription in a
57
- # trial_ended state is a subscription that completed a no-obligation trial and
58
- # did not have a card on file at the expiration of the trial period. See
59
- # [Product Pricing – No Obligation
60
- # Trials](https://maxio-chargify.zendesk.com/hc/en-us/articles/5405246782221)
61
- # for more details. See [Subscription
62
- # States](https://maxio-chargify.zendesk.com/hc/en-us/articles/5404222005773)
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-chargify.zendesk.com/hc/en-us/articles/5405488905869-Taxes-I
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
 
@@ -81,7 +81,9 @@ module AdvancedBilling
81
81
 
82
82
  # An array for nullable fields
83
83
  def self.nullables
84
- []
84
+ %w[
85
+ interval_unit
86
+ ]
85
87
  end
86
88
 
87
89
  def initialize(name: SKIP, handle: SKIP, pricing_scheme: SKIP,
@@ -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, additional_properties: {})
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 [CurrentVault]
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
- :PaymentProfileResponsePaymentProfile => OneOf.new(
693
+ :PaymentProfile => AnyOf.new(
694
694
  [
695
- LeafType.new(BankAccountPaymentProfile),
696
- LeafType.new(CreditCardPaymentProfile)
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