chargebee 2.6.5 → 2.6.6

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: 62b859bf08abeecaad8d3292c9b39496bc7539d7
4
- data.tar.gz: 86fb5d6bfb6bf77d801d47e934205013bc07f605
3
+ metadata.gz: 2caaa7324faa9cd840b2e5141d5f4c835cb4639c
4
+ data.tar.gz: 88819266680175a0faaa1cc032323c48ccfff883
5
5
  SHA512:
6
- metadata.gz: eacfe3dc90493b846df7d8a8ea41028d11fca01d7436d0874787049f63fdcc87a2e16f8d4b0160d315ecc6948794a8fdacde0e03d418aff0ec1e484ce6b2cabc
7
- data.tar.gz: 44f22e8f161e7e87ce1d0cd300a28bc25541fa2bd2147ae526a2306e135979c9444f15165b96f71c72cbb4950a3e1bdd1abb13908d14a994c69314963d1600a6
6
+ metadata.gz: 921d5beb7c8e8387cba3befeb077deac8f1c8a9033027de2000c91a4c4844fc4be1fa8a64d2c935e8cf0d4b1dc09e82f426875699452a41ac545224356a93fa0
7
+ data.tar.gz: 499d68d00d054fd7777158ecdd69885705ecf06e2f884eeda0c8369cccb39597f1ab1f5adb71d98b51bcee21925af10c6c749e8e328a12d12742e4a85ec49bd2
@@ -1,3 +1,26 @@
1
+ ### v2.6.6 (2019-07-08)
2
+ * * *
3
+
4
+ * The resources hierarchy and token are added.
5
+ * Value ‘day’ is added in period_unit and shipping_frequency_period_unit .
6
+ * The parameters fractional_correction, comment, date_from and date_to are added in Create credit note API.
7
+ * The attribute customer_id is added to line_item sub resource of Credit note, Credit note estimate, Invoice, Invoice estimate and Quote.
8
+ * Endpoints Link a customer, Delink a customer, Get hierarchy, CreateUsingToken are added.
9
+ * The attributes business_customer_without_vat_number and relationship are added to customer resource.
10
+ * The filter parameters parent_id, payment_owner_id, invoice_owner_id are added in List customers, Export revenue recognition reports, Export Deferred Revenue Reports and Export customers APIs.
11
+ * The parameter token_id is added in Collect payment API.
12
+ * Event types hierarchy_created, hierarchy_deleted, token_created, token_consumed and token_expired are added.
13
+ * The parameter service_period_in_days is added in Create subscription estimate, Create subscription for customer estimate, Update subscription estimate, Checkout new, Checkout existing, Create subscription for customer quote, Update subscription quote, Create subscription, Create subscription for customer, Update subscription, Import subscription and Import subscription for customer.
14
+ * The filter parameter payment_owner is added in Export revenue recognition reports,Export Deferred Revenue Reports, Export Invoice and List Invoice APIs.
15
+ * The attribute payment_owner is added to invoice.
16
+ * The attributes date_from and date_to are added to Create an invoice, create a invoice for add-on and create a invoice for charge,Create a quote for one-time charges, Add charge at term end and Add add-on at term end.
17
+ * The parameter comment is added to Stop dunning, Apply payments, Apply credits, Add charge, Add add-on charge, Update details and Close Invoice APIs.
18
+ * The parameter ‘claim_credits’ is added to delete invoice API.
19
+ * The attribute override_relationship is added to subscription resource.
20
+ * The parameter token_id is added to Create subscription API.
21
+ * The parameter override_relationship is added to Create subscription for customer and Update subscription APIs.
22
+ * The attribute service_period_in_days is added to event add ons sub resource.
23
+
1
24
  ### v2.6.5 (2019-04-11)
2
25
  * * *
3
26
 
@@ -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.6.5'
8
- s.date = '2019-04-11'
7
+ s.version = '2.6.6'
8
+ s.date = '2019-07-08'
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."
@@ -54,6 +54,7 @@ Gem::Specification.new do |s|
54
54
  lib/chargebee/models/event.rb
55
55
  lib/chargebee/models/export.rb
56
56
  lib/chargebee/models/gift.rb
57
+ lib/chargebee/models/hierarchy.rb
57
58
  lib/chargebee/models/hosted_page.rb
58
59
  lib/chargebee/models/invoice.rb
59
60
  lib/chargebee/models/invoice_estimate.rb
@@ -70,6 +71,7 @@ Gem::Specification.new do |s|
70
71
  lib/chargebee/models/subscription_estimate.rb
71
72
  lib/chargebee/models/third_party_payment_method.rb
72
73
  lib/chargebee/models/time_machine.rb
74
+ lib/chargebee/models/token.rb
73
75
  lib/chargebee/models/transaction.rb
74
76
  lib/chargebee/models/unbilled_charge.rb
75
77
  lib/chargebee/models/virtual_bank_account.rb
@@ -45,7 +45,7 @@ require File.dirname(__FILE__) + '/chargebee/models/contact.rb'
45
45
 
46
46
  module ChargeBee
47
47
 
48
- VERSION = '2.6.5'
48
+ VERSION = '2.6.6'
49
49
 
50
50
  @@default_env = nil
51
51
  @@verify_ca_certs = true
@@ -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
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
6
6
  end
7
7
 
8
8
  class Discount < Model
@@ -36,8 +36,8 @@ module ChargeBee
36
36
  attr_accessor :id, :customer_id, :subscription_id, :reference_invoice_id, :type, :reason_code,
37
37
  :status, :vat_number, :date, :price_type, :currency_code, :total, :amount_allocated, :amount_refunded,
38
38
  :amount_available, :refunded_at, :voided_at, :resource_version, :updated_at, :sub_total, :round_off_amount,
39
- :line_items, :discounts, :line_item_discounts, :line_item_tiers, :taxes, :line_item_taxes, :linked_refunds,
40
- :allocations, :deleted
39
+ :fractional_correction, :line_items, :discounts, :line_item_discounts, :line_item_tiers, :taxes,
40
+ :line_item_taxes, :linked_refunds, :allocations, :deleted
41
41
 
42
42
  # OPERATIONS
43
43
  #-----------
@@ -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
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
6
6
  end
7
7
 
8
8
  class Discount < Model
@@ -21,6 +21,10 @@ module ChargeBee
21
21
  attr_accessor :promotional_credits, :excess_payments, :refundable_credits, :unbilled_charges, :currency_code, :balance_currency_code
22
22
  end
23
23
 
24
+ class Relationship < Model
25
+ attr_accessor :parent_id, :payment_owner_id, :invoice_owner_id
26
+ end
27
+
24
28
  attr_accessor :id, :first_name, :last_name, :email, :phone, :company, :vat_number, :auto_collection,
25
29
  :net_term_days, :vat_number_validated_time, :vat_number_status, :allow_direct_debit, :is_location_valid,
26
30
  :created_at, :created_from_ip, :exemption_details, :taxability, :entity_code, :exempt_number,
@@ -28,7 +32,8 @@ module ChargeBee
28
32
  :billing_day_of_week, :billing_day_of_week_mode, :pii_cleared, :card_status, :fraud_flag, :primary_payment_source_id,
29
33
  :backup_payment_source_id, :billing_address, :referral_urls, :contacts, :payment_method, :invoice_notes,
30
34
  :preferred_currency_code, :promotional_credits, :unbilled_charges, :refundable_credits, :excess_payments,
31
- :balances, :meta_data, :deleted, :registered_for_gst, :customer_type
35
+ :balances, :meta_data, :deleted, :registered_for_gst, :business_customer_without_vat_number,
36
+ :customer_type, :relationship
32
37
 
33
38
  # OPERATIONS
34
39
  #-----------
@@ -117,5 +122,17 @@ module ChargeBee
117
122
  Request.send('post', uri_path("customers",id.to_s,"clear_personal_data"), {}, env, headers)
118
123
  end
119
124
 
125
+ def self.relationships(id, params={}, env=nil, headers={})
126
+ Request.send('post', uri_path("customers",id.to_s,"relationships"), params, env, headers)
127
+ end
128
+
129
+ def self.delete_relationship(id, env=nil, headers={})
130
+ Request.send('post', uri_path("customers",id.to_s,"delete_relationship"), {}, env, headers)
131
+ end
132
+
133
+ def self.hierarchy(id, params={}, env=nil, headers={})
134
+ Request.send('get', uri_path("customers",id.to_s,"hierarchy"), params, env, headers)
135
+ end
136
+
120
137
  end # ~Customer
121
138
  end # ~ChargeBee
@@ -0,0 +1,10 @@
1
+ module ChargeBee
2
+ class Hierarchy < Model
3
+
4
+ attr_accessor :parent_id, :payment_owner_id, :invoice_owner_id, :customer_id, :children_ids
5
+
6
+ # OPERATIONS
7
+ #-----------
8
+
9
+ end # ~Hierarchy
10
+ end # ~ChargeBee
@@ -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
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
6
6
  end
7
7
 
8
8
  class Discount < Model
@@ -64,7 +64,7 @@ module ChargeBee
64
64
  :term_finalized, :is_gifted, :expected_payment_date, :amount_to_collect, :round_off_amount,
65
65
  :line_items, :discounts, :line_item_discounts, :taxes, :line_item_taxes, :line_item_tiers, :linked_payments,
66
66
  :applied_credits, :adjustment_credit_notes, :issued_credit_notes, :linked_orders, :notes, :shipping_address,
67
- :billing_address, :deleted
67
+ :billing_address, :payment_owner, :deleted
68
68
 
69
69
  # OPERATIONS
70
70
  #-----------
@@ -81,8 +81,8 @@ module ChargeBee
81
81
  Request.send('post', uri_path("invoices","charge_addon"), params, env, headers)
82
82
  end
83
83
 
84
- def self.stop_dunning(id, env=nil, headers={})
85
- Request.send('post', uri_path("invoices",id.to_s,"stop_dunning"), {}, env, headers)
84
+ def self.stop_dunning(id, params={}, env=nil, headers={})
85
+ Request.send('post', uri_path("invoices",id.to_s,"stop_dunning"), params, env, headers)
86
86
  end
87
87
 
88
88
  def self.import_invoice(params, env=nil, headers={})
@@ -125,8 +125,8 @@ module ChargeBee
125
125
  Request.send('post', uri_path("invoices",id.to_s,"add_addon_charge"), params, env, headers)
126
126
  end
127
127
 
128
- def self.close(id, env=nil, headers={})
129
- Request.send('post', uri_path("invoices",id.to_s,"close"), {}, env, headers)
128
+ def self.close(id, params={}, env=nil, headers={})
129
+ Request.send('post', uri_path("invoices",id.to_s,"close"), params, env, headers)
130
130
  end
131
131
 
132
132
  def self.collect_payment(id, params={}, env=nil, headers={})
@@ -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
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
6
6
  end
7
7
 
8
8
  class Discount < Model
@@ -32,6 +32,10 @@ module ChargeBee
32
32
  Request.send('post', uri_path("payment_sources","create_using_permanent_token"), params, env, headers)
33
33
  end
34
34
 
35
+ def self.create_using_token(params, env=nil, headers={})
36
+ Request.send('post', uri_path("payment_sources","create_using_token"), params, env, headers)
37
+ end
38
+
35
39
  def self.create_card(params, env=nil, headers={})
36
40
  Request.send('post', uri_path("payment_sources","create_card"), params, env, headers)
37
41
  end
@@ -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
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
6
6
  end
7
7
 
8
8
  class Discount < Model
@@ -6,7 +6,7 @@ module ChargeBee
6
6
  end
7
7
 
8
8
  class EventBasedAddon < Model
9
- attr_accessor :id, :quantity, :unit_price, :on_event, :charge_once
9
+ attr_accessor :id, :quantity, :unit_price, :service_period_in_days, :on_event, :charge_once
10
10
  end
11
11
 
12
12
  class ChargedEventBasedAddon < Model
@@ -28,12 +28,12 @@ module ChargeBee
28
28
  attr_accessor :id, :customer_id, :currency_code, :plan_id, :plan_quantity, :plan_unit_price,
29
29
  :setup_fee, :plan_amount, :billing_period, :billing_period_unit, :plan_free_quantity, :status,
30
30
  :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, :pause_date,
32
- :resume_date, :cancelled_at, :cancel_reason, :affiliate_token, :created_from_ip, :resource_version,
33
- :updated_at, :has_scheduled_changes, :payment_source_id, :auto_collection, :due_invoices_count,
34
- :due_since, :total_dues, :mrr, :exchange_rate, :base_currency_code, :addons, :event_based_addons,
35
- :charged_event_based_addons, :coupon, :coupons, :shipping_address, :referral_info, :invoice_notes,
36
- :meta_data, :deleted
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
37
37
 
38
38
  # OPERATIONS
39
39
  #-----------
@@ -0,0 +1,11 @@
1
+ module ChargeBee
2
+ class Token < Model
3
+
4
+ attr_accessor :id, :gateway, :gateway_account_id, :payment_method_type, :status, :id_at_vault,
5
+ :vault, :ip_address, :created_at, :expired_at
6
+
7
+ # OPERATIONS
8
+ #-----------
9
+
10
+ end # ~Token
11
+ end # ~ChargeBee
@@ -13,15 +13,25 @@ module ChargeBee
13
13
 
14
14
  def customer()
15
15
  customer = get(:customer, Customer,
16
- {:billing_address => Customer::BillingAddress, :referral_urls => Customer::ReferralUrl, :contacts => Customer::Contact, :payment_method => Customer::PaymentMethod, :balances => Customer::Balance});
16
+ {:billing_address => Customer::BillingAddress, :referral_urls => Customer::ReferralUrl, :contacts => Customer::Contact, :payment_method => Customer::PaymentMethod, :balances => Customer::Balance, :relationship => Customer::Relationship});
17
17
  return customer;
18
18
  end
19
19
 
20
+ def hierarchy()
21
+ hierarchy = get(:hierarchy, Hierarchy);
22
+ return hierarchy;
23
+ end
24
+
20
25
  def contact()
21
26
  contact = get(:contact, Contact);
22
27
  return contact;
23
28
  end
24
29
 
30
+ def token()
31
+ token = get(:token, Token);
32
+ return token;
33
+ end
34
+
25
35
  def payment_source()
26
36
  payment_source = get(:payment_source, PaymentSource,
27
37
  {:card => PaymentSource::Card, :bank_account => PaymentSource::BankAccount, :amazon_payment => PaymentSource::AmazonPayment, :paypal => PaymentSource::Paypal});
@@ -201,12 +211,21 @@ module ChargeBee
201
211
  return credit_notes;
202
212
  end
203
213
 
214
+ def hierarchies()
215
+ hierarchies = get_list(:hierarchies, Hierarchy,
216
+ {});
217
+ return hierarchies;
218
+ end
219
+
204
220
  def invoices()
205
221
  invoices = get_list(:invoices, Invoice,
206
222
  {:line_items => Invoice::LineItem, :discounts => Invoice::Discount, :line_item_discounts => Invoice::LineItemDiscount, :taxes => Invoice::Tax, :line_item_taxes => Invoice::LineItemTax, :line_item_tiers => Invoice::LineItemTier, :linked_payments => Invoice::LinkedPayment, :applied_credits => Invoice::AppliedCredit, :adjustment_credit_notes => Invoice::AdjustmentCreditNote, :issued_credit_notes => Invoice::IssuedCreditNote, :linked_orders => Invoice::LinkedOrder, :notes => Invoice::Note, :shipping_address => Invoice::ShippingAddress, :billing_address => Invoice::BillingAddress});
207
223
  return invoices;
208
224
  end
209
225
 
226
+ def to_s(*args)
227
+ JSON.pretty_generate(@response)
228
+ end
210
229
 
211
230
  private
212
231
  def get_list(type, klass, sub_types = {}, dependant_types = {}, dependant_sub_types = {})
@@ -232,9 +251,5 @@ module ChargeBee
232
251
  return klass.construct(@response[type], sub_types, dependant_types)
233
252
  end
234
253
 
235
- def to_s(*args)
236
- JSON.pretty_generate(@response)
237
- end
238
-
239
254
  end
240
255
  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.6.5
4
+ version: 2.6.6
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: 2019-04-11 00:00:00.000000000 Z
12
+ date: 2019-07-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: json_pure
@@ -109,6 +109,7 @@ files:
109
109
  - lib/chargebee/models/event.rb
110
110
  - lib/chargebee/models/export.rb
111
111
  - lib/chargebee/models/gift.rb
112
+ - lib/chargebee/models/hierarchy.rb
112
113
  - lib/chargebee/models/hosted_page.rb
113
114
  - lib/chargebee/models/invoice.rb
114
115
  - lib/chargebee/models/invoice_estimate.rb
@@ -125,6 +126,7 @@ files:
125
126
  - lib/chargebee/models/subscription_estimate.rb
126
127
  - lib/chargebee/models/third_party_payment_method.rb
127
128
  - lib/chargebee/models/time_machine.rb
129
+ - lib/chargebee/models/token.rb
128
130
  - lib/chargebee/models/transaction.rb
129
131
  - lib/chargebee/models/unbilled_charge.rb
130
132
  - lib/chargebee/models/virtual_bank_account.rb