chargebee 1.2.5 → 1.2.6
Sign up to get free protection for your applications and to get access to all the features.
- data/chargebee.gemspec +3 -2
- data/lib/chargebee.rb +2 -2
- data/lib/chargebee/models/card.rb +4 -0
- data/lib/chargebee/models/coupon_code.rb +18 -0
- data/lib/chargebee/models/customer.rb +10 -2
- data/lib/chargebee/models/subscription.rb +1 -1
- data/lib/chargebee/models/transaction.rb +4 -0
- data/lib/chargebee/result.rb +7 -3
- metadata +3 -2
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.2.
|
8
|
-
s.date = '2013-
|
7
|
+
s.version = '1.2.6'
|
8
|
+
s.date = '2013-09-28'
|
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/models/address.rb
|
41
41
|
lib/chargebee/models/card.rb
|
42
42
|
lib/chargebee/models/coupon.rb
|
43
|
+
lib/chargebee/models/coupon_code.rb
|
43
44
|
lib/chargebee/models/customer.rb
|
44
45
|
lib/chargebee/models/estimate.rb
|
45
46
|
lib/chargebee/models/event.rb
|
data/lib/chargebee.rb
CHANGED
@@ -20,11 +20,11 @@ require File.dirname(__FILE__) + '/chargebee/models/event'
|
|
20
20
|
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
24
|
|
25
25
|
module ChargeBee
|
26
26
|
|
27
|
-
VERSION = '1.2.
|
27
|
+
VERSION = '1.2.6'
|
28
28
|
|
29
29
|
@@default_env = nil
|
30
30
|
@@verify_ca_certs = true
|
@@ -16,5 +16,9 @@ module ChargeBee
|
|
16
16
|
Request.send('post', "/customers/#{id.to_s}/credit_card", params, env)
|
17
17
|
end
|
18
18
|
|
19
|
+
def self.delete_card_for_customer(id, env=nil)
|
20
|
+
Request.send('post', "/customers/#{id.to_s}/delete_card", {}, env)
|
21
|
+
end
|
22
|
+
|
19
23
|
end # ~Card
|
20
24
|
end # ~ChargeBee
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module ChargeBee
|
2
|
+
class CouponCode < Model
|
3
|
+
|
4
|
+
attr_accessor :code, :coupon_id, :coupon_set_name
|
5
|
+
|
6
|
+
# OPERATIONS
|
7
|
+
#-----------
|
8
|
+
|
9
|
+
def self.create(params, env=nil)
|
10
|
+
Request.send('post', "/coupon_codes", params, env)
|
11
|
+
end
|
12
|
+
|
13
|
+
def self.retrieve(id, env=nil)
|
14
|
+
Request.send('get', "/coupon_codes/#{id.to_s}", {}, env)
|
15
|
+
end
|
16
|
+
|
17
|
+
end # ~CouponCode
|
18
|
+
end # ~ChargeBee
|
@@ -1,8 +1,12 @@
|
|
1
1
|
module ChargeBee
|
2
2
|
class Customer < Model
|
3
3
|
|
4
|
-
|
5
|
-
|
4
|
+
class BillingAddress < Model
|
5
|
+
attr_accessor :line1, :line2, :city, :state, :country, :zip
|
6
|
+
end
|
7
|
+
|
8
|
+
attr_accessor :id, :first_name, :last_name, :email, :phone, :company, :vat_number, :auto_collection,
|
9
|
+
:created_at, :card_status, :billing_address
|
6
10
|
|
7
11
|
# OPERATIONS
|
8
12
|
#-----------
|
@@ -19,5 +23,9 @@ module ChargeBee
|
|
19
23
|
Request.send('post', "/customers/#{id.to_s}", params, env)
|
20
24
|
end
|
21
25
|
|
26
|
+
def self.update_billing_info(id, params={}, env=nil)
|
27
|
+
Request.send('post', "/customers/#{id.to_s}/update_billing_info", params, env)
|
28
|
+
end
|
29
|
+
|
22
30
|
end # ~Customer
|
23
31
|
end # ~ChargeBee
|
@@ -6,7 +6,7 @@ module ChargeBee
|
|
6
6
|
end
|
7
7
|
|
8
8
|
class Coupon < Model
|
9
|
-
attr_accessor :coupon_id, :apply_till, :applied_count
|
9
|
+
attr_accessor :coupon_id, :apply_till, :applied_count, :coupon_code
|
10
10
|
end
|
11
11
|
|
12
12
|
attr_accessor :id, :plan_id, :plan_quantity, :status, :trial_start, :trial_end, :current_term_start,
|
@@ -16,6 +16,10 @@ module ChargeBee
|
|
16
16
|
Request.send('get', "/subscriptions/#{id.to_s}/transactions", params, env)
|
17
17
|
end
|
18
18
|
|
19
|
+
def self.transactions_for_invoice(id, params={}, env=nil)
|
20
|
+
Request.send('get', "/invoices/#{id.to_s}/transactions", params, env)
|
21
|
+
end
|
22
|
+
|
19
23
|
def self.retrieve(id, env=nil)
|
20
24
|
Request.send('get', "/transactions/#{id.to_s}", {}, env)
|
21
25
|
end
|
data/lib/chargebee/result.rb
CHANGED
@@ -6,11 +6,11 @@ module ChargeBee
|
|
6
6
|
end
|
7
7
|
|
8
8
|
def subscription()
|
9
|
-
get(:subscription, Subscription, {:addons => Subscription::Addon})
|
9
|
+
get(:subscription, Subscription, {:addons => Subscription::Addon,:coupons => Subscription::Coupon})
|
10
10
|
end
|
11
11
|
|
12
12
|
def customer()
|
13
|
-
get(:customer, Customer)
|
13
|
+
get(:customer, Customer,{:billing_address => Customer::BillingAddress})
|
14
14
|
end
|
15
15
|
|
16
16
|
def card()
|
@@ -53,6 +53,10 @@ module ChargeBee
|
|
53
53
|
get(:coupon, Coupon)
|
54
54
|
end
|
55
55
|
|
56
|
+
def coupon_code()
|
57
|
+
get(:coupon_code, CouponCode)
|
58
|
+
end
|
59
|
+
|
56
60
|
def to_s(*args)
|
57
61
|
JSON.pretty_generate(@response)
|
58
62
|
end
|
@@ -63,4 +67,4 @@ module ChargeBee
|
|
63
67
|
end
|
64
68
|
|
65
69
|
end
|
66
|
-
end
|
70
|
+
end
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: chargebee
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 1.2.
|
5
|
+
version: 1.2.6
|
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: 2013-
|
14
|
+
date: 2013-09-28 00:00:00 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: json_pure
|
@@ -81,6 +81,7 @@ files:
|
|
81
81
|
- lib/chargebee/models/address.rb
|
82
82
|
- lib/chargebee/models/card.rb
|
83
83
|
- lib/chargebee/models/coupon.rb
|
84
|
+
- lib/chargebee/models/coupon_code.rb
|
84
85
|
- lib/chargebee/models/customer.rb
|
85
86
|
- lib/chargebee/models/estimate.rb
|
86
87
|
- lib/chargebee/models/event.rb
|