chargebee 1.3.0 → 1.3.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.
- data/CHANGELOG.md +8 -0
- data/chargebee.gemspec +4 -2
- data/lib/chargebee.rb +2 -1
- data/lib/chargebee/models/comment.rb +26 -0
- data/lib/chargebee/models/subscription.rb +4 -0
- data/lib/chargebee/result.rb +44 -35
- metadata +4 -2
data/CHANGELOG.md
ADDED
@@ -0,0 +1,8 @@
|
|
1
|
+
### v1.3.1 (2014-01-16)
|
2
|
+
* * *
|
3
|
+
* Adding object that represent comments resource. Now comments can be added to the entities - Subscription, Invoice, Transaction, Plan, Addon & Coupon.
|
4
|
+
|
5
|
+
* API to fetch multiple subscriptions of a customer.
|
6
|
+
|
7
|
+
* Added support to get the list of events filtered by event type. Events can be fetched based on the event type eg., payment_succeeded.
|
8
|
+
|
data/chargebee.gemspec
CHANGED
@@ -4,8 +4,8 @@ Gem::Specification.new do |s|
|
|
4
4
|
s.rubygems_version = '1.3.5'
|
5
5
|
|
6
6
|
s.name = 'chargebee'
|
7
|
-
s.version = '1.3.
|
8
|
-
s.date = '2014-01-
|
7
|
+
s.version = '1.3.1'
|
8
|
+
s.date = '2014-01-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."
|
@@ -28,6 +28,7 @@ Gem::Specification.new do |s|
|
|
28
28
|
|
29
29
|
# = MANIFEST =
|
30
30
|
s.files = %w[
|
31
|
+
CHANGELOG.md
|
31
32
|
LICENSE
|
32
33
|
README.rdoc
|
33
34
|
Rakefile
|
@@ -39,6 +40,7 @@ Gem::Specification.new do |s|
|
|
39
40
|
lib/chargebee/models/addon.rb
|
40
41
|
lib/chargebee/models/address.rb
|
41
42
|
lib/chargebee/models/card.rb
|
43
|
+
lib/chargebee/models/comment.rb
|
42
44
|
lib/chargebee/models/coupon.rb
|
43
45
|
lib/chargebee/models/coupon_code.rb
|
44
46
|
lib/chargebee/models/customer.rb
|
data/lib/chargebee.rb
CHANGED
@@ -21,10 +21,11 @@ require File.dirname(__FILE__) + '/chargebee/models/plan'
|
|
21
21
|
require File.dirname(__FILE__) + '/chargebee/models/addon'
|
22
22
|
require File.dirname(__FILE__) + '/chargebee/models/coupon'
|
23
23
|
require File.dirname(__FILE__) + '/chargebee/models/coupon_code'
|
24
|
+
require File.dirname(__FILE__) + '/chargebee/models/comment'
|
24
25
|
|
25
26
|
module ChargeBee
|
26
27
|
|
27
|
-
VERSION = '1.3.
|
28
|
+
VERSION = '1.3.1'
|
28
29
|
|
29
30
|
@@default_env = nil
|
30
31
|
@@verify_ca_certs = true
|
@@ -0,0 +1,26 @@
|
|
1
|
+
module ChargeBee
|
2
|
+
class Comment < Model
|
3
|
+
|
4
|
+
attr_accessor :id, :entity_type, :added_by, :notes, :created_at, :type, :entity_id
|
5
|
+
|
6
|
+
# OPERATIONS
|
7
|
+
#-----------
|
8
|
+
|
9
|
+
def self.create(params, env=nil)
|
10
|
+
Request.send('post', "/comments", params, env)
|
11
|
+
end
|
12
|
+
|
13
|
+
def self.retrieve(id, env=nil)
|
14
|
+
Request.send('get', "/comments/#{id.to_s}", {}, env)
|
15
|
+
end
|
16
|
+
|
17
|
+
def self.list(params={}, env=nil)
|
18
|
+
Request.send('get', "/comments", params, env)
|
19
|
+
end
|
20
|
+
|
21
|
+
def self.delete(id, env=nil)
|
22
|
+
Request.send('post', "/comments/#{id.to_s}/delete", {}, env)
|
23
|
+
end
|
24
|
+
|
25
|
+
end # ~Comment
|
26
|
+
end # ~ChargeBee
|
@@ -29,6 +29,10 @@ module ChargeBee
|
|
29
29
|
Request.send('get', "/subscriptions", params, env)
|
30
30
|
end
|
31
31
|
|
32
|
+
def self.subscriptions_for_customer(id, params={}, env=nil)
|
33
|
+
Request.send('get', "/customers/#{id.to_s}/subscriptions", params, env)
|
34
|
+
end
|
35
|
+
|
32
36
|
def self.retrieve(id, env=nil)
|
33
37
|
Request.send('get', "/subscriptions/#{id.to_s}", {}, env)
|
34
38
|
end
|
data/lib/chargebee/result.rb
CHANGED
@@ -5,66 +5,75 @@ module ChargeBee
|
|
5
5
|
@response = response
|
6
6
|
end
|
7
7
|
|
8
|
-
def subscription()
|
9
|
-
|
8
|
+
def subscription()
|
9
|
+
get(:subscription, Subscription,
|
10
|
+
{:addons => Subscription::Addon, :coupons => Subscription::Coupon});
|
10
11
|
end
|
11
12
|
|
12
|
-
def customer()
|
13
|
-
|
13
|
+
def customer()
|
14
|
+
get(:customer, Customer,
|
15
|
+
{:billing_address => Customer::BillingAddress});
|
14
16
|
end
|
15
17
|
|
16
|
-
def card()
|
17
|
-
|
18
|
+
def card()
|
19
|
+
get(:card, Card);
|
18
20
|
end
|
19
|
-
|
20
|
-
def
|
21
|
-
|
21
|
+
|
22
|
+
def invoice()
|
23
|
+
get(:invoice, Invoice,
|
24
|
+
{:line_items => Invoice::LineItem, :discounts => Invoice::Discount, :taxes => Invoice::Tax});
|
22
25
|
end
|
23
|
-
|
24
|
-
def
|
25
|
-
|
26
|
+
|
27
|
+
def transaction()
|
28
|
+
get(:transaction, Transaction);
|
26
29
|
end
|
27
30
|
|
28
|
-
def
|
29
|
-
|
31
|
+
def hosted_page()
|
32
|
+
get(:hosted_page, HostedPage);
|
30
33
|
end
|
31
34
|
|
32
|
-
def
|
33
|
-
|
35
|
+
def estimate()
|
36
|
+
get(:estimate, Estimate,
|
37
|
+
{:line_items => Estimate::LineItem, :discounts => Estimate::Discount, :taxes => Estimate::Tax});
|
34
38
|
end
|
35
39
|
|
36
|
-
def
|
37
|
-
|
40
|
+
def plan()
|
41
|
+
get(:plan, Plan);
|
38
42
|
end
|
39
43
|
|
40
|
-
def
|
41
|
-
|
44
|
+
def addon()
|
45
|
+
get(:addon, Addon);
|
42
46
|
end
|
43
|
-
|
44
|
-
def
|
45
|
-
|
47
|
+
|
48
|
+
def coupon()
|
49
|
+
get(:coupon, Coupon);
|
46
50
|
end
|
47
|
-
|
48
|
-
def
|
49
|
-
|
51
|
+
|
52
|
+
def coupon_code()
|
53
|
+
get(:coupon_code, CouponCode);
|
50
54
|
end
|
51
|
-
|
52
|
-
def
|
53
|
-
|
55
|
+
|
56
|
+
def address()
|
57
|
+
get(:address, Address);
|
54
58
|
end
|
55
|
-
|
56
|
-
def
|
57
|
-
|
59
|
+
|
60
|
+
def event()
|
61
|
+
get(:event, Event);
|
58
62
|
end
|
59
|
-
|
63
|
+
|
64
|
+
def comment()
|
65
|
+
get(:comment, Comment);
|
66
|
+
end
|
67
|
+
|
68
|
+
|
60
69
|
def to_s(*args)
|
61
70
|
JSON.pretty_generate(@response)
|
62
71
|
end
|
63
|
-
|
72
|
+
|
64
73
|
private
|
65
74
|
def get(type, klass, sub_types = {})
|
66
75
|
klass.construct(@response[type], sub_types)
|
67
76
|
end
|
68
|
-
|
77
|
+
|
69
78
|
end
|
70
79
|
end
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: chargebee
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 1.3.
|
5
|
+
version: 1.3.1
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Rajaraman S
|
@@ -11,7 +11,7 @@ autorequire:
|
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
13
|
|
14
|
-
date: 2014-01-
|
14
|
+
date: 2014-01-16 00:00:00 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: json_pure
|
@@ -69,6 +69,7 @@ extra_rdoc_files:
|
|
69
69
|
- README.rdoc
|
70
70
|
- LICENSE
|
71
71
|
files:
|
72
|
+
- CHANGELOG.md
|
72
73
|
- LICENSE
|
73
74
|
- README.rdoc
|
74
75
|
- Rakefile
|
@@ -80,6 +81,7 @@ files:
|
|
80
81
|
- lib/chargebee/models/addon.rb
|
81
82
|
- lib/chargebee/models/address.rb
|
82
83
|
- lib/chargebee/models/card.rb
|
84
|
+
- lib/chargebee/models/comment.rb
|
83
85
|
- lib/chargebee/models/coupon.rb
|
84
86
|
- lib/chargebee/models/coupon_code.rb
|
85
87
|
- lib/chargebee/models/customer.rb
|