chargebee 1.3.7 → 1.3.8
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 +6 -0
- data/chargebee.gemspec +2 -2
- data/lib/chargebee.rb +1 -1
- data/lib/chargebee/models/invoice.rb +9 -5
- data/lib/chargebee/models/transaction.rb +11 -3
- data/lib/chargebee/result.rb +3 -2
- metadata +2 -2
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
### v1.3.8 (2014-03-26)
|
2
|
+
* * *
|
3
|
+
* Now the [Transaction attributes](https://apidocs.chargebee.com/docs/api/transactions#transaction_attributes "Transaction attributes") contains the details about the linked invoices.
|
4
|
+
|
5
|
+
* Now the [Invoice attributes](https://apidocs.chargebee.com/docs/api/invoices#invoice_attributes "Invoice attributes") contains the details about the linked transactions.
|
6
|
+
|
1
7
|
### v1.3.7 (2014-03-18)
|
2
8
|
* * *
|
3
9
|
Support for deleting the plans & addons. See our API documentation on [Delete a plan](https://apidocs.chargebee.com/docs/api/plans#delete_a_plan "Delete a plan") & [Delete an addon](https://apidocs.chargebee.com/docs/api/addons#delete_an_addon "Delete an addon").
|
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-03-
|
7
|
+
s.version = '1.3.8'
|
8
|
+
s.date = '2014-03-26'
|
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."
|
data/lib/chargebee.rb
CHANGED
@@ -13,8 +13,12 @@ module ChargeBee
|
|
13
13
|
attr_accessor :amount, :description
|
14
14
|
end
|
15
15
|
|
16
|
+
class LinkedTransaction < Model
|
17
|
+
attr_accessor :txn_id, :applied_amount, :txn_type, :txn_status, :txn_date, :txn_amount
|
18
|
+
end
|
19
|
+
|
16
20
|
attr_accessor :id, :subscription_id, :recurring, :status, :vat_number, :start_date, :end_date,
|
17
|
-
:amount, :paid_on, :next_retry, :sub_total, :tax, :line_items, :discounts, :taxes
|
21
|
+
:amount, :paid_on, :next_retry, :sub_total, :tax, :line_items, :discounts, :taxes, :linked_transactions
|
18
22
|
|
19
23
|
# OPERATIONS
|
20
24
|
#-----------
|
@@ -39,6 +43,10 @@ module ChargeBee
|
|
39
43
|
Request.send('get', "/invoices/#{id.to_s}", {}, env)
|
40
44
|
end
|
41
45
|
|
46
|
+
def self.pdf(id, env=nil)
|
47
|
+
Request.send('post', "/invoices/#{id.to_s}/pdf", {}, env)
|
48
|
+
end
|
49
|
+
|
42
50
|
def self.add_charge(id, params, env=nil)
|
43
51
|
Request.send('post', "/invoices/#{id.to_s}/add_charge", params, env)
|
44
52
|
end
|
@@ -47,10 +55,6 @@ module ChargeBee
|
|
47
55
|
Request.send('post', "/invoices/#{id.to_s}/add_addon_charge", params, env)
|
48
56
|
end
|
49
57
|
|
50
|
-
def self.pdf(id, env=nil)
|
51
|
-
Request.send('post', "/invoices/#{id.to_s}/pdf", {}, env)
|
52
|
-
end
|
53
|
-
|
54
58
|
def self.collect(id, env=nil)
|
55
59
|
Request.send('post', "/invoices/#{id.to_s}/collect", {}, env)
|
56
60
|
end
|
@@ -1,9 +1,13 @@
|
|
1
1
|
module ChargeBee
|
2
2
|
class Transaction < Model
|
3
3
|
|
4
|
-
|
5
|
-
|
6
|
-
|
4
|
+
class LinkedInvoice < Model
|
5
|
+
attr_accessor :invoice_id, :applied_amount, :invoice_date, :invoice_amount
|
6
|
+
end
|
7
|
+
|
8
|
+
attr_accessor :id, :subscription_id, :payment_method, :reference_number, :gateway, :description,
|
9
|
+
:type, :date, :amount, :id_at_gateway, :status, :error_code, :error_text, :voided_at, :void_description,
|
10
|
+
:masked_card_number, :refunded_txn_id, :linked_invoices
|
7
11
|
|
8
12
|
# OPERATIONS
|
9
13
|
#-----------
|
@@ -24,6 +28,10 @@ module ChargeBee
|
|
24
28
|
Request.send('get', "/transactions/#{id.to_s}", {}, env)
|
25
29
|
end
|
26
30
|
|
31
|
+
def self.record_payment(id, params, env=nil)
|
32
|
+
Request.send('post', "/invoices/#{id.to_s}/record_payment", params, env)
|
33
|
+
end
|
34
|
+
|
27
35
|
def self.refund(id, params={}, env=nil)
|
28
36
|
Request.send('post', "/transactions/#{id.to_s}/refund", params, env)
|
29
37
|
end
|
data/lib/chargebee/result.rb
CHANGED
@@ -21,11 +21,12 @@ module ChargeBee
|
|
21
21
|
|
22
22
|
def invoice()
|
23
23
|
get(:invoice, Invoice,
|
24
|
-
{:line_items => Invoice::LineItem, :discounts => Invoice::Discount, :taxes => Invoice::Tax});
|
24
|
+
{:line_items => Invoice::LineItem, :discounts => Invoice::Discount, :taxes => Invoice::Tax, :invoice_transactions => Invoice::LinkedTransaction});
|
25
25
|
end
|
26
26
|
|
27
27
|
def transaction()
|
28
|
-
get(:transaction, Transaction
|
28
|
+
get(:transaction, Transaction,
|
29
|
+
{:invoice_transactions => Transaction::LinkedInvoice});
|
29
30
|
end
|
30
31
|
|
31
32
|
def hosted_page()
|
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.8
|
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-03-
|
14
|
+
date: 2014-03-26 00:00:00 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: json_pure
|