chargebee 2.6.0 → 2.6.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d1f6428c73a090a0925805bb6bd9986b979c4746
4
- data.tar.gz: 31c4e2c4f463c6b1b549881645868d17fbcec4c8
3
+ metadata.gz: 52d84cb3389cc2f2b6be6922fcb7df3077e9eb04
4
+ data.tar.gz: 23dc2244b9397758cfe731184be41c9b1148a875
5
5
  SHA512:
6
- metadata.gz: 10668ac51e1614162df405dd1c7e649e8163998635fcb27685f640e0f2eb86ac8df769e71201fe5735dbcd568676c57a74612a01d9ab28a5cc9a20f33c137947
7
- data.tar.gz: 9e56e200d1c1cad632f3749ea5d99bc559894f692b9298f4d0a25773436192372b510eea06de58265588eb9fa08657447ea4afe3bf4eaaaf54d9a393e85d8c9a
6
+ metadata.gz: 3d02a33ff2c50fc673cc55792ce414024bad77cf80e9a4db0ab9690b401eb9ce692f3161e819923ff375595bea7c5a181602a86b98ef6e20b17ad6c544935af2
7
+ data.tar.gz: b714cd4763bcb1cb13ee206ecef13dbac73ce3df7cfe960bcfbaf23bd855c877ea91efbe20b2935413db156b4c9dfa3e7859a387b6c260067c7ef5c57f874fea
@@ -1,3 +1,11 @@
1
+ ### v2.6.1 (2018-11-09)
2
+ * * *
3
+
4
+ * New resource 'Quote' with endpoints 'Retrieve a quote', 'Create a quote for one-time charges', 'Convert a quote', 'Update quote status', 'Retrieve quote as PDF' has been added. See : https://apidocs.chargebee.com/docs/api/quotes
5
+ * Entity type 'quote' has been added.
6
+ * Event types 'quote_created' and 'quote_updated' have been added.
7
+
8
+
1
9
  ### v2.6.0 (2018-11-02)
2
10
  * * *
3
11
 
@@ -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.0'
8
- s.date = '2018-11-02'
7
+ s.version = '2.6.1'
8
+ s.date = '2018-11-09'
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."
@@ -64,6 +64,7 @@ Gem::Specification.new do |s|
64
64
  lib/chargebee/models/plan.rb
65
65
  lib/chargebee/models/portal_session.rb
66
66
  lib/chargebee/models/promotional_credit.rb
67
+ lib/chargebee/models/quote.rb
67
68
  lib/chargebee/models/resource_migration.rb
68
69
  lib/chargebee/models/site_migration_detail.rb
69
70
  lib/chargebee/models/subscription.rb
@@ -40,11 +40,12 @@ require File.dirname(__FILE__) + '/chargebee/models/promotional_credit.rb'
40
40
  require File.dirname(__FILE__) + '/chargebee/models/virtual_bank_account.rb'
41
41
  require File.dirname(__FILE__) + '/chargebee/models/export'
42
42
  require File.dirname(__FILE__) + '/chargebee/models/gift'
43
+ require File.dirname(__FILE__) + '/chargebee/models/quote'
43
44
  require File.dirname(__FILE__) + '/chargebee/models/contact.rb'
44
45
 
45
46
  module ChargeBee
46
47
 
47
- VERSION = '2.6.0'
48
+ VERSION = '2.6.1'
48
49
 
49
50
  @@default_env = nil
50
51
  @@verify_ca_certs = true
@@ -0,0 +1,61 @@
1
+ module ChargeBee
2
+ class Quote < 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_type, :tax_exempt_reason, :entity_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, :tax_amount, :tax_juris_type, :tax_juris_name, :tax_juris_code
22
+ end
23
+
24
+ class ShippingAddress < Model
25
+ attr_accessor :first_name, :last_name, :email, :company, :phone, :line1, :line2, :line3, :city, :state_code, :state, :country, :zip, :validation_status
26
+ end
27
+
28
+ class BillingAddress < Model
29
+ attr_accessor :first_name, :last_name, :email, :company, :phone, :line1, :line2, :line3, :city, :state_code, :state, :country, :zip, :validation_status
30
+ end
31
+
32
+ attr_accessor :id, :po_number, :customer_id, :subscription_id, :status, :operation_type, :vat_number,
33
+ :price_type, :valid_till, :date, :sub_total, :total, :credits_applied, :amount_paid, :amount_due,
34
+ :resource_version, :updated_at, :currency_code, :line_items, :discounts, :line_item_discounts,
35
+ :taxes, :line_item_taxes, :shipping_address, :billing_address
36
+
37
+ # OPERATIONS
38
+ #-----------
39
+
40
+ def self.retrieve(id, env=nil, headers={})
41
+ Request.send('get', uri_path("quotes",id.to_s), {}, env, headers)
42
+ end
43
+
44
+ def self.create_for_onetime_charges(params, env=nil, headers={})
45
+ Request.send('post', uri_path("quotes","create_for_onetime_charges"), params, env, headers)
46
+ end
47
+
48
+ def self.convert(id, env=nil, headers={})
49
+ Request.send('post', uri_path("quotes",id.to_s,"convert"), {}, env, headers)
50
+ end
51
+
52
+ def self.update_status(id, params, env=nil, headers={})
53
+ Request.send('post', uri_path("quotes",id.to_s,"update_status"), params, env, headers)
54
+ end
55
+
56
+ def self.pdf(id, params={}, env=nil, headers={})
57
+ Request.send('post', uri_path("quotes",id.to_s,"pdf"), params, env, headers)
58
+ end
59
+
60
+ end # ~Quote
61
+ end # ~ChargeBee
@@ -107,6 +107,12 @@ module ChargeBee
107
107
  return estimate;
108
108
  end
109
109
 
110
+ def quote()
111
+ quote = get(:quote, Quote,
112
+ {:line_items => Quote::LineItem, :discounts => Quote::Discount, :line_item_discounts => Quote::LineItemDiscount, :taxes => Quote::Tax, :line_item_taxes => Quote::LineItemTax, :shipping_address => Quote::ShippingAddress, :billing_address => Quote::BillingAddress});
113
+ return quote;
114
+ end
115
+
110
116
  def plan()
111
117
  plan = get(:plan, Plan,
112
118
  {: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.6.0
4
+ version: 2.6.1
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: 2018-11-02 00:00:00.000000000 Z
12
+ date: 2018-11-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: json_pure
@@ -119,6 +119,7 @@ files:
119
119
  - lib/chargebee/models/plan.rb
120
120
  - lib/chargebee/models/portal_session.rb
121
121
  - lib/chargebee/models/promotional_credit.rb
122
+ - lib/chargebee/models/quote.rb
122
123
  - lib/chargebee/models/resource_migration.rb
123
124
  - lib/chargebee/models/site_migration_detail.rb
124
125
  - lib/chargebee/models/subscription.rb