chargebee 2.7.3 → 2.7.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 197dd09db15bf85da90e52d14ce62aa55f2ade0f
4
- data.tar.gz: fa0ce585044c928f1ccafa7bdbdd7cf50e330484
3
+ metadata.gz: 3bc4e637fa00ed6995d79c0c80413b81dcef6c52
4
+ data.tar.gz: 64c223bec7c54c7b365553292cb70350defe9aa6
5
5
  SHA512:
6
- metadata.gz: 0b6583c16b877a491c1b23f462f108a373d22733ac942fd053db4e037b2f33f3d6fb095e5a49fcc1d6238bf69d7a018f8f862d289c60953df9cb29e8f92d7b44
7
- data.tar.gz: dbba0d67043e16315e19818d0720e6bf79beff9a00a6c1751294adb918ffdae5eded515a6fd1144f169dd0a82f5612954499118d185b378ac8317a2d6f4813ce
6
+ metadata.gz: f7421bbfe4074776ffe46c6db1a4ccc0ab16b96cd28364bf7bba728e9098f516c4cb7f9391df8c1e113a2b3e918179ab52e9f98b3225b137900e64c5dccb9094
7
+ data.tar.gz: 09a9c355e90a457be99a1d1451d99077aa752d25754ac58eea2540c9a7a6034da4c14e0ef013fc2627ccdcfc4b1d0cc3b64fa7cef50d388c13febf9b43301883
@@ -1,3 +1,112 @@
1
+ ### v2.7.8 (2020-09-29)
2
+ * * *
3
+
4
+ * New attribute included_in_mrr has been added in addon and coupon resource
5
+ * New attribute offline_payment_method has been added in subscription and customer resource
6
+ * New input parameter included_in_mrr has been added in create_an_addon, update_an_addon, create_a_coupon and update_a_coupon apis.
7
+ * 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
8
+ * New input parameter auto_collection has been added in update_a_subscription
9
+ * 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
10
+ * New input parameter subscription[auto_collection] has been added in checkout_existing_subscription and update_subscription_estimate apis
11
+ * 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
12
+
13
+ ### v2.7.7 (2020-09-09)
14
+ * * *
15
+
16
+ * New input parameter currency_code is added in list_addons, list_coupons, list_plans, export_plans, export_addons, export_coupons apis
17
+ * New attributes powered_by has been added in card resource
18
+ * 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
19
+ * Input parameter invoice[customer_id] is made optional in create_invoice_estimate api
20
+ * Input parameter customer_id is made optional in create_an_invoice
21
+ * Attribute created_at in dunning_attempts is made optional in the invoice resource
22
+ * New attributes free_period and free_period_unit have been added in the Subscription resource
23
+ * New enum type free_period_unit has been added with the values:
24
+ DAY,
25
+ WEEK,
26
+ MONTH,
27
+ YEAR
28
+ * New enum type powered_by has been added in card resource with the values:
29
+ IDEAL,
30
+ SOFORT,
31
+ BANCONTACT,
32
+ GIROPAY,
33
+ NOT_APPLICABLE
34
+ * New endpoint import_contract_term has been added to the subscription resource
35
+ * Attributes status, amount and date inside the linked_payment are made optional in the transaction resource
36
+ * New endpoint delete has been added to the virtual_bank_account resource
37
+ * New values GIROPAY and DOTPAY have been added to the payment_method_types enum
38
+ * New values PAYMENT_SOURCE_EXPIRING and PAYMENT_SOURCE_EXPIRED have been added to the event_type enums
39
+ * New value PAYPAL has been added to the gateway enum
40
+
41
+ ### v2.7.6 (2020-07-15)
42
+ * * *
43
+
44
+ * New attributes show_description_in_invoices, show_description_in_quotes have been added in Addon, Plan resource
45
+ * 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
46
+ * New attribute create_reason_code has been added in Credit notes resource
47
+ * Attribute reason_code is made optional in the Credit notes resource
48
+ * New filter parameter create_reason_code is added in list_credit_notes api
49
+ * New input parameter refund_reason_code has been added in Credit notes' Refund, Record a refund apis
50
+ * Sub-resources parent_account_access and child_account_access have been added in Customer resource
51
+ * New attribute use_default_hierarchy_settings has been added in Customer resource
52
+ * New endpoint update_hierarchy_settings has been added in Customer resource
53
+ * New input parameters use_default_hierarchy_settings, parent_account_access, child_account_access have been added in link_a_customer api
54
+ * 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
55
+ * New input param cancel_reason_code has been added to export_revenue_recognition_reports, export_deferred_revenue_reports, export_subscriptions, export_credit_notes apis
56
+ * New input param coupon_ids has been added to checkout_new_subscription, checkout_existing_subscription apis
57
+ * Input param subscription_coupon has been deprecated in checkout_new_subscription, checkout_existing_subscription apis
58
+ * New attribute void_reason_code has been added to the Invoice resource
59
+ * Attribute cn_reason_code has been made optional in applied_credits, adjustment_credit_notes, issued_credit_notes, linked_credit_note sub-resources
60
+ * New attribute cn_create_reason_code has been added in applied_credits, adjustment_credit_notes, issued_credit_notes, linked_credit_note sub-resources
61
+ * 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
62
+ * Input parameter coupon is deprecated from create_an_invoice api
63
+ * New filter parameter void_reason_code has been added to list_invoices api
64
+ * 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
65
+ * New input parameter void_reason_code has been added to void_an_invoice api
66
+ * New input parameter credit_note[create_reason_code] has been added to refund_an_invoice, record_refund_for_an_invoice api
67
+ * New endpoints import_an_order and delete_an_imported_order have been added to Order resource
68
+ * New filter parameter exclude_deleted_credit_notes has been added to list_orders api
69
+ * New attribute payment_method_type has been added to payment_intent resource and active_payment_attempt sub-resource
70
+ * New input parameter payment_method_type has been added to create_a_payment_intent, update_a_payment_intent api
71
+ * New attributes version, contract_term_start, contract_term_end, contract_term_termination_fee have been added to Quotes resource
72
+ * New endpoints edit_create_subscription_quote, edit_update_subscription_quote, edit_one_time_quote, extend_expiry_date have beed added to Quotes resource
73
+ * 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
74
+ * New attribute version has been added to quote_line_group sub-resource
75
+ * New attribute cancel_reason_code has been added to Subscriptions resource
76
+ * New filter parameter cancel_reason_code has been added to list_subscriptions, cancel_a_subscription apis
77
+ * New input parameter contract_term_billing_cycle_on_renewal has been added to import_a_subscription, import_subscription_for_customer apis
78
+ * New input parameter event_based_addon has been added to cancel_a_subscription api
79
+ * New filter parameter is_voided has been added to list_unbilled_charges api
80
+ * New event_types MRR_UPDATED, ORDER_DELETED have been added
81
+ * New values SOFORT, BANCONTACT have been added to the payment_method_types enum
82
+ * New attributes entity_type_description has been added to the line_items sub-resource
83
+
84
+ ### v2.7.5 (2020-04-03)
85
+ * * *
86
+
87
+ * A subresource contract_term has been added in Subscription resource
88
+ * New endpoint refund_a_credit_note has been added in Credit notes resource
89
+ * New endpoint list_quote_line_groups has been added in Quotes resource
90
+ * New endpoint list_contract_terms_for_a_subscription has been added in Subscriptions resource
91
+ * New input parameter contract_term_billing_cycle_on_renewal, contract_term[action_at_term_end], contract_term[cancellation_cutoff_period] has been added in create_a_subscription, create_subscription_for_customer, update_a_subscription and reactivate_a_subscription apis
92
+ * New input parameter contract_term_cancel_option has been added in cancel_a_subscription api
93
+ * New input parameter contract_term[action_at_term_end], contract_term[cancellation_cutoff_period], subscription[contract_term_billing_cycle_on_renewal] has been added in create_subscription_estimate, create_subscription_for_a_customer_estimate, checkout_new_subscription, checkout_existing_subscription apis
94
+ * New input parameter business_customer_without_vat_number has been added in create_a_customer and update_billing_info_for_a_customer apis
95
+ * New input parameter addons[service_period] replaces the parameter addons[date_from] and addons[date_to] in create_a_quote_for_one-time_charges api
96
+ * New input parameter charges[service_period] replaces the parameter charges[date_from] and charges[date_to] in create_a_quote_for_one-time_charges api
97
+ * New input parameter consolidated_view has been added in retrieve_quote_as_pdf api
98
+ * New input parameter customer[business_customer_without_vat_number] has been added in create_a_subscription, update_a_subscription apis
99
+ * New value CHECKOUT_COM has been added in gateway enum
100
+ * New value CONTRACT_TERMINATION has been added to eventBasedAddons onEvent enum
101
+ * New values IDEAL, GOOGLE_PAY has been added to payment types enum
102
+ * New event types CONTRACT_TERM_CREATED, CONTRACT_TERM_RENEWED, CONTRACT_TERM_TERMINATED, CONTRACT_TERM_COMPLETED, CONTRACT_TERM_CANCELLED have been added
103
+
104
+ ### v2.7.4(2020-02-06)
105
+ * * *
106
+
107
+ * New attribute total_payable and charge_on_aaceptance has been added in Quote.java
108
+ * New input parameter cancel_at has been added in cancel_a_subscription api
109
+
1
110
  ### v2.7.3 (2020-01-10)
2
111
  * * *
3
112
 
data/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License
2
2
 
3
- Copyright (c) 2011-2019 ChargeBee, Inc.
3
+ Copyright (c) 2011-2020 ChargeBee, Inc.
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person
6
6
  obtaining a copy of this software and associated documentation
@@ -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.7.3'
8
- s.date = '2020-01-10'
7
+ s.version = '2.7.8'
8
+ s.date = '2020-09-29'
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."
@@ -43,6 +43,7 @@ Gem::Specification.new do |s|
43
43
  lib/chargebee/models/card.rb
44
44
  lib/chargebee/models/comment.rb
45
45
  lib/chargebee/models/contact.rb
46
+ lib/chargebee/models/contract_term.rb
46
47
  lib/chargebee/models/coupon.rb
47
48
  lib/chargebee/models/coupon_code.rb
48
49
  lib/chargebee/models/coupon_set.rb
@@ -66,6 +67,7 @@ Gem::Specification.new do |s|
66
67
  lib/chargebee/models/portal_session.rb
67
68
  lib/chargebee/models/promotional_credit.rb
68
69
  lib/chargebee/models/quote.rb
70
+ lib/chargebee/models/quote_line_group.rb
69
71
  lib/chargebee/models/resource_migration.rb
70
72
  lib/chargebee/models/site_migration_detail.rb
71
73
  lib/chargebee/models/subscription.rb
@@ -47,7 +47,7 @@ require File.dirname(__FILE__) + '/chargebee/models/payment_intent.rb'
47
47
 
48
48
  module ChargeBee
49
49
 
50
- VERSION = '2.7.3'
50
+ VERSION = '2.7.8'
51
51
 
52
52
  @@default_env = nil
53
53
  @@verify_ca_certs = true
@@ -9,8 +9,8 @@ module ChargeBee
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, :invoice_notes, :taxable, :tax_profile_id,
13
- :meta_data, :tiers
12
+ :shipping_frequency_period_unit, :resource_version, :updated_at, :included_in_mrr, :invoice_notes,
13
+ :taxable, :tax_profile_id, :meta_data, :tiers, :show_description_in_invoices, :show_description_in_quotes
14
14
 
15
15
  # OPERATIONS
16
16
  #-----------
@@ -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, :customer_id, :masked_number
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
  #-----------
@@ -0,0 +1,11 @@
1
+ module ChargeBee
2
+ class ContractTerm < Model
3
+
4
+ attr_accessor :id, :status, :contract_start, :contract_end, :billing_cycle, :action_at_term_end,
5
+ :total_contract_value, :cancellation_cutoff_period, :created_at, :subscription_id, :remaining_billing_cycles
6
+
7
+ # OPERATIONS
8
+ #-----------
9
+
10
+ end # ~ContractTerm
11
+ end # ~ChargeBee
@@ -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, :meta_data
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, :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
@@ -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
  #-----------
@@ -55,6 +55,10 @@ module ChargeBee
55
55
  Request.send('post', uri_path("credit_notes",id.to_s,"pdf"), params, env, headers)
56
56
  end
57
57
 
58
+ def self.refund(id, params={}, env=nil, headers={})
59
+ Request.send('post', uri_path("credit_notes",id.to_s,"refund"), params, env, headers)
60
+ end
61
+
58
62
  def self.record_refund(id, params, env=nil, headers={})
59
63
  Request.send('post', uri_path("credit_notes",id.to_s,"record_refund"), params, env, headers)
60
64
  end
@@ -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, :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
@@ -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, :is_location_valid,
30
- :created_at, :created_from_ip, :exemption_details, :taxability, :entity_code, :exempt_number,
31
- :resource_version, :updated_at, :locale, :consolidated_invoicing, :billing_date, :billing_date_mode,
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, :business_customer_without_vat_number,
36
- :customer_type, :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
 
@@ -1,7 +1,7 @@
1
1
  module ChargeBee
2
2
  class Hierarchy < Model
3
3
 
4
- attr_accessor :parent_id, :payment_owner_id, :invoice_owner_id, :customer_id, :children_ids
4
+ attr_accessor :customer_id, :parent_id, :payment_owner_id, :invoice_owner_id, :children_ids
5
5
 
6
6
  # OPERATIONS
7
7
  #-----------
@@ -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, :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
@@ -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, :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,20 +21,20 @@ module ChargeBee
21
21
  instance_eval do
22
22
  values.each do |k, v|
23
23
  set_val = nil
24
- case v
25
- when Hash && (@dependant_types[k] != nil)
26
- next
27
- when Hash
28
- set_val = (@sub_types[k] != nil) ? @sub_types[k].construct(v) : v
29
- when Array
30
- if(@sub_types[k] != nil)
31
- set_val = v.map { |item| @sub_types[k].construct(item)}
32
- else
33
- set_val = v
34
- end
35
- else
36
- set_val = v
37
- end
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,11 @@ 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, :customer_id, :gateway, :active_payment_attempt
9
+ :payment_method_type, :created_at, :modified_at, :customer_id, :gateway, :active_payment_attempt
10
10
 
11
11
  # OPERATIONS
12
12
  #-----------
@@ -24,7 +24,8 @@ module ChargeBee
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
26
  :resource_version, :updated_at, :giftable, :claim_url, :invoice_notes, :taxable, :tax_profile_id,
27
- :meta_data, :tiers, :applicable_addons, :attached_addons, :event_based_addons
27
+ :meta_data, :tiers, :applicable_addons, :attached_addons, :event_based_addons, :show_description_in_invoices,
28
+ :show_description_in_quotes
28
29
 
29
30
  # OPERATIONS
30
31
  #-----------
@@ -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, :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,9 +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, :sub_total, :total, :credits_applied,
34
- :amount_paid, :amount_due, :resource_version, :updated_at, :currency_code, :line_items, :discounts,
35
- :line_item_discounts, :taxes, :line_item_taxes, :notes, :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
36
37
 
37
38
  # OPERATIONS
38
39
  #-----------
@@ -45,18 +46,34 @@ module ChargeBee
45
46
  Request.send('post', uri_path("customers",id.to_s,"create_subscription_quote"), params, env, headers)
46
47
  end
47
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
+
48
53
  def self.update_subscription_quote(params, env=nil, headers={})
49
54
  Request.send('post', uri_path("quotes","update_subscription_quote"), params, env, headers)
50
55
  end
51
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
+
52
61
  def self.create_for_onetime_charges(params, env=nil, headers={})
53
62
  Request.send('post', uri_path("quotes","create_for_onetime_charges"), params, env, headers)
54
63
  end
55
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
+
56
69
  def self.list(params={}, env=nil, headers={})
57
70
  Request.send_list_request('get', uri_path("quotes"), params, env, headers)
58
71
  end
59
72
 
73
+ def self.quote_line_groups_for_quote(id, params={}, env=nil, headers={})
74
+ Request.send('get', uri_path("quotes",id.to_s,"quote_line_groups"), params, env, headers)
75
+ end
76
+
60
77
  def self.convert(id, params={}, env=nil, headers={})
61
78
  Request.send('post', uri_path("quotes",id.to_s,"convert"), params, env, headers)
62
79
  end
@@ -65,6 +82,10 @@ module ChargeBee
65
82
  Request.send('post', uri_path("quotes",id.to_s,"update_status"), params, env, headers)
66
83
  end
67
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
+
68
89
  def self.delete(id, params={}, env=nil, headers={})
69
90
  Request.send('post', uri_path("quotes",id.to_s,"delete"), params, env, headers)
70
91
  end
@@ -0,0 +1,32 @@
1
+ module ChargeBee
2
+ class QuoteLineGroup < Model
3
+
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_description, :entity_type, :tax_exempt_reason, :entity_id, :customer_id
6
+ end
7
+
8
+ class Discount < Model
9
+ attr_accessor :amount, :description, :entity_type, :entity_id
10
+ end
11
+
12
+ class LineItemDiscount < Model
13
+ attr_accessor :line_item_id, :discount_type, :coupon_id, :discount_amount
14
+ end
15
+
16
+ class Tax < Model
17
+ attr_accessor :name, :amount, :description
18
+ end
19
+
20
+ class LineItemTax < Model
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
+ end
23
+
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
27
+
28
+ # OPERATIONS
29
+ #-----------
30
+
31
+ end # ~QuoteLineGroup
32
+ end # ~ChargeBee
@@ -25,15 +25,20 @@ module ChargeBee
25
25
  attr_accessor :referral_code, :coupon_code, :referrer_id, :external_reference_id, :reward_status, :referral_system, :account_id, :campaign_id, :external_campaign_id, :friend_offer_type, :referrer_reward_type, :notify_referral_system, :destination_url, :post_purchase_widget_enabled
26
26
  end
27
27
 
28
+ class ContractTerm < Model
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
+ end
31
+
28
32
  attr_accessor :id, :customer_id, :currency_code, :plan_id, :plan_quantity, :plan_unit_price,
29
33
  :setup_fee, :plan_amount, :billing_period, :billing_period_unit, :plan_free_quantity, :status,
30
34
  :start_date, :trial_start, :trial_end, :current_term_start, :current_term_end, :next_billing_at,
31
- :remaining_billing_cycles, :po_number, :created_at, :started_at, :activated_at, :gift_id, :override_relationship,
32
- :pause_date, :resume_date, :cancelled_at, :cancel_reason, :affiliate_token, :created_from_ip,
33
- :resource_version, :updated_at, :has_scheduled_changes, :payment_source_id, :auto_collection,
34
- :due_invoices_count, :due_since, :total_dues, :mrr, :exchange_rate, :base_currency_code, :addons,
35
- :event_based_addons, :charged_event_based_addons, :coupon, :coupons, :shipping_address, :referral_info,
36
- :invoice_notes, :meta_data, :deleted
35
+ :remaining_billing_cycles, :po_number, :created_at, :started_at, :activated_at, :gift_id, :contract_term_billing_cycle_on_renewal,
36
+ :override_relationship, :pause_date, :resume_date, :cancelled_at, :cancel_reason, :affiliate_token,
37
+ :created_from_ip, :resource_version, :updated_at, :has_scheduled_changes, :payment_source_id,
38
+ :auto_collection, :offline_payment_method, :due_invoices_count, :due_since,
39
+ :total_dues, :mrr, :exchange_rate, :base_currency_code, :addons, :event_based_addons, :charged_event_based_addons,
40
+ :coupon, :coupons, :shipping_address, :referral_info, :invoice_notes, :meta_data, :deleted,
41
+ :contract_term, :cancel_reason_code, :free_period, :free_period_unit
37
42
 
38
43
  # OPERATIONS
39
44
  #-----------
@@ -54,6 +59,10 @@ module ChargeBee
54
59
  Request.send('get', uri_path("customers",id.to_s,"subscriptions"), params, env, headers)
55
60
  end
56
61
 
62
+ def self.contract_terms_for_subscription(id, params={}, env=nil, headers={})
63
+ Request.send('get', uri_path("subscriptions",id.to_s,"contract_terms"), params, env, headers)
64
+ end
65
+
57
66
  def self.retrieve(id, env=nil, headers={})
58
67
  Request.send('get', uri_path("subscriptions",id.to_s), {}, env, headers)
59
68
  end
@@ -82,10 +91,6 @@ module ChargeBee
82
91
  Request.send('post', uri_path("subscriptions",id.to_s,"change_term_end"), params, env, headers)
83
92
  end
84
93
 
85
- def self.cancel(id, params={}, env=nil, headers={})
86
- Request.send('post', uri_path("subscriptions",id.to_s,"cancel"), params, env, headers)
87
- end
88
-
89
94
  def self.reactivate(id, params={}, env=nil, headers={})
90
95
  Request.send('post', uri_path("subscriptions",id.to_s,"reactivate"), params, env, headers)
91
96
  end
@@ -110,6 +115,10 @@ module ChargeBee
110
115
  Request.send('post', uri_path("customers",id.to_s,"import_subscription"), params, env, headers)
111
116
  end
112
117
 
118
+ def self.import_contract_term(id, params={}, env=nil, headers={})
119
+ Request.send('post', uri_path("subscriptions",id.to_s,"import_contract_term"), params, env, headers)
120
+ end
121
+
113
122
  def self.override_billing_profile(id, params={}, env=nil, headers={})
114
123
  Request.send('post', uri_path("subscriptions",id.to_s,"override_billing_profile"), params, env, headers)
115
124
  end
@@ -122,6 +131,10 @@ module ChargeBee
122
131
  Request.send('post', uri_path("subscriptions",id.to_s,"pause"), params, env, headers)
123
132
  end
124
133
 
134
+ def self.cancel(id, params={}, env=nil, headers={})
135
+ Request.send('post', uri_path("subscriptions",id.to_s,"cancel"), params, env, headers)
136
+ end
137
+
125
138
  def self.resume(id, params={}, env=nil, headers={})
126
139
  Request.send('post', uri_path("subscriptions",id.to_s,"resume"), params, env, headers)
127
140
  end
@@ -5,7 +5,12 @@ module ChargeBee
5
5
  attr_accessor :first_name, :last_name, :email, :company, :phone, :line1, :line2, :line3, :city, :state_code, :state, :country, :zip, :validation_status
6
6
  end
7
7
 
8
- attr_accessor :id, :currency_code, :status, :next_billing_at, :pause_date, :resume_date, :shipping_address
8
+ class ContractTerm < Model
9
+ 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
10
+ end
11
+
12
+ attr_accessor :id, :currency_code, :status, :next_billing_at, :pause_date, :resume_date, :shipping_address,
13
+ :contract_term
9
14
 
10
15
  # OPERATIONS
11
16
  #-----------
@@ -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
@@ -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
@@ -7,13 +7,18 @@ module ChargeBee
7
7
 
8
8
  def subscription()
9
9
  subscription = get(:subscription, Subscription,
10
- {:addons => Subscription::Addon, :event_based_addons => Subscription::EventBasedAddon, :charged_event_based_addons => Subscription::ChargedEventBasedAddon, :coupons => Subscription::Coupon, :shipping_address => Subscription::ShippingAddress, :referral_info => Subscription::ReferralInfo});
10
+ {:addons => Subscription::Addon, :event_based_addons => Subscription::EventBasedAddon, :charged_event_based_addons => Subscription::ChargedEventBasedAddon, :coupons => Subscription::Coupon, :shipping_address => Subscription::ShippingAddress, :referral_info => Subscription::ReferralInfo, :contract_term => Subscription::ContractTerm});
11
11
  return subscription;
12
12
  end
13
13
 
14
+ def contract_term()
15
+ contract_term = get(:contract_term, ContractTerm);
16
+ return contract_term;
17
+ end
18
+
14
19
  def customer()
15
20
  customer = get(:customer, Customer,
16
- {:billing_address => Customer::BillingAddress, :referral_urls => Customer::ReferralUrl, :contacts => Customer::Contact, :payment_method => Customer::PaymentMethod, :balances => Customer::Balance, :relationship => Customer::Relationship});
21
+ {: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});
17
22
  return customer;
18
23
  end
19
24
 
@@ -103,7 +108,7 @@ module ChargeBee
103
108
  estimate = get(:estimate, Estimate, {},
104
109
  {:subscription_estimate => SubscriptionEstimate, :invoice_estimate => InvoiceEstimate, :invoice_estimates => InvoiceEstimate, :next_invoice_estimate => InvoiceEstimate, :credit_note_estimates => CreditNoteEstimate, :unbilled_charge_estimates => UnbilledCharge});
105
110
  estimate.init_dependant(@response[:estimate], :subscription_estimate,
106
- {:shipping_address => SubscriptionEstimate::ShippingAddress});
111
+ {:shipping_address => SubscriptionEstimate::ShippingAddress, :contract_term => SubscriptionEstimate::ContractTerm});
107
112
  estimate.init_dependant(@response[:estimate], :invoice_estimate,
108
113
  {:line_items => InvoiceEstimate::LineItem, :discounts => InvoiceEstimate::Discount, :taxes => InvoiceEstimate::Tax, :line_item_taxes => InvoiceEstimate::LineItemTax, :line_item_tiers => InvoiceEstimate::LineItemTier, :line_item_discounts => InvoiceEstimate::LineItemDiscount});
109
114
  estimate.init_dependant(@response[:estimate], :next_invoice_estimate,
@@ -123,6 +128,12 @@ module ChargeBee
123
128
  return quote;
124
129
  end
125
130
 
131
+ def quote_line_group()
132
+ quote_line_group = get(:quote_line_group, QuoteLineGroup,
133
+ {:line_items => QuoteLineGroup::LineItem, :discounts => QuoteLineGroup::Discount, :line_item_discounts => QuoteLineGroup::LineItemDiscount, :taxes => QuoteLineGroup::Tax, :line_item_taxes => QuoteLineGroup::LineItemTax});
134
+ return quote_line_group;
135
+ end
136
+
126
137
  def plan()
127
138
  plan = get(:plan, Plan,
128
139
  {:tiers => Plan::Tier, :applicable_addons => Plan::ApplicableAddon, :attached_addons => Plan::AttachedAddon, :event_based_addons => Plan::EventBasedAddon});
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.7.3
4
+ version: 2.7.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rajaraman S
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2020-01-10 00:00:00.000000000 Z
12
+ date: 2020-09-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: json_pure
@@ -98,6 +98,7 @@ files:
98
98
  - lib/chargebee/models/card.rb
99
99
  - lib/chargebee/models/comment.rb
100
100
  - lib/chargebee/models/contact.rb
101
+ - lib/chargebee/models/contract_term.rb
101
102
  - lib/chargebee/models/coupon.rb
102
103
  - lib/chargebee/models/coupon_code.rb
103
104
  - lib/chargebee/models/coupon_set.rb
@@ -121,6 +122,7 @@ files:
121
122
  - lib/chargebee/models/portal_session.rb
122
123
  - lib/chargebee/models/promotional_credit.rb
123
124
  - lib/chargebee/models/quote.rb
125
+ - lib/chargebee/models/quote_line_group.rb
124
126
  - lib/chargebee/models/resource_migration.rb
125
127
  - lib/chargebee/models/site_migration_detail.rb
126
128
  - lib/chargebee/models/subscription.rb