maxio-advanced-billing-sdk 7.0.1 → 8.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 +94 -44
- data/bin/console +15 -0
- data/lib/advanced_billing/client.rb +11 -0
- data/lib/advanced_billing/configuration.rb +73 -0
- data/lib/advanced_billing/controllers/advance_invoice_controller.rb +2 -2
- data/lib/advanced_billing/controllers/base_controller.rb +1 -1
- data/lib/advanced_billing/controllers/billing_portal_controller.rb +2 -2
- data/lib/advanced_billing/controllers/component_price_points_controller.rb +2 -2
- data/lib/advanced_billing/controllers/components_controller.rb +5 -5
- data/lib/advanced_billing/controllers/coupons_controller.rb +5 -11
- data/lib/advanced_billing/controllers/custom_fields_controller.rb +102 -128
- data/lib/advanced_billing/controllers/customers_controller.rb +4 -4
- data/lib/advanced_billing/controllers/invoices_controller.rb +48 -11
- data/lib/advanced_billing/controllers/payment_profiles_controller.rb +70 -243
- data/lib/advanced_billing/controllers/product_families_controller.rb +7 -8
- data/lib/advanced_billing/controllers/product_price_points_controller.rb +15 -17
- data/lib/advanced_billing/controllers/products_controller.rb +7 -8
- data/lib/advanced_billing/controllers/proforma_invoices_controller.rb +1 -1
- data/lib/advanced_billing/controllers/sales_commissions_controller.rb +3 -3
- data/lib/advanced_billing/controllers/subscription_components_controller.rb +24 -33
- data/lib/advanced_billing/controllers/subscription_group_status_controller.rb +9 -9
- data/lib/advanced_billing/controllers/subscription_groups_controller.rb +10 -5
- data/lib/advanced_billing/controllers/subscription_invoice_account_controller.rb +1 -1
- data/lib/advanced_billing/controllers/subscription_products_controller.rb +6 -7
- data/lib/advanced_billing/controllers/subscription_status_controller.rb +6 -7
- data/lib/advanced_billing/controllers/subscriptions_controller.rb +86 -808
- data/lib/advanced_billing/http/auth/basic_auth.rb +12 -0
- data/lib/advanced_billing/http/proxy_settings.rb +9 -0
- data/lib/advanced_billing/models/activate_event_based_component.rb +1 -2
- data/lib/advanced_billing/models/all_vaults.rb +45 -0
- data/lib/advanced_billing/models/allocation_preview_direction.rb +13 -0
- data/lib/advanced_billing/models/allocation_preview_line_item_kind.rb +15 -0
- data/lib/advanced_billing/models/apple_pay_vault.rb +6 -0
- data/lib/advanced_billing/models/auto_invite.rb +19 -0
- data/lib/advanced_billing/models/bank_account_holder_type.rb +13 -0
- data/lib/advanced_billing/models/bank_account_type.rb +13 -0
- data/lib/advanced_billing/models/bank_account_vault.rb +19 -0
- data/lib/advanced_billing/models/basic_date_field.rb +13 -0
- data/lib/advanced_billing/models/billing_manifest_line_item_kind.rb +17 -0
- data/lib/advanced_billing/models/billing_schedule.rb +2 -2
- data/lib/advanced_billing/models/calendar_billing.rb +3 -1
- data/lib/advanced_billing/models/cancellation_method.rb +17 -0
- data/lib/advanced_billing/models/card_type.rb +47 -0
- data/lib/advanced_billing/models/chargeback_status.rb +15 -0
- data/lib/advanced_billing/models/chargify_ebb.rb +4 -4
- data/lib/advanced_billing/models/cleanup_scope.rb +13 -0
- data/lib/advanced_billing/models/collection_method.rb +15 -0
- data/lib/advanced_billing/models/component.rb +31 -31
- data/lib/advanced_billing/models/component_custom_price.rb +61 -3
- data/lib/advanced_billing/models/component_kind.rb +16 -0
- data/lib/advanced_billing/models/compounding_strategy.rb +13 -0
- data/lib/advanced_billing/models/create_allocation.rb +1 -2
- data/lib/advanced_billing/models/create_invoice_coupon.rb +16 -7
- data/lib/advanced_billing/models/create_invoice_item.rb +5 -5
- data/lib/advanced_billing/models/create_invoice_status.rb +13 -0
- data/lib/advanced_billing/models/create_metafield.rb +3 -5
- data/lib/advanced_billing/models/create_or_update_product.rb +12 -7
- data/lib/advanced_billing/models/create_payment_profile.rb +6 -6
- data/lib/advanced_billing/models/create_prepayment_method.rb +19 -0
- data/lib/advanced_billing/models/create_product_price_point.rb +8 -3
- data/lib/advanced_billing/models/create_signup_proforma_preview_include.rb +6 -0
- data/lib/advanced_billing/models/create_usage.rb +17 -7
- data/lib/advanced_billing/models/credit_card_vault.rb +44 -0
- data/lib/advanced_billing/models/credit_note_status.rb +13 -0
- data/lib/advanced_billing/models/credit_scheme.rb +14 -0
- data/lib/advanced_billing/models/credit_type.rb +14 -0
- data/lib/advanced_billing/models/currency_price_role.rb +14 -0
- data/lib/advanced_billing/models/custom_field_owner.rb +13 -0
- data/lib/advanced_billing/models/debit_note_role.rb +13 -0
- data/lib/advanced_billing/models/debit_note_status.rb +15 -0
- data/lib/advanced_billing/models/direction.rb +13 -0
- data/lib/advanced_billing/models/discount_type.rb +13 -0
- data/lib/advanced_billing/models/ebb_component.rb +2 -2
- data/lib/advanced_billing/models/event_key.rb +91 -0
- data/lib/advanced_billing/models/expiration_interval_unit.rb +14 -0
- data/lib/advanced_billing/models/failed_payment_action.rb +14 -0
- data/lib/advanced_billing/models/first_charge_type.rb +14 -0
- data/lib/advanced_billing/models/group_target_type.rb +16 -0
- data/lib/advanced_billing/models/group_type.rb +13 -0
- data/lib/advanced_billing/models/include_not_null.rb +6 -0
- data/lib/advanced_billing/models/include_null_or_not_null.rb +13 -0
- data/lib/advanced_billing/models/include_option.rb +13 -0
- data/lib/advanced_billing/models/interval_unit.rb +13 -0
- data/lib/advanced_billing/models/invoice_consolidation_level.rb +14 -0
- data/lib/advanced_billing/models/invoice_date_field.rb +16 -0
- data/lib/advanced_billing/models/invoice_discount_source_type.rb +14 -0
- data/lib/advanced_billing/models/invoice_discount_type.rb +14 -0
- data/lib/advanced_billing/models/invoice_event_payment_method.rb +16 -0
- data/lib/advanced_billing/models/invoice_event_type.rb +26 -0
- data/lib/advanced_billing/models/invoice_payment_method_type.rb +17 -0
- data/lib/advanced_billing/models/invoice_payment_type.rb +15 -0
- data/lib/advanced_billing/models/invoice_role.rb +21 -0
- data/lib/advanced_billing/models/invoice_sort_field.rb +19 -0
- data/lib/advanced_billing/models/invoice_status.rb +18 -0
- data/lib/advanced_billing/models/item_category.rb +16 -0
- data/lib/advanced_billing/models/line_item_kind.rb +21 -0
- data/lib/advanced_billing/models/line_item_transaction_type.rb +18 -0
- data/lib/advanced_billing/models/list_components_price_points_include.rb +6 -0
- data/lib/advanced_billing/models/list_coupons_filter.rb +22 -6
- data/lib/advanced_billing/models/list_events_date_field.rb +6 -0
- data/lib/advanced_billing/models/list_prepayment_date_field.rb +13 -0
- data/lib/advanced_billing/models/list_products_include.rb +6 -0
- data/lib/advanced_billing/models/list_products_price_points_include.rb +6 -0
- data/lib/advanced_billing/models/list_subscription_components_include.rb +13 -0
- data/lib/advanced_billing/models/list_subscription_components_sort.rb +13 -0
- data/lib/advanced_billing/models/metafield.rb +8 -11
- data/lib/advanced_billing/models/metafield_input.rb +18 -5
- data/lib/advanced_billing/models/metafield_scope.rb +9 -4
- data/lib/advanced_billing/models/metered_component.rb +2 -2
- data/lib/advanced_billing/models/nested_subscription_group.rb +10 -0
- data/lib/advanced_billing/models/on_off_component.rb +2 -2
- data/lib/advanced_billing/models/pay_pal_vault.rb +15 -0
- data/lib/advanced_billing/models/payment_profile_attributes.rb +3 -3
- data/lib/advanced_billing/models/payment_type.rb +15 -0
- data/lib/advanced_billing/models/prepaid_configuration.rb +10 -0
- data/lib/advanced_billing/models/prepaid_usage_component.rb +2 -2
- data/lib/advanced_billing/models/prepayment_method.rb +18 -0
- data/lib/advanced_billing/models/price_point_type.rb +14 -0
- data/lib/advanced_billing/models/pricing_scheme.rb +15 -0
- data/lib/advanced_billing/models/product.rb +18 -8
- data/lib/advanced_billing/models/product_family.rb +10 -0
- data/lib/advanced_billing/models/product_price_point.rb +8 -3
- data/lib/advanced_billing/models/proforma_invoice_discount_source_type.rb +13 -0
- data/lib/advanced_billing/models/proforma_invoice_role.rb +15 -0
- data/lib/advanced_billing/models/proforma_invoice_status.rb +14 -0
- data/lib/advanced_billing/models/proforma_invoice_tax_source_type.rb +13 -0
- data/lib/advanced_billing/models/public_signup_page.rb +10 -0
- data/lib/advanced_billing/models/quantity_based_component.rb +2 -2
- data/lib/advanced_billing/models/reactivation_charge.rb +14 -0
- data/lib/advanced_billing/models/recurring_scheme.rb +14 -0
- data/lib/advanced_billing/models/resource_type.rb +13 -0
- data/lib/advanced_billing/models/restriction_type.rb +13 -0
- data/lib/advanced_billing/models/resume_options.rb +1 -1
- data/lib/advanced_billing/models/resumption_charge.rb +14 -0
- data/lib/advanced_billing/models/service_credit_type.rb +13 -0
- data/lib/advanced_billing/models/snap_day.rb +7 -2
- data/lib/advanced_billing/models/sorting_direction.rb +13 -0
- data/lib/advanced_billing/models/subscription.rb +16 -3
- data/lib/advanced_billing/models/subscription_custom_price.rb +23 -7
- data/lib/advanced_billing/models/subscription_date_field.rb +20 -0
- data/lib/advanced_billing/models/subscription_group_include.rb +6 -0
- data/lib/advanced_billing/models/subscription_group_prepayment_method.rb +17 -0
- data/lib/advanced_billing/models/subscription_groups_list_include.rb +6 -0
- data/lib/advanced_billing/models/subscription_include.rb +13 -0
- data/lib/advanced_billing/models/subscription_included_coupon.rb +10 -0
- data/lib/advanced_billing/models/subscription_list_date_field.rb +6 -0
- data/lib/advanced_billing/models/subscription_list_include.rb +6 -0
- data/lib/advanced_billing/models/subscription_purge_type.rb +13 -0
- data/lib/advanced_billing/models/subscription_sort.rb +17 -0
- data/lib/advanced_billing/models/subscription_state.rb +26 -0
- data/lib/advanced_billing/models/subscription_state_filter.rb +23 -0
- data/lib/advanced_billing/models/tax_configuration_kind.rb +15 -0
- data/lib/advanced_billing/models/tax_destination_address.rb +15 -0
- data/lib/advanced_billing/models/trial_type.rb +41 -0
- data/lib/advanced_billing/models/update_component.rb +2 -2
- data/lib/advanced_billing/models/update_metafield.rb +4 -6
- data/lib/advanced_billing/models/update_payment_profile.rb +3 -3
- data/lib/advanced_billing/models/update_subscription.rb +1 -0
- data/lib/advanced_billing/models/webhook_order.rb +13 -0
- data/lib/advanced_billing/models/webhook_status.rb +15 -0
- data/lib/advanced_billing/models/webhook_subscription.rb +46 -0
- data/lib/advanced_billing/utilities/union_type_lookup.rb +18 -5
- data/lib/advanced_billing.rb +1 -0
- metadata +8 -6
|
@@ -22,5 +22,19 @@ module AdvancedBilling
|
|
|
22
22
|
|
|
23
23
|
CURRENCY_PRICE_ROLE.include?(value)
|
|
24
24
|
end
|
|
25
|
+
|
|
26
|
+
def self.from_value(value, default_value = BASELINE)
|
|
27
|
+
return default_value if value.nil?
|
|
28
|
+
|
|
29
|
+
str = value.to_s.strip
|
|
30
|
+
|
|
31
|
+
case str.downcase
|
|
32
|
+
when 'baseline' then BASELINE
|
|
33
|
+
when 'trial' then TRIAL
|
|
34
|
+
when 'initial' then INITIAL
|
|
35
|
+
else
|
|
36
|
+
default_value
|
|
37
|
+
end
|
|
38
|
+
end
|
|
25
39
|
end
|
|
26
40
|
end
|
|
@@ -19,5 +19,18 @@ module AdvancedBilling
|
|
|
19
19
|
|
|
20
20
|
CUSTOM_FIELD_OWNER.include?(value)
|
|
21
21
|
end
|
|
22
|
+
|
|
23
|
+
def self.from_value(value, default_value = CUSTOMER)
|
|
24
|
+
return default_value if value.nil?
|
|
25
|
+
|
|
26
|
+
str = value.to_s.strip
|
|
27
|
+
|
|
28
|
+
case str.downcase
|
|
29
|
+
when 'customer' then CUSTOMER
|
|
30
|
+
when 'subscription' then SUBSCRIPTION
|
|
31
|
+
else
|
|
32
|
+
default_value
|
|
33
|
+
end
|
|
34
|
+
end
|
|
22
35
|
end
|
|
23
36
|
end
|
|
@@ -19,5 +19,18 @@ module AdvancedBilling
|
|
|
19
19
|
|
|
20
20
|
DEBIT_NOTE_ROLE.include?(value)
|
|
21
21
|
end
|
|
22
|
+
|
|
23
|
+
def self.from_value(value, default_value = CHARGEBACK)
|
|
24
|
+
return default_value if value.nil?
|
|
25
|
+
|
|
26
|
+
str = value.to_s.strip
|
|
27
|
+
|
|
28
|
+
case str.downcase
|
|
29
|
+
when 'chargeback' then CHARGEBACK
|
|
30
|
+
when 'refund' then REFUND
|
|
31
|
+
else
|
|
32
|
+
default_value
|
|
33
|
+
end
|
|
34
|
+
end
|
|
22
35
|
end
|
|
23
36
|
end
|
|
@@ -25,5 +25,20 @@ module AdvancedBilling
|
|
|
25
25
|
|
|
26
26
|
DEBIT_NOTE_STATUS.include?(value)
|
|
27
27
|
end
|
|
28
|
+
|
|
29
|
+
def self.from_value(value, default_value = OPEN)
|
|
30
|
+
return default_value if value.nil?
|
|
31
|
+
|
|
32
|
+
str = value.to_s.strip
|
|
33
|
+
|
|
34
|
+
case str.downcase
|
|
35
|
+
when 'open' then OPEN
|
|
36
|
+
when 'applied' then APPLIED
|
|
37
|
+
when 'banished' then BANISHED
|
|
38
|
+
when 'paid' then PAID
|
|
39
|
+
else
|
|
40
|
+
default_value
|
|
41
|
+
end
|
|
42
|
+
end
|
|
28
43
|
end
|
|
29
44
|
end
|
|
@@ -19,5 +19,18 @@ module AdvancedBilling
|
|
|
19
19
|
|
|
20
20
|
DIRECTION.include?(value)
|
|
21
21
|
end
|
|
22
|
+
|
|
23
|
+
def self.from_value(value, default_value = ASC)
|
|
24
|
+
return default_value if value.nil?
|
|
25
|
+
|
|
26
|
+
str = value.to_s.strip
|
|
27
|
+
|
|
28
|
+
case str.downcase
|
|
29
|
+
when 'asc' then ASC
|
|
30
|
+
when 'desc' then DESC
|
|
31
|
+
else
|
|
32
|
+
default_value
|
|
33
|
+
end
|
|
34
|
+
end
|
|
22
35
|
end
|
|
23
36
|
end
|
|
@@ -19,5 +19,18 @@ module AdvancedBilling
|
|
|
19
19
|
|
|
20
20
|
DISCOUNT_TYPE.include?(value)
|
|
21
21
|
end
|
|
22
|
+
|
|
23
|
+
def self.from_value(value, default_value = AMOUNT)
|
|
24
|
+
return default_value if value.nil?
|
|
25
|
+
|
|
26
|
+
str = value.to_s.strip
|
|
27
|
+
|
|
28
|
+
case str.downcase
|
|
29
|
+
when 'amount' then AMOUNT
|
|
30
|
+
when 'percent' then PERCENT
|
|
31
|
+
else
|
|
32
|
+
default_value
|
|
33
|
+
end
|
|
34
|
+
end
|
|
22
35
|
end
|
|
23
36
|
end
|
|
@@ -66,8 +66,8 @@ module AdvancedBilling
|
|
|
66
66
|
attr_accessor :unit_price
|
|
67
67
|
|
|
68
68
|
# A string representing the tax code related to the component type. This is
|
|
69
|
-
# especially important when using
|
|
70
|
-
#
|
|
69
|
+
# especially important when using AvaTax to tax based on locale. This
|
|
70
|
+
# attribute has a max length of 25 characters.
|
|
71
71
|
# @return [String]
|
|
72
72
|
attr_accessor :tax_code
|
|
73
73
|
|
|
@@ -260,5 +260,96 @@ module AdvancedBilling
|
|
|
260
260
|
|
|
261
261
|
EVENT_KEY.include?(value)
|
|
262
262
|
end
|
|
263
|
+
|
|
264
|
+
def self.from_value(value, default_value = PAYMENT_SUCCESS)
|
|
265
|
+
return default_value if value.nil?
|
|
266
|
+
|
|
267
|
+
str = value.to_s.strip
|
|
268
|
+
|
|
269
|
+
case str.downcase
|
|
270
|
+
when 'payment_success' then PAYMENT_SUCCESS
|
|
271
|
+
when 'payment_failure' then PAYMENT_FAILURE
|
|
272
|
+
when 'signup_success' then SIGNUP_SUCCESS
|
|
273
|
+
when 'signup_failure' then SIGNUP_FAILURE
|
|
274
|
+
when 'delayed_signup_creation_success' then DELAYED_SIGNUP_CREATION_SUCCESS
|
|
275
|
+
when 'delayed_signup_creation_failure' then DELAYED_SIGNUP_CREATION_FAILURE
|
|
276
|
+
when 'billing_date_change' then BILLING_DATE_CHANGE
|
|
277
|
+
when 'expiration_date_change' then EXPIRATION_DATE_CHANGE
|
|
278
|
+
when 'renewal_success' then RENEWAL_SUCCESS
|
|
279
|
+
when 'renewal_failure' then RENEWAL_FAILURE
|
|
280
|
+
when 'subscription_state_change' then SUBSCRIPTION_STATE_CHANGE
|
|
281
|
+
when 'subscription_product_change' then SUBSCRIPTION_PRODUCT_CHANGE
|
|
282
|
+
when 'pending_cancellation_change' then PENDING_CANCELLATION_CHANGE
|
|
283
|
+
when 'expiring_card' then EXPIRING_CARD
|
|
284
|
+
when 'customer_update' then CUSTOMER_UPDATE
|
|
285
|
+
when 'customer_create' then CUSTOMER_CREATE
|
|
286
|
+
when 'customer_delete' then CUSTOMER_DELETE
|
|
287
|
+
when 'component_allocation_change' then COMPONENT_ALLOCATION_CHANGE
|
|
288
|
+
when 'metered_usage' then METERED_USAGE
|
|
289
|
+
when 'prepaid_usage' then PREPAID_USAGE
|
|
290
|
+
when 'upgrade_downgrade_success' then UPGRADE_DOWNGRADE_SUCCESS
|
|
291
|
+
when 'upgrade_downgrade_failure' then UPGRADE_DOWNGRADE_FAILURE
|
|
292
|
+
when 'statement_closed' then STATEMENT_CLOSED
|
|
293
|
+
when 'statement_settled' then STATEMENT_SETTLED
|
|
294
|
+
when 'subscription_card_update' then SUBSCRIPTION_CARD_UPDATE
|
|
295
|
+
when 'subscription_group_card_update' then SUBSCRIPTION_GROUP_CARD_UPDATE
|
|
296
|
+
when 'subscription_bank_account_update' then SUBSCRIPTION_BANK_ACCOUNT_UPDATE
|
|
297
|
+
when 'refund_success' then REFUND_SUCCESS
|
|
298
|
+
when 'refund_failure' then REFUND_FAILURE
|
|
299
|
+
when 'upcoming_renewal_notice' then UPCOMING_RENEWAL_NOTICE
|
|
300
|
+
when 'trial_end_notice' then TRIAL_END_NOTICE
|
|
301
|
+
when 'dunning_step_reached' then DUNNING_STEP_REACHED
|
|
302
|
+
when 'invoice_issued' then INVOICE_ISSUED
|
|
303
|
+
when 'prepaid_subscription_balance_changed' then PREPAID_SUBSCRIPTION_BALANCE_CHANGED
|
|
304
|
+
when 'subscription_group_signup_success' then SUBSCRIPTION_GROUP_SIGNUP_SUCCESS
|
|
305
|
+
when 'subscription_group_signup_failure' then SUBSCRIPTION_GROUP_SIGNUP_FAILURE
|
|
306
|
+
when 'direct_debit_payment_paid_out' then DIRECT_DEBIT_PAYMENT_PAID_OUT
|
|
307
|
+
when 'direct_debit_payment_rejected' then DIRECT_DEBIT_PAYMENT_REJECTED
|
|
308
|
+
when 'direct_debit_payment_pending' then DIRECT_DEBIT_PAYMENT_PENDING
|
|
309
|
+
when 'pending_payment_created' then PENDING_PAYMENT_CREATED
|
|
310
|
+
when 'pending_payment_failed' then PENDING_PAYMENT_FAILED
|
|
311
|
+
when 'pending_payment_completed' then PENDING_PAYMENT_COMPLETED
|
|
312
|
+
when 'proforma_invoice_issued' then PROFORMA_INVOICE_ISSUED
|
|
313
|
+
when 'subscription_prepayment_account_balance_changed' then SUBSCRIPTION_PREPAYMENT_ACCOUNT_BALANCE_CHANGED
|
|
314
|
+
when 'subscription_service_credit_account_balance_changed' then SUBSCRIPTION_SERVICE_CREDIT_ACCOUNT_BALANCE_CHANGED
|
|
315
|
+
when 'custom_field_value_change' then CUSTOM_FIELD_VALUE_CHANGE
|
|
316
|
+
when 'item_price_point_changed' then ITEM_PRICE_POINT_CHANGED
|
|
317
|
+
when 'renewal_success_recreated' then RENEWAL_SUCCESS_RECREATED
|
|
318
|
+
when 'renewal_failure_recreated' then RENEWAL_FAILURE_RECREATED
|
|
319
|
+
when 'payment_success_recreated' then PAYMENT_SUCCESS_RECREATED
|
|
320
|
+
when 'payment_failure_recreated' then PAYMENT_FAILURE_RECREATED
|
|
321
|
+
when 'subscription_deletion' then SUBSCRIPTION_DELETION
|
|
322
|
+
when 'subscription_group_bank_account_update' then SUBSCRIPTION_GROUP_BANK_ACCOUNT_UPDATE
|
|
323
|
+
when 'subscription_paypal_account_update' then SUBSCRIPTION_PAYPAL_ACCOUNT_UPDATE
|
|
324
|
+
when 'subscription_group_paypal_account_update' then SUBSCRIPTION_GROUP_PAYPAL_ACCOUNT_UPDATE
|
|
325
|
+
when 'subscription_customer_change' then SUBSCRIPTION_CUSTOMER_CHANGE
|
|
326
|
+
when 'account_transaction_changed' then ACCOUNT_TRANSACTION_CHANGED
|
|
327
|
+
when 'go_cardless_payment_paid_out' then GO_CARDLESS_PAYMENT_PAID_OUT
|
|
328
|
+
when 'go_cardless_payment_rejected' then GO_CARDLESS_PAYMENT_REJECTED
|
|
329
|
+
when 'go_cardless_payment_pending' then GO_CARDLESS_PAYMENT_PENDING
|
|
330
|
+
when 'stripe_direct_debit_payment_paid_out' then STRIPE_DIRECT_DEBIT_PAYMENT_PAID_OUT
|
|
331
|
+
when 'stripe_direct_debit_payment_rejected' then STRIPE_DIRECT_DEBIT_PAYMENT_REJECTED
|
|
332
|
+
when 'stripe_direct_debit_payment_pending' then STRIPE_DIRECT_DEBIT_PAYMENT_PENDING
|
|
333
|
+
when 'maxio_payments_direct_debit_payment_paid_out' then MAXIO_PAYMENTS_DIRECT_DEBIT_PAYMENT_PAID_OUT
|
|
334
|
+
when 'maxio_payments_direct_debit_payment_rejected' then MAXIO_PAYMENTS_DIRECT_DEBIT_PAYMENT_REJECTED
|
|
335
|
+
when 'maxio_payments_direct_debit_payment_pending' then MAXIO_PAYMENTS_DIRECT_DEBIT_PAYMENT_PENDING
|
|
336
|
+
when 'invoice_in_collections_canceled' then INVOICE_IN_COLLECTIONS_CANCELED
|
|
337
|
+
when 'subscription_added_to_group' then SUBSCRIPTION_ADDED_TO_GROUP
|
|
338
|
+
when 'subscription_removed_from_group' then SUBSCRIPTION_REMOVED_FROM_GROUP
|
|
339
|
+
when 'chargeback_opened' then CHARGEBACK_OPENED
|
|
340
|
+
when 'chargeback_lost' then CHARGEBACK_LOST
|
|
341
|
+
when 'chargeback_accepted' then CHARGEBACK_ACCEPTED
|
|
342
|
+
when 'chargeback_closed' then CHARGEBACK_CLOSED
|
|
343
|
+
when 'chargeback_won' then CHARGEBACK_WON
|
|
344
|
+
when 'payment_collection_method_changed' then PAYMENT_COLLECTION_METHOD_CHANGED
|
|
345
|
+
when 'component_billing_date_changed' then COMPONENT_BILLING_DATE_CHANGED
|
|
346
|
+
when 'subscription_term_renewal_scheduled' then SUBSCRIPTION_TERM_RENEWAL_SCHEDULED
|
|
347
|
+
when 'subscription_term_renewal_pending' then SUBSCRIPTION_TERM_RENEWAL_PENDING
|
|
348
|
+
when 'subscription_term_renewal_activated' then SUBSCRIPTION_TERM_RENEWAL_ACTIVATED
|
|
349
|
+
when 'subscription_term_renewal_removed' then SUBSCRIPTION_TERM_RENEWAL_REMOVED
|
|
350
|
+
else
|
|
351
|
+
default_value
|
|
352
|
+
end
|
|
353
|
+
end
|
|
263
354
|
end
|
|
264
355
|
end
|
|
@@ -22,5 +22,19 @@ module AdvancedBilling
|
|
|
22
22
|
|
|
23
23
|
EXPIRATION_INTERVAL_UNIT.include?(value)
|
|
24
24
|
end
|
|
25
|
+
|
|
26
|
+
def self.from_value(value, default_value = DAY)
|
|
27
|
+
return default_value if value.nil?
|
|
28
|
+
|
|
29
|
+
str = value.to_s.strip
|
|
30
|
+
|
|
31
|
+
case str.downcase
|
|
32
|
+
when 'day' then DAY
|
|
33
|
+
when 'month' then MONTH
|
|
34
|
+
when 'never' then NEVER
|
|
35
|
+
else
|
|
36
|
+
default_value
|
|
37
|
+
end
|
|
38
|
+
end
|
|
25
39
|
end
|
|
26
40
|
end
|
|
@@ -33,5 +33,19 @@ module AdvancedBilling
|
|
|
33
33
|
|
|
34
34
|
FAILED_PAYMENT_ACTION.include?(value)
|
|
35
35
|
end
|
|
36
|
+
|
|
37
|
+
def self.from_value(value, default_value = LEAVE_OPEN_INVOICE)
|
|
38
|
+
return default_value if value.nil?
|
|
39
|
+
|
|
40
|
+
str = value.to_s.strip
|
|
41
|
+
|
|
42
|
+
case str.downcase
|
|
43
|
+
when 'leave_open_invoice' then LEAVE_OPEN_INVOICE
|
|
44
|
+
when 'rollback_to_pending' then ROLLBACK_TO_PENDING
|
|
45
|
+
when 'initiate_dunning' then INITIATE_DUNNING
|
|
46
|
+
else
|
|
47
|
+
default_value
|
|
48
|
+
end
|
|
49
|
+
end
|
|
36
50
|
end
|
|
37
51
|
end
|
|
@@ -22,5 +22,19 @@ module AdvancedBilling
|
|
|
22
22
|
|
|
23
23
|
FIRST_CHARGE_TYPE.include?(value)
|
|
24
24
|
end
|
|
25
|
+
|
|
26
|
+
def self.from_value(value, default_value = PRORATED)
|
|
27
|
+
return default_value if value.nil?
|
|
28
|
+
|
|
29
|
+
str = value.to_s.strip
|
|
30
|
+
|
|
31
|
+
case str.downcase
|
|
32
|
+
when 'prorated' then PRORATED
|
|
33
|
+
when 'immediate' then IMMEDIATE
|
|
34
|
+
when 'delayed' then DELAYED
|
|
35
|
+
else
|
|
36
|
+
default_value
|
|
37
|
+
end
|
|
38
|
+
end
|
|
25
39
|
end
|
|
26
40
|
end
|
|
@@ -28,5 +28,21 @@ module AdvancedBilling
|
|
|
28
28
|
|
|
29
29
|
GROUP_TARGET_TYPE.include?(value)
|
|
30
30
|
end
|
|
31
|
+
|
|
32
|
+
def self.from_value(value, default_value = CUSTOMER)
|
|
33
|
+
return default_value if value.nil?
|
|
34
|
+
|
|
35
|
+
str = value.to_s.strip
|
|
36
|
+
|
|
37
|
+
case str.downcase
|
|
38
|
+
when 'customer' then CUSTOMER
|
|
39
|
+
when 'subscription' then SUBSCRIPTION
|
|
40
|
+
when 'enum_self' then ENUM_SELF
|
|
41
|
+
when 'parent' then PARENT
|
|
42
|
+
when 'eldest' then ELDEST
|
|
43
|
+
else
|
|
44
|
+
default_value
|
|
45
|
+
end
|
|
46
|
+
end
|
|
31
47
|
end
|
|
32
48
|
end
|
|
@@ -19,5 +19,18 @@ module AdvancedBilling
|
|
|
19
19
|
|
|
20
20
|
GROUP_TYPE.include?(value)
|
|
21
21
|
end
|
|
22
|
+
|
|
23
|
+
def self.from_value(value, default_value = SINGLE_CUSTOMER)
|
|
24
|
+
return default_value if value.nil?
|
|
25
|
+
|
|
26
|
+
str = value.to_s.strip
|
|
27
|
+
|
|
28
|
+
case str.downcase
|
|
29
|
+
when 'single_customer' then SINGLE_CUSTOMER
|
|
30
|
+
when 'multiple_customers' then MULTIPLE_CUSTOMERS
|
|
31
|
+
else
|
|
32
|
+
default_value
|
|
33
|
+
end
|
|
34
|
+
end
|
|
22
35
|
end
|
|
23
36
|
end
|
|
@@ -19,5 +19,18 @@ module AdvancedBilling
|
|
|
19
19
|
|
|
20
20
|
INCLUDE_NULL_OR_NOT_NULL.include?(value)
|
|
21
21
|
end
|
|
22
|
+
|
|
23
|
+
def self.from_value(value, default_value = NOT_NULL)
|
|
24
|
+
return default_value if value.nil?
|
|
25
|
+
|
|
26
|
+
str = value.to_s.strip
|
|
27
|
+
|
|
28
|
+
case str.downcase
|
|
29
|
+
when 'not_null' then NOT_NULL
|
|
30
|
+
when 'null' then NULL
|
|
31
|
+
else
|
|
32
|
+
default_value
|
|
33
|
+
end
|
|
34
|
+
end
|
|
22
35
|
end
|
|
23
36
|
end
|
|
@@ -19,5 +19,18 @@ module AdvancedBilling
|
|
|
19
19
|
|
|
20
20
|
INCLUDE_OPTION.include?(value)
|
|
21
21
|
end
|
|
22
|
+
|
|
23
|
+
def self.from_value(value, default_value = EXCLUDE)
|
|
24
|
+
return default_value if value.nil?
|
|
25
|
+
|
|
26
|
+
str = value.to_s.strip
|
|
27
|
+
|
|
28
|
+
case str.downcase
|
|
29
|
+
when 'exclude' then EXCLUDE
|
|
30
|
+
when 'include' then INCLUDE
|
|
31
|
+
else
|
|
32
|
+
default_value
|
|
33
|
+
end
|
|
34
|
+
end
|
|
22
35
|
end
|
|
23
36
|
end
|
|
@@ -19,5 +19,18 @@ module AdvancedBilling
|
|
|
19
19
|
|
|
20
20
|
INTERVAL_UNIT.include?(value)
|
|
21
21
|
end
|
|
22
|
+
|
|
23
|
+
def self.from_value(value, default_value = DAY)
|
|
24
|
+
return default_value if value.nil?
|
|
25
|
+
|
|
26
|
+
str = value.to_s.strip
|
|
27
|
+
|
|
28
|
+
case str.downcase
|
|
29
|
+
when 'day' then DAY
|
|
30
|
+
when 'month' then MONTH
|
|
31
|
+
else
|
|
32
|
+
default_value
|
|
33
|
+
end
|
|
34
|
+
end
|
|
22
35
|
end
|
|
23
36
|
end
|
|
@@ -30,5 +30,19 @@ module AdvancedBilling
|
|
|
30
30
|
|
|
31
31
|
INVOICE_CONSOLIDATION_LEVEL.include?(value)
|
|
32
32
|
end
|
|
33
|
+
|
|
34
|
+
def self.from_value(value, default_value = NONE)
|
|
35
|
+
return default_value if value.nil?
|
|
36
|
+
|
|
37
|
+
str = value.to_s.strip
|
|
38
|
+
|
|
39
|
+
case str.downcase
|
|
40
|
+
when 'none' then NONE
|
|
41
|
+
when 'child' then CHILD
|
|
42
|
+
when 'parent' then PARENT
|
|
43
|
+
else
|
|
44
|
+
default_value
|
|
45
|
+
end
|
|
46
|
+
end
|
|
33
47
|
end
|
|
34
48
|
end
|
|
@@ -28,5 +28,21 @@ module AdvancedBilling
|
|
|
28
28
|
|
|
29
29
|
INVOICE_DATE_FIELD.include?(value)
|
|
30
30
|
end
|
|
31
|
+
|
|
32
|
+
def self.from_value(value, default_value = CREATED_AT)
|
|
33
|
+
return default_value if value.nil?
|
|
34
|
+
|
|
35
|
+
str = value.to_s.strip
|
|
36
|
+
|
|
37
|
+
case str.downcase
|
|
38
|
+
when 'created_at' then CREATED_AT
|
|
39
|
+
when 'due_date' then DUE_DATE
|
|
40
|
+
when 'issue_date' then ISSUE_DATE
|
|
41
|
+
when 'updated_at' then UPDATED_AT
|
|
42
|
+
when 'paid_date' then PAID_DATE
|
|
43
|
+
else
|
|
44
|
+
default_value
|
|
45
|
+
end
|
|
46
|
+
end
|
|
31
47
|
end
|
|
32
48
|
end
|
|
@@ -22,5 +22,19 @@ module AdvancedBilling
|
|
|
22
22
|
|
|
23
23
|
INVOICE_DISCOUNT_SOURCE_TYPE.include?(value)
|
|
24
24
|
end
|
|
25
|
+
|
|
26
|
+
def self.from_value(value, default_value = COUPON)
|
|
27
|
+
return default_value if value.nil?
|
|
28
|
+
|
|
29
|
+
str = value.to_s.strip
|
|
30
|
+
|
|
31
|
+
case str.downcase
|
|
32
|
+
when 'coupon' then COUPON
|
|
33
|
+
when 'referral' then REFERRAL
|
|
34
|
+
when 'enum_ad_hoc_coupon' then ENUM_AD_HOC_COUPON
|
|
35
|
+
else
|
|
36
|
+
default_value
|
|
37
|
+
end
|
|
38
|
+
end
|
|
25
39
|
end
|
|
26
40
|
end
|
|
@@ -22,5 +22,19 @@ module AdvancedBilling
|
|
|
22
22
|
|
|
23
23
|
INVOICE_DISCOUNT_TYPE.include?(value)
|
|
24
24
|
end
|
|
25
|
+
|
|
26
|
+
def self.from_value(value, default_value = PERCENTAGE)
|
|
27
|
+
return default_value if value.nil?
|
|
28
|
+
|
|
29
|
+
str = value.to_s.strip
|
|
30
|
+
|
|
31
|
+
case str.downcase
|
|
32
|
+
when 'percentage' then PERCENTAGE
|
|
33
|
+
when 'flat_amount' then FLAT_AMOUNT
|
|
34
|
+
when 'rollover' then ROLLOVER
|
|
35
|
+
else
|
|
36
|
+
default_value
|
|
37
|
+
end
|
|
38
|
+
end
|
|
25
39
|
end
|
|
26
40
|
end
|
|
@@ -28,5 +28,21 @@ module AdvancedBilling
|
|
|
28
28
|
|
|
29
29
|
INVOICE_EVENT_PAYMENT_METHOD.include?(value)
|
|
30
30
|
end
|
|
31
|
+
|
|
32
|
+
def self.from_value(value, default_value = APPLE_PAY)
|
|
33
|
+
return default_value if value.nil?
|
|
34
|
+
|
|
35
|
+
str = value.to_s.strip
|
|
36
|
+
|
|
37
|
+
case str.downcase
|
|
38
|
+
when 'apple_pay' then APPLE_PAY
|
|
39
|
+
when 'bank_account' then BANK_ACCOUNT
|
|
40
|
+
when 'credit_card' then CREDIT_CARD
|
|
41
|
+
when 'external' then EXTERNAL
|
|
42
|
+
when 'paypal_account' then PAYPAL_ACCOUNT
|
|
43
|
+
else
|
|
44
|
+
default_value
|
|
45
|
+
end
|
|
46
|
+
end
|
|
31
47
|
end
|
|
32
48
|
end
|
|
@@ -58,5 +58,31 @@ module AdvancedBilling
|
|
|
58
58
|
|
|
59
59
|
INVOICE_EVENT_TYPE.include?(value)
|
|
60
60
|
end
|
|
61
|
+
|
|
62
|
+
def self.from_value(value, default_value = ISSUE_INVOICE)
|
|
63
|
+
return default_value if value.nil?
|
|
64
|
+
|
|
65
|
+
str = value.to_s.strip
|
|
66
|
+
|
|
67
|
+
case str.downcase
|
|
68
|
+
when 'issue_invoice' then ISSUE_INVOICE
|
|
69
|
+
when 'apply_credit_note' then APPLY_CREDIT_NOTE
|
|
70
|
+
when 'create_credit_note' then CREATE_CREDIT_NOTE
|
|
71
|
+
when 'apply_payment' then APPLY_PAYMENT
|
|
72
|
+
when 'apply_debit_note' then APPLY_DEBIT_NOTE
|
|
73
|
+
when 'create_debit_note' then CREATE_DEBIT_NOTE
|
|
74
|
+
when 'refund_invoice' then REFUND_INVOICE
|
|
75
|
+
when 'void_invoice' then VOID_INVOICE
|
|
76
|
+
when 'void_remainder' then VOID_REMAINDER
|
|
77
|
+
when 'backport_invoice' then BACKPORT_INVOICE
|
|
78
|
+
when 'change_invoice_status' then CHANGE_INVOICE_STATUS
|
|
79
|
+
when 'change_invoice_collection_method' then CHANGE_INVOICE_COLLECTION_METHOD
|
|
80
|
+
when 'remove_payment' then REMOVE_PAYMENT
|
|
81
|
+
when 'failed_payment' then FAILED_PAYMENT
|
|
82
|
+
when 'change_chargeback_status' then CHANGE_CHARGEBACK_STATUS
|
|
83
|
+
else
|
|
84
|
+
default_value
|
|
85
|
+
end
|
|
86
|
+
end
|
|
61
87
|
end
|
|
62
88
|
end
|
|
@@ -31,5 +31,22 @@ module AdvancedBilling
|
|
|
31
31
|
|
|
32
32
|
INVOICE_PAYMENT_METHOD_TYPE.include?(value)
|
|
33
33
|
end
|
|
34
|
+
|
|
35
|
+
def self.from_value(value, default_value = CREDIT_CARD)
|
|
36
|
+
return default_value if value.nil?
|
|
37
|
+
|
|
38
|
+
str = value.to_s.strip
|
|
39
|
+
|
|
40
|
+
case str.downcase
|
|
41
|
+
when 'credit_card' then CREDIT_CARD
|
|
42
|
+
when 'check' then CHECK
|
|
43
|
+
when 'cash' then CASH
|
|
44
|
+
when 'money_order' then MONEY_ORDER
|
|
45
|
+
when 'ach' then ACH
|
|
46
|
+
when 'other' then OTHER
|
|
47
|
+
else
|
|
48
|
+
default_value
|
|
49
|
+
end
|
|
50
|
+
end
|
|
34
51
|
end
|
|
35
52
|
end
|
|
@@ -25,5 +25,20 @@ module AdvancedBilling
|
|
|
25
25
|
|
|
26
26
|
INVOICE_PAYMENT_TYPE.include?(value)
|
|
27
27
|
end
|
|
28
|
+
|
|
29
|
+
def self.from_value(value, default_value = EXTERNAL)
|
|
30
|
+
return default_value if value.nil?
|
|
31
|
+
|
|
32
|
+
str = value.to_s.strip
|
|
33
|
+
|
|
34
|
+
case str.downcase
|
|
35
|
+
when 'external' then EXTERNAL
|
|
36
|
+
when 'prepayment' then PREPAYMENT
|
|
37
|
+
when 'service_credit' then SERVICE_CREDIT
|
|
38
|
+
when 'payment' then PAYMENT
|
|
39
|
+
else
|
|
40
|
+
default_value
|
|
41
|
+
end
|
|
42
|
+
end
|
|
28
43
|
end
|
|
29
44
|
end
|
|
@@ -43,5 +43,26 @@ module AdvancedBilling
|
|
|
43
43
|
|
|
44
44
|
INVOICE_ROLE.include?(value)
|
|
45
45
|
end
|
|
46
|
+
|
|
47
|
+
def self.from_value(value, default_value = UNSET)
|
|
48
|
+
return default_value if value.nil?
|
|
49
|
+
|
|
50
|
+
str = value.to_s.strip
|
|
51
|
+
|
|
52
|
+
case str.downcase
|
|
53
|
+
when 'unset' then UNSET
|
|
54
|
+
when 'signup' then SIGNUP
|
|
55
|
+
when 'renewal' then RENEWAL
|
|
56
|
+
when 'usage' then USAGE
|
|
57
|
+
when 'reactivation' then REACTIVATION
|
|
58
|
+
when 'proration' then PRORATION
|
|
59
|
+
when 'migration' then MIGRATION
|
|
60
|
+
when 'adhoc' then ADHOC
|
|
61
|
+
when 'backport' then BACKPORT
|
|
62
|
+
when 'backportbalancereconciliation' then BACKPORTBALANCERECONCILIATION
|
|
63
|
+
else
|
|
64
|
+
default_value
|
|
65
|
+
end
|
|
66
|
+
end
|
|
46
67
|
end
|
|
47
68
|
end
|
|
@@ -37,5 +37,24 @@ module AdvancedBilling
|
|
|
37
37
|
|
|
38
38
|
INVOICE_SORT_FIELD.include?(value)
|
|
39
39
|
end
|
|
40
|
+
|
|
41
|
+
def self.from_value(value, default_value = STATUS)
|
|
42
|
+
return default_value if value.nil?
|
|
43
|
+
|
|
44
|
+
str = value.to_s.strip
|
|
45
|
+
|
|
46
|
+
case str.downcase
|
|
47
|
+
when 'status' then STATUS
|
|
48
|
+
when 'total_amount' then TOTAL_AMOUNT
|
|
49
|
+
when 'due_amount' then DUE_AMOUNT
|
|
50
|
+
when 'created_at' then CREATED_AT
|
|
51
|
+
when 'updated_at' then UPDATED_AT
|
|
52
|
+
when 'issue_date' then ISSUE_DATE
|
|
53
|
+
when 'due_date' then DUE_DATE
|
|
54
|
+
when 'number' then NUMBER
|
|
55
|
+
else
|
|
56
|
+
default_value
|
|
57
|
+
end
|
|
58
|
+
end
|
|
40
59
|
end
|
|
41
60
|
end
|
|
@@ -36,5 +36,23 @@ module AdvancedBilling
|
|
|
36
36
|
|
|
37
37
|
INVOICE_STATUS.include?(value)
|
|
38
38
|
end
|
|
39
|
+
|
|
40
|
+
def self.from_value(value, default_value = DRAFT)
|
|
41
|
+
return default_value if value.nil?
|
|
42
|
+
|
|
43
|
+
str = value.to_s.strip
|
|
44
|
+
|
|
45
|
+
case str.downcase
|
|
46
|
+
when 'draft' then DRAFT
|
|
47
|
+
when 'open' then OPEN
|
|
48
|
+
when 'paid' then PAID
|
|
49
|
+
when 'pending' then PENDING
|
|
50
|
+
when 'voided' then VOIDED
|
|
51
|
+
when 'canceled' then CANCELED
|
|
52
|
+
when 'processing' then PROCESSING
|
|
53
|
+
else
|
|
54
|
+
default_value
|
|
55
|
+
end
|
|
56
|
+
end
|
|
39
57
|
end
|
|
40
58
|
end
|