chargebee 2.7.5 → 2.8.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 +5 -5
- data/CHANGELOG.md +119 -2
- data/LICENSE +1 -1
- data/chargebee.gemspec +4 -2
- data/lib/chargebee.rb +1 -1
- data/lib/chargebee/models/addon.rb +4 -3
- data/lib/chargebee/models/advance_invoice_schedule.rb +18 -0
- data/lib/chargebee/models/card.rb +2 -1
- data/lib/chargebee/models/coupon.rb +2 -1
- data/lib/chargebee/models/credit_note.rb +4 -4
- data/lib/chargebee/models/credit_note_estimate.rb +2 -2
- data/lib/chargebee/models/customer.rb +18 -5
- data/lib/chargebee/models/estimate.rb +1 -1
- data/lib/chargebee/models/hierarchy.rb +1 -1
- data/lib/chargebee/models/invoice.rb +7 -7
- data/lib/chargebee/models/invoice_estimate.rb +2 -2
- data/lib/chargebee/models/model.rb +14 -14
- data/lib/chargebee/models/order.rb +8 -0
- data/lib/chargebee/models/payment_intent.rb +3 -2
- data/lib/chargebee/models/plan.rb +6 -5
- data/lib/chargebee/models/promotional_credit.rb +2 -2
- data/lib/chargebee/models/quote.rb +21 -5
- data/lib/chargebee/models/quote_line_group.rb +4 -3
- data/lib/chargebee/models/quoted_subscription.rb +24 -0
- data/lib/chargebee/models/subscription.rb +19 -13
- data/lib/chargebee/models/transaction.rb +5 -1
- data/lib/chargebee/models/unbilled_charge.rb +3 -2
- data/lib/chargebee/models/virtual_bank_account.rb +4 -0
- data/lib/chargebee/result.rb +23 -4
- metadata +18 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 5313e0ccaa457855df52b89719c4363d56b9abc7b49597a6824ed063a69ab8d3
|
4
|
+
data.tar.gz: a1ce4600484c5fdcb7b8d529d36f542ea0d42c2bcb0288b7d6b350bd1770c8ba
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fdfe10f1f88fb45542eebf6944795be482697039c91898e11d6c4bab77b7e3fdef25d9eaa0c3e38a6aeb9c491303859755a19fb7452796f0c76e36e38a760496
|
7
|
+
data.tar.gz: e61978f0038d899e713f0d0e6820212e4042ec262d73fa5e58dc3b4a3b4f3ed3c3c158da632216279de26161989bea026a895e9d27d43c1d2e19fe4feb6ffb20
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,121 @@
|
|
1
|
+
### v2.8.0 (2020-11-16)
|
2
|
+
* * *
|
3
|
+
* New attributes price_in_decimal, tiers[starting_unit_in_decimal], tiers[ending_unit_in_decimal], tiers[price_in_decimal] have been added to the resource addon
|
4
|
+
* New input parameters price_in_decimal, tiers[starting_unit_in_decimal], tiers[ending_unit_in_decimal], tiers[price_in_decimal] have been added to addons#create_an_addon, addons#update_an_addon apis.
|
5
|
+
* New attributes unit_amount_in_decimal, quantity_in_decimal, amount_in_decimal, line_item_tiers[starting_unit_in_decimal], line_item_tiers[ending_unit_in_decimal], line_item_tiers[quantity_used_in_decimal], line_item_tiers[unit_amount_in_decimal] have been added to the resources credit_note, credit_note_estimate, invoice, invoice_estimate
|
6
|
+
* New input parameters line_items[unit_amount_in_decimal], line_items[quantity_in_decimal] have been added to credit_notes#create_credit_note api.
|
7
|
+
* New input parameters subscription[plan_unit_price_in_decimal], subscription[plan_quantity_in_decimal], addons[quantity_in_decimal], addons[unit_price_in_decimal], event_based_addons[quantity_in_decimal], event_based_addons[unit_price_in_decimal] have been added to estimates#create_subscription_estimate, estimates#create_subscription_for_a_customer_estimate, estimates#update_subscription_estimate, hosted_pages#checkout_new_subscription, hosted_pages#checkout_existing_subscription, quotes#create_a_quote_for_a_new_subscription, quotes#edit_create_subscription_quote, quotes#create_a_quote_for_update_subscription, quotes#edit_update_subscription_quote, apis
|
8
|
+
* New input parameters subscription[plan_quantity_in_decimal], addons[quantity_in_decimal] have been added to estimates#gift_subscription_estimate, gifts#create_a_gift, hosted_pages#checkout_gift_subscription apis
|
9
|
+
* New input parameters addons[quantity_in_decimal], addons[unit_price_in_decimal], charges[amount_in_decimal] have been added to estimates#create_invoice_estimate, invoices#create_an_invoice, quotes#create_a_quote_for_one-time_charges, quotes#edit_one-time_quote apis
|
10
|
+
* New input parameter amount_in_decimal has been added to invoices#create_invoice_for_a_one-time_charge api
|
11
|
+
* Input parameter amount has been made optional to invoices#create_invoice_for_a_one-time_charge api
|
12
|
+
* New input parameters addon_quantity_in_decimal, addon_unit_price_in_decimal have been added to invoices#create_invoice_for_a_non-recurring_addon
|
13
|
+
* New input parameters line_items[unit_amount_in_decimal], line_items[quantity_in_decimal], line_items[amount_in_decimal], line_item_tiers[starting_unit_in_decimal], line_item_tiers[ending_unit_in_decimal], line_item_tiers[quantity_used_in_decimal], line_item_tiers[unit_amount_in_decimal] have been added to invoices#import_invoice api
|
14
|
+
* Input parameters line_item_tiers[starting_unit], line_item_tiers[ending_unit], line_item_tiers[quantity_used], line_item_tiers[unit_amount] have beed made optional in invoices#import_invoice api
|
15
|
+
* New input parameters addon_quantity_in_decimal, addon_unit_price_in_decimal have been added to invoices#add_non-recurring_addon_to_a_pending_invoice api
|
16
|
+
* New input parameter invoice_date has been added to invoices#close_a_pending_invoice api
|
17
|
+
* New attributes tiers[starting_unit_in_decimal], tiers[ending_unit_in_decimal], tiers[price_in_decimal], attached_addons[quantity_in_decimal], event_based_addons[quantity_in_decimal], free_quantity_in_decimal, price_in_decimal have been added to the resource plan
|
18
|
+
* New input parameters tiers[starting_unit_in_decimal], tiers[ending_unit_in_decimal], tiers[price_in_decimal], attached_addons[quantity_in_decimal], event_based_addons[quantity_in_decimal], free_quantity_in_decimal, price_in_decimal have been added to plans#create_a_plan, plans#update_a_plan apis
|
19
|
+
* New attribute amount_in_decimal has been added to the resource promotional_credit
|
20
|
+
* New input parameter amount_in_decimal has been added to promotional_credits#add_promotional_credits, promotional_credits#deduct_promotional_credits, promotional_credits#set_promotional_credits apis
|
21
|
+
* Input parameter amount has been made optional in promotional_credits#add_promotional_credits, promotional_credits#deduct_promotional_credits, promotional_credits#set_promotional_credits apis
|
22
|
+
* New attributes unit_amount_in_decimal, quantity_in_decimal, amount_in_decimal have been added to the resource quote
|
23
|
+
* New attributes addons[quantity_in_decimal], addons[unit_price_in_decimal], addons[amount_in_decimal], event_based_addons[quantity_in_decimal], event_based_addons[unit_price_in_decimal] have been added to the sub resource quoted_subscription
|
24
|
+
* New attributes unit_amount_in_decimal, quantity_in_decimal, amount_in_decimal have been added to the sub resource quoted_line_group
|
25
|
+
* New attributes addons[quantity_in_decimal], addons[unit_price_in_decimal], addons[amount_in_decimal], event_based_addons[quantity_in_decimal], event_based_addons[unit_price_in_decimal], plan_free_quantity_in_decimal, plan_quantity_in_decimal, plan_unit_price_in_decimal, plan_amount_in_decimal have been added to the resource subscription
|
26
|
+
* New input parameters plan_unit_price_in_decimal, plan_quantity_in_decimal, addons[quantity_in_decimal], addons[unit_price_in_decimal], event_based_addons[quantity_in_decimal], event_based_addons[unit_price_in_decimal] have been added to subscriptions#create_a_subscription, subscriptions#create_subscription_for_customer, subscriptions#update_a_subscription, subscriptions#import_a_subscription, subscriptions#import_subscription_for_customer apis
|
27
|
+
* New input parameter amount_in_decimal has been added to subscriptions#add_charge_at_term_end apis
|
28
|
+
* Input parameter amount has been made optional in subscriptions#add_charge_at_term_end apis
|
29
|
+
* New input parameters addon_quantity_in_decimal, addon_unit_price_in_decimal have been added to subscriptions#charge_addon_at_term_end api
|
30
|
+
* New attributes tiers[starting_unit_in_decimal], tiers[ending_unit_in_decimal], tiers[quantity_used_in_decimal], tiers[unit_amount_in_decimal], unit_amount_in_decimal, quantity_in_decimal, amount_in_decimal have been added to the resource unbilled_charge
|
31
|
+
* New endpoint transactions#refund_a_payment has been added to the resource transaction
|
32
|
+
### v2.7.9 (2020-10-19)
|
33
|
+
* * *
|
34
|
+
* New optional attribute quoted_subscriptions has been added to the resource quote
|
35
|
+
* New optional attributes resource_version and updated_at are added to the resource payment_intent
|
36
|
+
### v2.7.8 (2020-09-29)
|
37
|
+
* * *
|
38
|
+
|
39
|
+
* New attribute included_in_mrr has been added in addon and coupon resource
|
40
|
+
* New attribute offline_payment_method has been added in subscription and customer resource
|
41
|
+
* New input parameter included_in_mrr has been added in create_an_addon, update_an_addon, create_a_coupon and update_a_coupon apis.
|
42
|
+
* New input parameter offline_payment_method has been added in create_a_customer, list_customers, update_a_customer, create_a_subscription, create_subscription_for_customer and list_subscriptions apis
|
43
|
+
* New input parameter auto_collection has been added in update_a_subscription
|
44
|
+
* New input parameter subscription[offline_payment_method] has been added in create_subscription_estimate, create_subscription_for_a_customer_estimate, update_subscription_estimate, export_revenue_recognition_reports, export_deferred_revenue_reports, export_subscriptions, checkout_new_subscription and checkout_existing_subscription apis
|
45
|
+
* New input parameter subscription[auto_collection] has been added in checkout_existing_subscription and update_subscription_estimate apis
|
46
|
+
* New input parameter customer[offline_payment_method] has been added in export_revenue_recognition_reports, export_deferred_revenue_reports, export_customers and create_a_subscription
|
47
|
+
|
48
|
+
### v2.7.7 (2020-09-09)
|
49
|
+
* * *
|
50
|
+
|
51
|
+
* New input parameter currency_code is added in list_addons, list_coupons, list_plans, export_plans, export_addons, export_coupons apis
|
52
|
+
* New attributes powered_by has been added in card resource
|
53
|
+
* New input parameters subscription[free_period], subscription[free_period_unit] have been added in create_subscription_estimate, create_subscription_for_a_customer_estimate, update_subscription_estimate apis
|
54
|
+
* Input parameter invoice[customer_id] is made optional in create_invoice_estimate api
|
55
|
+
* Input parameter customer_id is made optional in create_an_invoice
|
56
|
+
* Attribute created_at in dunning_attempts is made optional in the invoice resource
|
57
|
+
* New attributes free_period and free_period_unit have been added in the Subscription resource
|
58
|
+
* New enum type free_period_unit has been added with the values:
|
59
|
+
DAY,
|
60
|
+
WEEK,
|
61
|
+
MONTH,
|
62
|
+
YEAR
|
63
|
+
* New enum type powered_by has been added in card resource with the values:
|
64
|
+
IDEAL,
|
65
|
+
SOFORT,
|
66
|
+
BANCONTACT,
|
67
|
+
GIROPAY,
|
68
|
+
NOT_APPLICABLE
|
69
|
+
* New endpoint import_contract_term has been added to the subscription resource
|
70
|
+
* Attributes status, amount and date inside the linked_payment are made optional in the transaction resource
|
71
|
+
* New endpoint delete has been added to the virtual_bank_account resource
|
72
|
+
* New values GIROPAY and DOTPAY have been added to the payment_method_types enum
|
73
|
+
* New values PAYMENT_SOURCE_EXPIRING and PAYMENT_SOURCE_EXPIRED have been added to the event_type enums
|
74
|
+
* New value PAYPAL has been added to the gateway enum
|
75
|
+
|
76
|
+
### v2.7.6 (2020-07-15)
|
77
|
+
* * *
|
78
|
+
|
79
|
+
* New attributes show_description_in_invoices, show_description_in_quotes have been added in Addon, Plan resource
|
80
|
+
* New input parameters show_description_in_invoices, show_description_in_quotes have been added for create_an_addon, update_an_addon, create_a_plan, update_a_plan apis
|
81
|
+
* New attribute create_reason_code has been added in Credit notes resource
|
82
|
+
* Attribute reason_code is made optional in the Credit notes resource
|
83
|
+
* New filter parameter create_reason_code is added in list_credit_notes api
|
84
|
+
* New input parameter refund_reason_code has been added in Credit notes' Refund, Record a refund apis
|
85
|
+
* Sub-resources parent_account_access and child_account_access have been added in Customer resource
|
86
|
+
* New attribute use_default_hierarchy_settings has been added in Customer resource
|
87
|
+
* New endpoint update_hierarchy_settings has been added in Customer resource
|
88
|
+
* New input parameters use_default_hierarchy_settings, parent_account_access, child_account_access have been added in link_a_customer api
|
89
|
+
* New input parameter invoice_notes, coupon_ids, invoice[subscription_id], charges[taxable], charges[tax_profile_id], charges[avalara_tax_code], charges[taxjar_product_code] has been added to create_invoice_estimate api
|
90
|
+
* New input param cancel_reason_code has been added to export_revenue_recognition_reports, export_deferred_revenue_reports, export_subscriptions, export_credit_notes apis
|
91
|
+
* New input param coupon_ids has been added to checkout_new_subscription, checkout_existing_subscription apis
|
92
|
+
* Input param subscription_coupon has been deprecated in checkout_new_subscription, checkout_existing_subscription apis
|
93
|
+
* New attribute void_reason_code has been added to the Invoice resource
|
94
|
+
* Attribute cn_reason_code has been made optional in applied_credits, adjustment_credit_notes, issued_credit_notes, linked_credit_note sub-resources
|
95
|
+
* New attribute cn_create_reason_code has been added in applied_credits, adjustment_credit_notes, issued_credit_notes, linked_credit_note sub-resources
|
96
|
+
* New input parameter subscription_id, invoice_note, remove_general_note, coupon_ids, charges[taxable], charges[tax_profile_id], charges[avalara_tax_code], charges[taxjar_product_code] have been added to create_an_invoice api
|
97
|
+
* Input parameter coupon is deprecated from create_an_invoice api
|
98
|
+
* New filter parameter void_reason_code has been added to list_invoices api
|
99
|
+
* New input parameter invoice_note, remove_general_note, notes_to_remove[entity_type], notes_to_remove[entity_id] have been added to close_a_pending_invoice api
|
100
|
+
* New input parameter void_reason_code has been added to void_an_invoice api
|
101
|
+
* New input parameter credit_note[create_reason_code] has been added to refund_an_invoice, record_refund_for_an_invoice api
|
102
|
+
* New endpoints import_an_order and delete_an_imported_order have been added to Order resource
|
103
|
+
* New filter parameter exclude_deleted_credit_notes has been added to list_orders api
|
104
|
+
* New attribute payment_method_type has been added to payment_intent resource and active_payment_attempt sub-resource
|
105
|
+
* New input parameter payment_method_type has been added to create_a_payment_intent, update_a_payment_intent api
|
106
|
+
* New attributes version, contract_term_start, contract_term_end, contract_term_termination_fee have been added to Quotes resource
|
107
|
+
* New endpoints edit_create_subscription_quote, edit_update_subscription_quote, edit_one_time_quote, extend_expiry_date have beed added to Quotes resource
|
108
|
+
* New input parameters contract_term[action_at_term_end], contract_term[cancellation_cutoff_period], subscription[contract_term_billing_cycle_on_renewal] have been added to create_a_quote_for_a_new_subscription, create_a_quote_for_update_subscription apis
|
109
|
+
* New attribute version has been added to quote_line_group sub-resource
|
110
|
+
* New attribute cancel_reason_code has been added to Subscriptions resource
|
111
|
+
* New filter parameter cancel_reason_code has been added to list_subscriptions, cancel_a_subscription apis
|
112
|
+
* New input parameter contract_term_billing_cycle_on_renewal has been added to import_a_subscription, import_subscription_for_customer apis
|
113
|
+
* New input parameter event_based_addon has been added to cancel_a_subscription api
|
114
|
+
* New filter parameter is_voided has been added to list_unbilled_charges api
|
115
|
+
* New event_types MRR_UPDATED, ORDER_DELETED have been added
|
116
|
+
* New values SOFORT, BANCONTACT have been added to the payment_method_types enum
|
117
|
+
* New attributes entity_type_description has been added to the line_items sub-resource
|
118
|
+
|
1
119
|
### v2.7.5 (2020-04-03)
|
2
120
|
* * *
|
3
121
|
|
@@ -1615,5 +1733,4 @@ Support for creating plans & addons on the fly via API.
|
|
1615
1733
|
|
1616
1734
|
* API to fetch multiple subscriptions of a customer.
|
1617
1735
|
|
1618
|
-
* Added support to get the list of events filtered by event type. Events can be fetched based on the event type eg., payment_succeeded.
|
1619
|
-
|
1736
|
+
* Added support to get the list of events filtered by event type. Events can be fetched based on the event type eg., payment_succeeded.
|
data/LICENSE
CHANGED
data/chargebee.gemspec
CHANGED
@@ -4,8 +4,8 @@ Gem::Specification.new do |s|
|
|
4
4
|
s.rubygems_version = '1.3.5'
|
5
5
|
s.required_ruby_version = '>= 1.9.3'
|
6
6
|
s.name = 'chargebee'
|
7
|
-
s.version = '2.
|
8
|
-
s.date = '2020-
|
7
|
+
s.version = '2.8.0'
|
8
|
+
s.date = '2020-11-16'
|
9
9
|
|
10
10
|
s.summary = "Ruby client for Chargebee API."
|
11
11
|
s.description = "Subscription Billing - Simple. Secure. Affordable. More details at www.chargebee.com."
|
@@ -40,6 +40,7 @@ Gem::Specification.new do |s|
|
|
40
40
|
lib/chargebee/list_result.rb
|
41
41
|
lib/chargebee/models/addon.rb
|
42
42
|
lib/chargebee/models/address.rb
|
43
|
+
lib/chargebee/models/advance_invoice_schedule.rb
|
43
44
|
lib/chargebee/models/card.rb
|
44
45
|
lib/chargebee/models/comment.rb
|
45
46
|
lib/chargebee/models/contact.rb
|
@@ -68,6 +69,7 @@ Gem::Specification.new do |s|
|
|
68
69
|
lib/chargebee/models/promotional_credit.rb
|
69
70
|
lib/chargebee/models/quote.rb
|
70
71
|
lib/chargebee/models/quote_line_group.rb
|
72
|
+
lib/chargebee/models/quoted_subscription.rb
|
71
73
|
lib/chargebee/models/resource_migration.rb
|
72
74
|
lib/chargebee/models/site_migration_detail.rb
|
73
75
|
lib/chargebee/models/subscription.rb
|
data/lib/chargebee.rb
CHANGED
@@ -2,15 +2,16 @@ module ChargeBee
|
|
2
2
|
class Addon < Model
|
3
3
|
|
4
4
|
class Tier < Model
|
5
|
-
attr_accessor :starting_unit, :ending_unit, :price
|
5
|
+
attr_accessor :starting_unit, :ending_unit, :price, :starting_unit_in_decimal, :ending_unit_in_decimal, :price_in_decimal
|
6
6
|
end
|
7
7
|
|
8
8
|
attr_accessor :id, :name, :invoice_name, :description, :pricing_model, :type, :charge_type,
|
9
9
|
:price, :currency_code, :period, :period_unit, :unit, :status, :archived_at, :enabled_in_portal,
|
10
10
|
:tax_code, :taxjar_product_code, :avalara_sale_type, :avalara_transaction_type, :avalara_service_type,
|
11
11
|
:sku, :accounting_code, :accounting_category1, :accounting_category2, :is_shippable, :shipping_frequency_period,
|
12
|
-
:shipping_frequency_period_unit, :resource_version, :updated_at, :
|
13
|
-
:meta_data, :tiers
|
12
|
+
:shipping_frequency_period_unit, :resource_version, :updated_at, :price_in_decimal, :included_in_mrr,
|
13
|
+
:invoice_notes, :taxable, :tax_profile_id, :meta_data, :tiers, :show_description_in_invoices,
|
14
|
+
:show_description_in_quotes
|
14
15
|
|
15
16
|
# OPERATIONS
|
16
17
|
#-----------
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module ChargeBee
|
2
|
+
class AdvanceInvoiceSchedule < Model
|
3
|
+
|
4
|
+
class FixedIntervalSchedule < Model
|
5
|
+
attr_accessor :end_schedule_on, :number_of_occurrences, :days_before_renewal, :end_date, :created_at, :terms_to_charge
|
6
|
+
end
|
7
|
+
|
8
|
+
class SpecificDatesSchedule < Model
|
9
|
+
attr_accessor :terms_to_charge, :date, :created_at
|
10
|
+
end
|
11
|
+
|
12
|
+
attr_accessor :id, :schedule_type, :fixed_interval_schedule, :specific_dates_schedule
|
13
|
+
|
14
|
+
# OPERATIONS
|
15
|
+
#-----------
|
16
|
+
|
17
|
+
end # ~AdvanceInvoiceSchedule
|
18
|
+
end # ~ChargeBee
|
@@ -4,7 +4,8 @@ module ChargeBee
|
|
4
4
|
attr_accessor :payment_source_id, :status, :gateway, :gateway_account_id, :ref_tx_id, :first_name,
|
5
5
|
:last_name, :iin, :last4, :card_type, :funding_type, :expiry_month, :expiry_year, :issuing_country,
|
6
6
|
:billing_addr1, :billing_addr2, :billing_city, :billing_state_code, :billing_state, :billing_country,
|
7
|
-
:billing_zip, :created_at, :resource_version, :updated_at, :ip_address, :
|
7
|
+
:billing_zip, :created_at, :resource_version, :updated_at, :ip_address, :powered_by, :customer_id,
|
8
|
+
:masked_number
|
8
9
|
|
9
10
|
# OPERATIONS
|
10
11
|
#-----------
|
@@ -4,7 +4,8 @@ module ChargeBee
|
|
4
4
|
attr_accessor :id, :name, :invoice_name, :discount_type, :discount_percentage, :discount_amount,
|
5
5
|
:discount_quantity, :currency_code, :duration_type, :duration_month, :valid_till, :max_redemptions,
|
6
6
|
:status, :apply_discount_on, :apply_on, :plan_constraint, :addon_constraint, :created_at, :archived_at,
|
7
|
-
:resource_version, :updated_at, :plan_ids, :addon_ids, :redemptions, :invoice_notes,
|
7
|
+
:resource_version, :updated_at, :included_in_mrr, :plan_ids, :addon_ids, :redemptions, :invoice_notes,
|
8
|
+
:meta_data
|
8
9
|
|
9
10
|
# OPERATIONS
|
10
11
|
#-----------
|
@@ -2,7 +2,7 @@ module ChargeBee
|
|
2
2
|
class CreditNote < Model
|
3
3
|
|
4
4
|
class LineItem < Model
|
5
|
-
attr_accessor :id, :subscription_id, :date_from, :date_to, :unit_amount, :quantity, :amount, :pricing_model, :is_taxed, :tax_amount, :tax_rate, :discount_amount, :item_level_discount_amount, :description, :entity_type, :tax_exempt_reason, :entity_id, :customer_id
|
5
|
+
attr_accessor :id, :subscription_id, :date_from, :date_to, :unit_amount, :quantity, :amount, :pricing_model, :is_taxed, :tax_amount, :tax_rate, :unit_amount_in_decimal, :quantity_in_decimal, :amount_in_decimal, :discount_amount, :item_level_discount_amount, :description, :entity_description, :entity_type, :tax_exempt_reason, :entity_id, :customer_id
|
6
6
|
end
|
7
7
|
|
8
8
|
class Discount < Model
|
@@ -14,7 +14,7 @@ module ChargeBee
|
|
14
14
|
end
|
15
15
|
|
16
16
|
class LineItemTier < Model
|
17
|
-
attr_accessor :line_item_id, :starting_unit, :ending_unit, :quantity_used, :unit_amount
|
17
|
+
attr_accessor :line_item_id, :starting_unit, :ending_unit, :quantity_used, :unit_amount, :starting_unit_in_decimal, :ending_unit_in_decimal, :quantity_used_in_decimal, :unit_amount_in_decimal
|
18
18
|
end
|
19
19
|
|
20
20
|
class Tax < Model
|
@@ -26,7 +26,7 @@ module ChargeBee
|
|
26
26
|
end
|
27
27
|
|
28
28
|
class LinkedRefund < Model
|
29
|
-
attr_accessor :txn_id, :applied_amount, :applied_at, :txn_status, :txn_date, :txn_amount
|
29
|
+
attr_accessor :txn_id, :applied_amount, :applied_at, :txn_status, :txn_date, :txn_amount, :refund_reason_code
|
30
30
|
end
|
31
31
|
|
32
32
|
class Allocation < Model
|
@@ -38,7 +38,7 @@ module ChargeBee
|
|
38
38
|
:amount_available, :refunded_at, :voided_at, :resource_version, :updated_at, :sub_total, :sub_total_in_local_currency,
|
39
39
|
:total_in_local_currency, :local_currency_code, :round_off_amount, :fractional_correction, :line_items,
|
40
40
|
:discounts, :line_item_discounts, :line_item_tiers, :taxes, :line_item_taxes, :linked_refunds,
|
41
|
-
:allocations, :deleted
|
41
|
+
:allocations, :deleted, :create_reason_code
|
42
42
|
|
43
43
|
# OPERATIONS
|
44
44
|
#-----------
|
@@ -2,7 +2,7 @@ module ChargeBee
|
|
2
2
|
class CreditNoteEstimate < Model
|
3
3
|
|
4
4
|
class LineItem < Model
|
5
|
-
attr_accessor :id, :subscription_id, :date_from, :date_to, :unit_amount, :quantity, :amount, :pricing_model, :is_taxed, :tax_amount, :tax_rate, :discount_amount, :item_level_discount_amount, :description, :entity_type, :tax_exempt_reason, :entity_id, :customer_id
|
5
|
+
attr_accessor :id, :subscription_id, :date_from, :date_to, :unit_amount, :quantity, :amount, :pricing_model, :is_taxed, :tax_amount, :tax_rate, :unit_amount_in_decimal, :quantity_in_decimal, :amount_in_decimal, :discount_amount, :item_level_discount_amount, :description, :entity_description, :entity_type, :tax_exempt_reason, :entity_id, :customer_id
|
6
6
|
end
|
7
7
|
|
8
8
|
class Discount < Model
|
@@ -22,7 +22,7 @@ module ChargeBee
|
|
22
22
|
end
|
23
23
|
|
24
24
|
class LineItemTier < Model
|
25
|
-
attr_accessor :line_item_id, :starting_unit, :ending_unit, :quantity_used, :unit_amount
|
25
|
+
attr_accessor :line_item_id, :starting_unit, :ending_unit, :quantity_used, :unit_amount, :starting_unit_in_decimal, :ending_unit_in_decimal, :quantity_used_in_decimal, :unit_amount_in_decimal
|
26
26
|
end
|
27
27
|
|
28
28
|
attr_accessor :reference_invoice_id, :type, :price_type, :currency_code, :sub_total, :total,
|
@@ -25,15 +25,24 @@ module ChargeBee
|
|
25
25
|
attr_accessor :parent_id, :payment_owner_id, :invoice_owner_id
|
26
26
|
end
|
27
27
|
|
28
|
+
class ParentAccountAccess < Model
|
29
|
+
attr_accessor :portal_edit_child_subscriptions, :portal_download_child_invoices, :send_subscription_emails, :send_invoice_emails, :send_payment_emails
|
30
|
+
end
|
31
|
+
|
32
|
+
class ChildAccountAccess < Model
|
33
|
+
attr_accessor :portal_edit_subscriptions, :portal_download_invoices, :send_subscription_emails, :send_invoice_emails, :send_payment_emails
|
34
|
+
end
|
35
|
+
|
28
36
|
attr_accessor :id, :first_name, :last_name, :email, :phone, :company, :vat_number, :auto_collection,
|
29
|
-
:net_term_days, :vat_number_validated_time, :vat_number_status, :allow_direct_debit,
|
30
|
-
:created_at, :created_from_ip, :exemption_details, :taxability, :entity_code,
|
31
|
-
:resource_version, :updated_at, :locale, :
|
37
|
+
:offline_payment_method, :net_term_days, :vat_number_validated_time, :vat_number_status, :allow_direct_debit,
|
38
|
+
:is_location_valid, :created_at, :created_from_ip, :exemption_details, :taxability, :entity_code,
|
39
|
+
:exempt_number, :resource_version, :updated_at, :locale, :billing_date, :billing_date_mode,
|
32
40
|
:billing_day_of_week, :billing_day_of_week_mode, :pii_cleared, :card_status, :fraud_flag, :primary_payment_source_id,
|
33
41
|
:backup_payment_source_id, :billing_address, :referral_urls, :contacts, :payment_method, :invoice_notes,
|
34
42
|
:preferred_currency_code, :promotional_credits, :unbilled_charges, :refundable_credits, :excess_payments,
|
35
|
-
:balances, :meta_data, :deleted, :registered_for_gst, :
|
36
|
-
:client_profile_id, :relationship
|
43
|
+
:balances, :meta_data, :deleted, :registered_for_gst, :consolidated_invoicing, :customer_type,
|
44
|
+
:business_customer_without_vat_number, :client_profile_id, :relationship, :use_default_hierarchy_settings,
|
45
|
+
:parent_account_access, :child_account_access
|
37
46
|
|
38
47
|
# OPERATIONS
|
39
48
|
#-----------
|
@@ -134,5 +143,9 @@ module ChargeBee
|
|
134
143
|
Request.send('get', uri_path("customers",id.to_s,"hierarchy"), params, env, headers)
|
135
144
|
end
|
136
145
|
|
146
|
+
def self.update_hierarchy_settings(id, params={}, env=nil, headers={})
|
147
|
+
Request.send('post', uri_path("customers",id.to_s,"update_hierarchy_settings"), params, env, headers)
|
148
|
+
end
|
149
|
+
|
137
150
|
end # ~Customer
|
138
151
|
end # ~ChargeBee
|
@@ -47,7 +47,7 @@ module ChargeBee
|
|
47
47
|
Request.send('post', uri_path("estimates","gift_subscription"), params, env, headers)
|
48
48
|
end
|
49
49
|
|
50
|
-
def self.create_invoice(params, env=nil, headers={})
|
50
|
+
def self.create_invoice(params={}, env=nil, headers={})
|
51
51
|
Request.send('post', uri_path("estimates","create_invoice"), params, env, headers)
|
52
52
|
end
|
53
53
|
|
@@ -2,7 +2,7 @@ module ChargeBee
|
|
2
2
|
class Invoice < Model
|
3
3
|
|
4
4
|
class LineItem < Model
|
5
|
-
attr_accessor :id, :subscription_id, :date_from, :date_to, :unit_amount, :quantity, :amount, :pricing_model, :is_taxed, :tax_amount, :tax_rate, :discount_amount, :item_level_discount_amount, :description, :entity_type, :tax_exempt_reason, :entity_id, :customer_id
|
5
|
+
attr_accessor :id, :subscription_id, :date_from, :date_to, :unit_amount, :quantity, :amount, :pricing_model, :is_taxed, :tax_amount, :tax_rate, :unit_amount_in_decimal, :quantity_in_decimal, :amount_in_decimal, :discount_amount, :item_level_discount_amount, :description, :entity_description, :entity_type, :tax_exempt_reason, :entity_id, :customer_id
|
6
6
|
end
|
7
7
|
|
8
8
|
class Discount < Model
|
@@ -22,7 +22,7 @@ module ChargeBee
|
|
22
22
|
end
|
23
23
|
|
24
24
|
class LineItemTier < Model
|
25
|
-
attr_accessor :line_item_id, :starting_unit, :ending_unit, :quantity_used, :unit_amount
|
25
|
+
attr_accessor :line_item_id, :starting_unit, :ending_unit, :quantity_used, :unit_amount, :starting_unit_in_decimal, :ending_unit_in_decimal, :quantity_used_in_decimal, :unit_amount_in_decimal
|
26
26
|
end
|
27
27
|
|
28
28
|
class LinkedPayment < Model
|
@@ -34,15 +34,15 @@ module ChargeBee
|
|
34
34
|
end
|
35
35
|
|
36
36
|
class AppliedCredit < Model
|
37
|
-
attr_accessor :cn_id, :applied_amount, :applied_at, :cn_reason_code, :cn_date, :cn_status
|
37
|
+
attr_accessor :cn_id, :applied_amount, :applied_at, :cn_reason_code, :cn_create_reason_code, :cn_date, :cn_status
|
38
38
|
end
|
39
39
|
|
40
40
|
class AdjustmentCreditNote < Model
|
41
|
-
attr_accessor :cn_id, :cn_reason_code, :cn_date, :cn_total, :cn_status
|
41
|
+
attr_accessor :cn_id, :cn_reason_code, :cn_create_reason_code, :cn_date, :cn_total, :cn_status
|
42
42
|
end
|
43
43
|
|
44
44
|
class IssuedCreditNote < Model
|
45
|
-
attr_accessor :cn_id, :cn_reason_code, :cn_date, :cn_total, :cn_status
|
45
|
+
attr_accessor :cn_id, :cn_reason_code, :cn_create_reason_code, :cn_date, :cn_total, :cn_status
|
46
46
|
end
|
47
47
|
|
48
48
|
class LinkedOrder < Model
|
@@ -69,12 +69,12 @@ module ChargeBee
|
|
69
69
|
:expected_payment_date, :amount_to_collect, :round_off_amount, :line_items, :discounts, :line_item_discounts,
|
70
70
|
:taxes, :line_item_taxes, :line_item_tiers, :linked_payments, :dunning_attempts, :applied_credits,
|
71
71
|
:adjustment_credit_notes, :issued_credit_notes, :linked_orders, :notes, :shipping_address, :billing_address,
|
72
|
-
:payment_owner, :deleted
|
72
|
+
:payment_owner, :void_reason_code, :deleted
|
73
73
|
|
74
74
|
# OPERATIONS
|
75
75
|
#-----------
|
76
76
|
|
77
|
-
def self.create(params, env=nil, headers={})
|
77
|
+
def self.create(params={}, env=nil, headers={})
|
78
78
|
Request.send('post', uri_path("invoices"), params, env, headers)
|
79
79
|
end
|
80
80
|
|
@@ -2,7 +2,7 @@ module ChargeBee
|
|
2
2
|
class InvoiceEstimate < Model
|
3
3
|
|
4
4
|
class LineItem < Model
|
5
|
-
attr_accessor :id, :subscription_id, :date_from, :date_to, :unit_amount, :quantity, :amount, :pricing_model, :is_taxed, :tax_amount, :tax_rate, :discount_amount, :item_level_discount_amount, :description, :entity_type, :tax_exempt_reason, :entity_id, :customer_id
|
5
|
+
attr_accessor :id, :subscription_id, :date_from, :date_to, :unit_amount, :quantity, :amount, :pricing_model, :is_taxed, :tax_amount, :tax_rate, :unit_amount_in_decimal, :quantity_in_decimal, :amount_in_decimal, :discount_amount, :item_level_discount_amount, :description, :entity_description, :entity_type, :tax_exempt_reason, :entity_id, :customer_id
|
6
6
|
end
|
7
7
|
|
8
8
|
class Discount < Model
|
@@ -18,7 +18,7 @@ module ChargeBee
|
|
18
18
|
end
|
19
19
|
|
20
20
|
class LineItemTier < Model
|
21
|
-
attr_accessor :line_item_id, :starting_unit, :ending_unit, :quantity_used, :unit_amount
|
21
|
+
attr_accessor :line_item_id, :starting_unit, :ending_unit, :quantity_used, :unit_amount, :starting_unit_in_decimal, :ending_unit_in_decimal, :quantity_used_in_decimal, :unit_amount_in_decimal
|
22
22
|
end
|
23
23
|
|
24
24
|
class LineItemDiscount < Model
|
@@ -21,20 +21,20 @@ module ChargeBee
|
|
21
21
|
instance_eval do
|
22
22
|
values.each do |k, v|
|
23
23
|
set_val = nil
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
24
|
+
next if v.is_a?(Hash) && @dependant_types[k] != nil
|
25
|
+
|
26
|
+
set_val = if v.is_a?(Hash)
|
27
|
+
(@sub_types[k] != nil) ? @sub_types[k].construct(v) : v
|
28
|
+
elsif v.is_a?(Array)
|
29
|
+
if @sub_types[k] != nil
|
30
|
+
v.map { |item| @sub_types[k].construct(item)}
|
31
|
+
else
|
32
|
+
v
|
33
|
+
end
|
34
|
+
else
|
35
|
+
v
|
36
|
+
end
|
37
|
+
|
38
38
|
instance_variable_set("@#{k}", set_val)
|
39
39
|
end
|
40
40
|
end
|
@@ -45,6 +45,10 @@ module ChargeBee
|
|
45
45
|
Request.send('post', uri_path("orders",id.to_s), params, env, headers)
|
46
46
|
end
|
47
47
|
|
48
|
+
def self.import_order(params, env=nil, headers={})
|
49
|
+
Request.send('post', uri_path("orders","import_order"), params, env, headers)
|
50
|
+
end
|
51
|
+
|
48
52
|
def self.assign_order_number(id, env=nil, headers={})
|
49
53
|
Request.send('post', uri_path("orders",id.to_s,"assign_order_number"), {}, env, headers)
|
50
54
|
end
|
@@ -65,6 +69,10 @@ module ChargeBee
|
|
65
69
|
Request.send('get', uri_path("orders",id.to_s), {}, env, headers)
|
66
70
|
end
|
67
71
|
|
72
|
+
def self.delete(id, env=nil, headers={})
|
73
|
+
Request.send('post', uri_path("orders",id.to_s,"delete"), {}, env, headers)
|
74
|
+
end
|
75
|
+
|
68
76
|
def self.list(params={}, env=nil, headers={})
|
69
77
|
Request.send_list_request('get', uri_path("orders"), params, env, headers)
|
70
78
|
end
|
@@ -2,11 +2,12 @@ module ChargeBee
|
|
2
2
|
class PaymentIntent < Model
|
3
3
|
|
4
4
|
class PaymentAttempt < Model
|
5
|
-
attr_accessor :id, :status, :id_at_gateway, :error_code, :error_text, :created_at, :modified_at
|
5
|
+
attr_accessor :id, :status, :payment_method_type, :id_at_gateway, :error_code, :error_text, :created_at, :modified_at
|
6
6
|
end
|
7
7
|
|
8
8
|
attr_accessor :id, :status, :currency_code, :amount, :gateway_account_id, :expires_at, :reference_id,
|
9
|
-
:created_at, :modified_at, :
|
9
|
+
:payment_method_type, :created_at, :modified_at, :resource_version, :updated_at, :customer_id,
|
10
|
+
:gateway, :active_payment_attempt
|
10
11
|
|
11
12
|
# OPERATIONS
|
12
13
|
#-----------
|
@@ -2,7 +2,7 @@ module ChargeBee
|
|
2
2
|
class Plan < Model
|
3
3
|
|
4
4
|
class Tier < Model
|
5
|
-
attr_accessor :starting_unit, :ending_unit, :price
|
5
|
+
attr_accessor :starting_unit, :ending_unit, :price, :starting_unit_in_decimal, :ending_unit_in_decimal, :price_in_decimal
|
6
6
|
end
|
7
7
|
|
8
8
|
class ApplicableAddon < Model
|
@@ -10,11 +10,11 @@ module ChargeBee
|
|
10
10
|
end
|
11
11
|
|
12
12
|
class AttachedAddon < Model
|
13
|
-
attr_accessor :id, :quantity, :billing_cycles, :type
|
13
|
+
attr_accessor :id, :quantity, :billing_cycles, :type, :quantity_in_decimal
|
14
14
|
end
|
15
15
|
|
16
16
|
class EventBasedAddon < Model
|
17
|
-
attr_accessor :id, :quantity, :on_event, :charge_once
|
17
|
+
attr_accessor :id, :quantity, :on_event, :charge_once, :quantity_in_decimal
|
18
18
|
end
|
19
19
|
|
20
20
|
attr_accessor :id, :name, :invoice_name, :description, :price, :currency_code, :period, :period_unit,
|
@@ -23,8 +23,9 @@ module ChargeBee
|
|
23
23
|
:enabled_in_portal, :addon_applicability, :tax_code, :taxjar_product_code, :avalara_sale_type,
|
24
24
|
:avalara_transaction_type, :avalara_service_type, :sku, :accounting_code, :accounting_category1,
|
25
25
|
:accounting_category2, :is_shippable, :shipping_frequency_period, :shipping_frequency_period_unit,
|
26
|
-
:resource_version, :updated_at, :giftable, :claim_url, :
|
27
|
-
:meta_data, :tiers, :applicable_addons, :attached_addons,
|
26
|
+
:resource_version, :updated_at, :giftable, :claim_url, :free_quantity_in_decimal, :price_in_decimal,
|
27
|
+
:invoice_notes, :taxable, :tax_profile_id, :meta_data, :tiers, :applicable_addons, :attached_addons,
|
28
|
+
:event_based_addons, :show_description_in_invoices, :show_description_in_quotes
|
28
29
|
|
29
30
|
# OPERATIONS
|
30
31
|
#-----------
|
@@ -1,8 +1,8 @@
|
|
1
1
|
module ChargeBee
|
2
2
|
class PromotionalCredit < Model
|
3
3
|
|
4
|
-
attr_accessor :id, :customer_id, :type, :amount, :currency_code, :description,
|
5
|
-
:reference, :closing_balance, :done_by, :created_at
|
4
|
+
attr_accessor :id, :customer_id, :type, :amount_in_decimal, :amount, :currency_code, :description,
|
5
|
+
:credit_type, :reference, :closing_balance, :done_by, :created_at
|
6
6
|
|
7
7
|
# OPERATIONS
|
8
8
|
#-----------
|
@@ -2,7 +2,7 @@ module ChargeBee
|
|
2
2
|
class Quote < Model
|
3
3
|
|
4
4
|
class LineItem < Model
|
5
|
-
attr_accessor :id, :subscription_id, :date_from, :date_to, :unit_amount, :quantity, :amount, :pricing_model, :is_taxed, :tax_amount, :tax_rate, :discount_amount, :item_level_discount_amount, :description, :entity_type, :tax_exempt_reason, :entity_id, :customer_id
|
5
|
+
attr_accessor :id, :subscription_id, :date_from, :date_to, :unit_amount, :quantity, :amount, :pricing_model, :is_taxed, :tax_amount, :tax_rate, :unit_amount_in_decimal, :quantity_in_decimal, :amount_in_decimal, :discount_amount, :item_level_discount_amount, :description, :entity_description, :entity_type, :tax_exempt_reason, :entity_id, :customer_id
|
6
6
|
end
|
7
7
|
|
8
8
|
class Discount < Model
|
@@ -30,10 +30,10 @@ module ChargeBee
|
|
30
30
|
end
|
31
31
|
|
32
32
|
attr_accessor :id, :name, :po_number, :customer_id, :subscription_id, :invoice_id, :status,
|
33
|
-
:operation_type, :vat_number, :price_type, :valid_till, :date, :
|
34
|
-
:
|
35
|
-
:
|
36
|
-
:shipping_address, :billing_address
|
33
|
+
:operation_type, :vat_number, :price_type, :valid_till, :date, :total_payable, :charge_on_acceptance,
|
34
|
+
:sub_total, :total, :credits_applied, :amount_paid, :amount_due, :version, :resource_version,
|
35
|
+
:updated_at, :line_items, :discounts, :line_item_discounts, :taxes, :line_item_taxes, :currency_code,
|
36
|
+
:notes, :shipping_address, :billing_address, :contract_term_start, :contract_term_end, :contract_term_termination_fee
|
37
37
|
|
38
38
|
# OPERATIONS
|
39
39
|
#-----------
|
@@ -46,14 +46,26 @@ module ChargeBee
|
|
46
46
|
Request.send('post', uri_path("customers",id.to_s,"create_subscription_quote"), params, env, headers)
|
47
47
|
end
|
48
48
|
|
49
|
+
def self.edit_create_sub_for_customer_quote(id, params, env=nil, headers={})
|
50
|
+
Request.send('post', uri_path("quotes",id.to_s,"edit_create_subscription_quote"), params, env, headers)
|
51
|
+
end
|
52
|
+
|
49
53
|
def self.update_subscription_quote(params, env=nil, headers={})
|
50
54
|
Request.send('post', uri_path("quotes","update_subscription_quote"), params, env, headers)
|
51
55
|
end
|
52
56
|
|
57
|
+
def self.edit_update_subscription_quote(id, params={}, env=nil, headers={})
|
58
|
+
Request.send('post', uri_path("quotes",id.to_s,"edit_update_subscription_quote"), params, env, headers)
|
59
|
+
end
|
60
|
+
|
53
61
|
def self.create_for_onetime_charges(params, env=nil, headers={})
|
54
62
|
Request.send('post', uri_path("quotes","create_for_onetime_charges"), params, env, headers)
|
55
63
|
end
|
56
64
|
|
65
|
+
def self.edit_one_time_quote(id, params={}, env=nil, headers={})
|
66
|
+
Request.send('post', uri_path("quotes",id.to_s,"edit_one_time_quote"), params, env, headers)
|
67
|
+
end
|
68
|
+
|
57
69
|
def self.list(params={}, env=nil, headers={})
|
58
70
|
Request.send_list_request('get', uri_path("quotes"), params, env, headers)
|
59
71
|
end
|
@@ -70,6 +82,10 @@ module ChargeBee
|
|
70
82
|
Request.send('post', uri_path("quotes",id.to_s,"update_status"), params, env, headers)
|
71
83
|
end
|
72
84
|
|
85
|
+
def self.extend_expiry_date(id, params, env=nil, headers={})
|
86
|
+
Request.send('post', uri_path("quotes",id.to_s,"extend_expiry_date"), params, env, headers)
|
87
|
+
end
|
88
|
+
|
73
89
|
def self.delete(id, params={}, env=nil, headers={})
|
74
90
|
Request.send('post', uri_path("quotes",id.to_s,"delete"), params, env, headers)
|
75
91
|
end
|
@@ -2,7 +2,7 @@ module ChargeBee
|
|
2
2
|
class QuoteLineGroup < Model
|
3
3
|
|
4
4
|
class LineItem < Model
|
5
|
-
attr_accessor :id, :subscription_id, :date_from, :date_to, :unit_amount, :quantity, :amount, :pricing_model, :is_taxed, :tax_amount, :tax_rate, :discount_amount, :item_level_discount_amount, :description, :entity_type, :tax_exempt_reason, :entity_id, :customer_id
|
5
|
+
attr_accessor :id, :subscription_id, :date_from, :date_to, :unit_amount, :quantity, :amount, :pricing_model, :is_taxed, :tax_amount, :tax_rate, :unit_amount_in_decimal, :quantity_in_decimal, :amount_in_decimal, :discount_amount, :item_level_discount_amount, :description, :entity_description, :entity_type, :tax_exempt_reason, :entity_id, :customer_id
|
6
6
|
end
|
7
7
|
|
8
8
|
class Discount < Model
|
@@ -21,8 +21,9 @@ module ChargeBee
|
|
21
21
|
attr_accessor :line_item_id, :tax_name, :tax_rate, :is_partial_tax_applied, :is_non_compliance_tax, :taxable_amount, :tax_amount, :tax_juris_type, :tax_juris_name, :tax_juris_code, :tax_amount_in_local_currency, :local_currency_code
|
22
22
|
end
|
23
23
|
|
24
|
-
attr_accessor :id, :sub_total, :total, :credits_applied, :amount_paid, :amount_due,
|
25
|
-
:billing_cycle_number, :line_items, :discounts, :line_item_discounts, :taxes,
|
24
|
+
attr_accessor :version, :id, :sub_total, :total, :credits_applied, :amount_paid, :amount_due,
|
25
|
+
:charge_event, :billing_cycle_number, :line_items, :discounts, :line_item_discounts, :taxes,
|
26
|
+
:line_item_taxes
|
26
27
|
|
27
28
|
# OPERATIONS
|
28
29
|
#-----------
|
@@ -0,0 +1,24 @@
|
|
1
|
+
module ChargeBee
|
2
|
+
class QuotedSubscription < Model
|
3
|
+
|
4
|
+
class Addon < Model
|
5
|
+
attr_accessor :id, :quantity, :unit_price, :amount, :trial_end, :remaining_billing_cycles, :quantity_in_decimal, :unit_price_in_decimal, :amount_in_decimal
|
6
|
+
end
|
7
|
+
|
8
|
+
class EventBasedAddon < Model
|
9
|
+
attr_accessor :id, :quantity, :unit_price, :service_period_in_days, :on_event, :charge_once, :quantity_in_decimal, :unit_price_in_decimal
|
10
|
+
end
|
11
|
+
|
12
|
+
class Coupon < Model
|
13
|
+
attr_accessor :coupon_id, :apply_till, :applied_count, :coupon_code
|
14
|
+
end
|
15
|
+
|
16
|
+
attr_accessor :id, :plan_id, :plan_quantity, :plan_unit_price, :setup_fee, :billing_period,
|
17
|
+
:billing_period_unit, :start_date, :trial_end, :remaining_billing_cycles, :po_number, :auto_collection,
|
18
|
+
:addons, :event_based_addons, :coupons
|
19
|
+
|
20
|
+
# OPERATIONS
|
21
|
+
#-----------
|
22
|
+
|
23
|
+
end # ~QuotedSubscription
|
24
|
+
end # ~ChargeBee
|
@@ -2,11 +2,11 @@ module ChargeBee
|
|
2
2
|
class Subscription < Model
|
3
3
|
|
4
4
|
class Addon < Model
|
5
|
-
attr_accessor :id, :quantity, :unit_price, :amount, :trial_end, :remaining_billing_cycles
|
5
|
+
attr_accessor :id, :quantity, :unit_price, :amount, :trial_end, :remaining_billing_cycles, :quantity_in_decimal, :unit_price_in_decimal, :amount_in_decimal
|
6
6
|
end
|
7
7
|
|
8
8
|
class EventBasedAddon < Model
|
9
|
-
attr_accessor :id, :quantity, :unit_price, :service_period_in_days, :on_event, :charge_once
|
9
|
+
attr_accessor :id, :quantity, :unit_price, :service_period_in_days, :on_event, :charge_once, :quantity_in_decimal, :unit_price_in_decimal
|
10
10
|
end
|
11
11
|
|
12
12
|
class ChargedEventBasedAddon < Model
|
@@ -29,15 +29,17 @@ module ChargeBee
|
|
29
29
|
attr_accessor :id, :status, :contract_start, :contract_end, :billing_cycle, :action_at_term_end, :total_contract_value, :cancellation_cutoff_period, :created_at, :subscription_id, :remaining_billing_cycles
|
30
30
|
end
|
31
31
|
|
32
|
-
attr_accessor :id, :
|
33
|
-
:
|
34
|
-
:
|
35
|
-
:
|
32
|
+
attr_accessor :id, :currency_code, :plan_id, :plan_quantity, :plan_unit_price, :setup_fee, :billing_period,
|
33
|
+
:billing_period_unit, :start_date, :trial_end, :remaining_billing_cycles, :po_number, :auto_collection,
|
34
|
+
:customer_id, :plan_amount, :plan_free_quantity, :status, :trial_start, :current_term_start,
|
35
|
+
:current_term_end, :next_billing_at, :created_at, :started_at, :activated_at, :gift_id, :contract_term_billing_cycle_on_renewal,
|
36
36
|
:override_relationship, :pause_date, :resume_date, :cancelled_at, :cancel_reason, :affiliate_token,
|
37
37
|
:created_from_ip, :resource_version, :updated_at, :has_scheduled_changes, :payment_source_id,
|
38
|
-
:
|
39
|
-
:
|
40
|
-
:
|
38
|
+
:plan_free_quantity_in_decimal, :plan_quantity_in_decimal, :plan_unit_price_in_decimal, :plan_amount_in_decimal,
|
39
|
+
:offline_payment_method, :due_invoices_count, :due_since, :total_dues, :mrr, :exchange_rate,
|
40
|
+
:base_currency_code, :addons, :event_based_addons, :charged_event_based_addons, :coupon, :coupons,
|
41
|
+
:shipping_address, :referral_info, :invoice_notes, :meta_data, :deleted, :contract_term, :cancel_reason_code,
|
42
|
+
:free_period, :free_period_unit
|
41
43
|
|
42
44
|
# OPERATIONS
|
43
45
|
#-----------
|
@@ -90,10 +92,6 @@ module ChargeBee
|
|
90
92
|
Request.send('post', uri_path("subscriptions",id.to_s,"change_term_end"), params, env, headers)
|
91
93
|
end
|
92
94
|
|
93
|
-
def self.cancel(id, params={}, env=nil, headers={})
|
94
|
-
Request.send('post', uri_path("subscriptions",id.to_s,"cancel"), params, env, headers)
|
95
|
-
end
|
96
|
-
|
97
95
|
def self.reactivate(id, params={}, env=nil, headers={})
|
98
96
|
Request.send('post', uri_path("subscriptions",id.to_s,"reactivate"), params, env, headers)
|
99
97
|
end
|
@@ -118,6 +116,10 @@ module ChargeBee
|
|
118
116
|
Request.send('post', uri_path("customers",id.to_s,"import_subscription"), params, env, headers)
|
119
117
|
end
|
120
118
|
|
119
|
+
def self.import_contract_term(id, params={}, env=nil, headers={})
|
120
|
+
Request.send('post', uri_path("subscriptions",id.to_s,"import_contract_term"), params, env, headers)
|
121
|
+
end
|
122
|
+
|
121
123
|
def self.override_billing_profile(id, params={}, env=nil, headers={})
|
122
124
|
Request.send('post', uri_path("subscriptions",id.to_s,"override_billing_profile"), params, env, headers)
|
123
125
|
end
|
@@ -130,6 +132,10 @@ module ChargeBee
|
|
130
132
|
Request.send('post', uri_path("subscriptions",id.to_s,"pause"), params, env, headers)
|
131
133
|
end
|
132
134
|
|
135
|
+
def self.cancel(id, params={}, env=nil, headers={})
|
136
|
+
Request.send('post', uri_path("subscriptions",id.to_s,"cancel"), params, env, headers)
|
137
|
+
end
|
138
|
+
|
133
139
|
def self.resume(id, params={}, env=nil, headers={})
|
134
140
|
Request.send('post', uri_path("subscriptions",id.to_s,"resume"), params, env, headers)
|
135
141
|
end
|
@@ -6,7 +6,7 @@ module ChargeBee
|
|
6
6
|
end
|
7
7
|
|
8
8
|
class LinkedCreditNote < Model
|
9
|
-
attr_accessor :cn_id, :applied_amount, :applied_at, :cn_reason_code, :cn_date, :cn_total, :cn_status, :cn_reference_invoice_id
|
9
|
+
attr_accessor :cn_id, :applied_amount, :applied_at, :cn_reason_code, :cn_create_reason_code, :cn_date, :cn_total, :cn_status, :cn_reference_invoice_id
|
10
10
|
end
|
11
11
|
|
12
12
|
class LinkedRefund < Model
|
@@ -40,6 +40,10 @@ module ChargeBee
|
|
40
40
|
Request.send('post', uri_path("transactions",id.to_s,"record_refund"), params, env, headers)
|
41
41
|
end
|
42
42
|
|
43
|
+
def self.refund(id, params={}, env=nil, headers={})
|
44
|
+
Request.send('post', uri_path("transactions",id.to_s,"refund"), params, env, headers)
|
45
|
+
end
|
46
|
+
|
43
47
|
def self.list(params={}, env=nil, headers={})
|
44
48
|
Request.send_list_request('get', uri_path("transactions"), params, env, headers)
|
45
49
|
end
|
@@ -2,12 +2,13 @@ module ChargeBee
|
|
2
2
|
class UnbilledCharge < Model
|
3
3
|
|
4
4
|
class Tier < Model
|
5
|
-
attr_accessor :starting_unit, :ending_unit, :quantity_used, :unit_amount
|
5
|
+
attr_accessor :starting_unit, :ending_unit, :quantity_used, :unit_amount, :starting_unit_in_decimal, :ending_unit_in_decimal, :quantity_used_in_decimal, :unit_amount_in_decimal
|
6
6
|
end
|
7
7
|
|
8
8
|
attr_accessor :id, :customer_id, :subscription_id, :date_from, :date_to, :unit_amount, :pricing_model,
|
9
9
|
:quantity, :amount, :currency_code, :discount_amount, :description, :entity_type, :entity_id,
|
10
|
-
:is_voided, :voided_at, :
|
10
|
+
:is_voided, :voided_at, :unit_amount_in_decimal, :quantity_in_decimal, :amount_in_decimal, :tiers,
|
11
|
+
:deleted
|
11
12
|
|
12
13
|
# OPERATIONS
|
13
14
|
#-----------
|
@@ -24,6 +24,10 @@ module ChargeBee
|
|
24
24
|
Request.send_list_request('get', uri_path("virtual_bank_accounts"), params, env, headers)
|
25
25
|
end
|
26
26
|
|
27
|
+
def self.delete(id, env=nil, headers={})
|
28
|
+
Request.send('post', uri_path("virtual_bank_accounts",id.to_s,"delete"), {}, env, headers)
|
29
|
+
end
|
30
|
+
|
27
31
|
def self.delete_local(id, env=nil, headers={})
|
28
32
|
Request.send('post', uri_path("virtual_bank_accounts",id.to_s,"delete_local"), {}, env, headers)
|
29
33
|
end
|
data/lib/chargebee/result.rb
CHANGED
@@ -16,9 +16,15 @@ module ChargeBee
|
|
16
16
|
return contract_term;
|
17
17
|
end
|
18
18
|
|
19
|
+
def advance_invoice_schedule()
|
20
|
+
advance_invoice_schedule = get(:advance_invoice_schedule, AdvanceInvoiceSchedule,
|
21
|
+
{:fixed_interval_schedule => AdvanceInvoiceSchedule::FixedIntervalSchedule, :specific_dates_schedule => AdvanceInvoiceSchedule::SpecificDatesSchedule});
|
22
|
+
return advance_invoice_schedule;
|
23
|
+
end
|
24
|
+
|
19
25
|
def customer()
|
20
26
|
customer = get(:customer, Customer,
|
21
|
-
{:billing_address => Customer::BillingAddress, :referral_urls => Customer::ReferralUrl, :contacts => Customer::Contact, :payment_method => Customer::PaymentMethod, :balances => Customer::Balance, :relationship => Customer::Relationship});
|
27
|
+
{:billing_address => Customer::BillingAddress, :referral_urls => Customer::ReferralUrl, :contacts => Customer::Contact, :payment_method => Customer::PaymentMethod, :balances => Customer::Balance, :relationship => Customer::Relationship, :parent_account_access => Customer::ParentAccountAccess, :child_account_access => Customer::ChildAccountAccess});
|
22
28
|
return customer;
|
23
29
|
end
|
24
30
|
|
@@ -128,6 +134,12 @@ module ChargeBee
|
|
128
134
|
return quote;
|
129
135
|
end
|
130
136
|
|
137
|
+
def quoted_subscription()
|
138
|
+
quoted_subscription = get(:quoted_subscription, QuotedSubscription,
|
139
|
+
{:addons => QuotedSubscription::Addon, :event_based_addons => QuotedSubscription::EventBasedAddon, :coupons => QuotedSubscription::Coupon});
|
140
|
+
return quoted_subscription;
|
141
|
+
end
|
142
|
+
|
131
143
|
def quote_line_group()
|
132
144
|
quote_line_group = get(:quote_line_group, QuoteLineGroup,
|
133
145
|
{:line_items => QuoteLineGroup::LineItem, :discounts => QuoteLineGroup::Discount, :line_item_discounts => QuoteLineGroup::LineItemDiscount, :taxes => QuoteLineGroup::Tax, :line_item_taxes => QuoteLineGroup::LineItemTax});
|
@@ -228,6 +240,12 @@ module ChargeBee
|
|
228
240
|
return credit_notes;
|
229
241
|
end
|
230
242
|
|
243
|
+
def advance_invoice_schedules()
|
244
|
+
advance_invoice_schedules = get_list(:advance_invoice_schedules, AdvanceInvoiceSchedule,
|
245
|
+
{:fixed_interval_schedule => AdvanceInvoiceSchedule::FixedIntervalSchedule, :specific_dates_schedule => AdvanceInvoiceSchedule::SpecificDatesSchedule});
|
246
|
+
return advance_invoice_schedules;
|
247
|
+
end
|
248
|
+
|
231
249
|
def hierarchies()
|
232
250
|
hierarchies = get_list(:hierarchies, Hierarchy,
|
233
251
|
{});
|
@@ -240,8 +258,9 @@ module ChargeBee
|
|
240
258
|
return invoices;
|
241
259
|
end
|
242
260
|
|
243
|
-
|
244
|
-
|
261
|
+
|
262
|
+
def to_s(*args)
|
263
|
+
JSON.pretty_generate(@response)
|
245
264
|
end
|
246
265
|
|
247
266
|
private
|
@@ -255,7 +274,7 @@ module ChargeBee
|
|
255
274
|
when Hash
|
256
275
|
model = klass.construct(obj, sub_types, dependant_types)
|
257
276
|
dependant_sub_types.each do |k,v|
|
258
|
-
|
277
|
+
model.init_dependant(obj, k, v);
|
259
278
|
end
|
260
279
|
set_val.push(model)
|
261
280
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chargebee
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rajaraman S
|
@@ -9,68 +9,68 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2020-
|
12
|
+
date: 2020-11-16 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: json_pure
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
17
17
|
requirements:
|
18
|
-
- - ~>
|
18
|
+
- - "~>"
|
19
19
|
- !ruby/object:Gem::Version
|
20
20
|
version: '2.1'
|
21
21
|
type: :runtime
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
|
-
- - ~>
|
25
|
+
- - "~>"
|
26
26
|
- !ruby/object:Gem::Version
|
27
27
|
version: '2.1'
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: rest-client
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
31
31
|
requirements:
|
32
|
-
- -
|
32
|
+
- - ">="
|
33
33
|
- !ruby/object:Gem::Version
|
34
34
|
version: '1.8'
|
35
|
-
- - <
|
35
|
+
- - "<"
|
36
36
|
- !ruby/object:Gem::Version
|
37
37
|
version: '3.0'
|
38
38
|
type: :runtime
|
39
39
|
prerelease: false
|
40
40
|
version_requirements: !ruby/object:Gem::Requirement
|
41
41
|
requirements:
|
42
|
-
- -
|
42
|
+
- - ">="
|
43
43
|
- !ruby/object:Gem::Version
|
44
44
|
version: '1.8'
|
45
|
-
- - <
|
45
|
+
- - "<"
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '3.0'
|
48
48
|
- !ruby/object:Gem::Dependency
|
49
49
|
name: rspec
|
50
50
|
requirement: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - ~>
|
52
|
+
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: 3.0.0
|
55
55
|
type: :development
|
56
56
|
prerelease: false
|
57
57
|
version_requirements: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- - ~>
|
59
|
+
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: 3.0.0
|
62
62
|
- !ruby/object:Gem::Dependency
|
63
63
|
name: mocha
|
64
64
|
requirement: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- -
|
66
|
+
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
69
|
type: :development
|
70
70
|
prerelease: false
|
71
71
|
version_requirements: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- -
|
73
|
+
- - ">="
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: '0'
|
76
76
|
description: Subscription Billing - Simple. Secure. Affordable. More details at www.chargebee.com.
|
@@ -95,6 +95,7 @@ files:
|
|
95
95
|
- lib/chargebee/list_result.rb
|
96
96
|
- lib/chargebee/models/addon.rb
|
97
97
|
- lib/chargebee/models/address.rb
|
98
|
+
- lib/chargebee/models/advance_invoice_schedule.rb
|
98
99
|
- lib/chargebee/models/card.rb
|
99
100
|
- lib/chargebee/models/comment.rb
|
100
101
|
- lib/chargebee/models/contact.rb
|
@@ -123,6 +124,7 @@ files:
|
|
123
124
|
- lib/chargebee/models/promotional_credit.rb
|
124
125
|
- lib/chargebee/models/quote.rb
|
125
126
|
- lib/chargebee/models/quote_line_group.rb
|
127
|
+
- lib/chargebee/models/quoted_subscription.rb
|
126
128
|
- lib/chargebee/models/resource_migration.rb
|
127
129
|
- lib/chargebee/models/site_migration_detail.rb
|
128
130
|
- lib/chargebee/models/subscription.rb
|
@@ -149,22 +151,21 @@ licenses:
|
|
149
151
|
metadata: {}
|
150
152
|
post_install_message:
|
151
153
|
rdoc_options:
|
152
|
-
- --charset=UTF-8
|
154
|
+
- "--charset=UTF-8"
|
153
155
|
require_paths:
|
154
156
|
- lib
|
155
157
|
required_ruby_version: !ruby/object:Gem::Requirement
|
156
158
|
requirements:
|
157
|
-
- -
|
159
|
+
- - ">="
|
158
160
|
- !ruby/object:Gem::Version
|
159
161
|
version: 1.9.3
|
160
162
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
161
163
|
requirements:
|
162
|
-
- -
|
164
|
+
- - ">="
|
163
165
|
- !ruby/object:Gem::Version
|
164
166
|
version: '0'
|
165
167
|
requirements: []
|
166
|
-
|
167
|
-
rubygems_version: 2.4.5
|
168
|
+
rubygems_version: 3.0.3
|
168
169
|
signing_key:
|
169
170
|
specification_version: 2
|
170
171
|
summary: Ruby client for Chargebee API.
|