chargebee 2.26.0 → 2.26.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 +4 -4
- data/CHANGELOG.md +6 -0
- data/Gemfile.lock +1 -1
- data/chargebee.gemspec +1 -1
- data/lib/chargebee.rb +1 -1
- data/spec/chargebee_spec.rb +6 -4
- data/spec/sample_response.rb +11 -0
- data/spec/spec_helper.rb +3 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e8f49942d789e63f0f1c44b234e16de02983f15f
|
4
|
+
data.tar.gz: e5feb8906f49350edc3136a2845e248b58d9e7f5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0358f0b36273e2a6d50f44f10bb36ef8b6106f3924c073ff21ad127c95f29485bfbdfa1b9097a3c59e157121dc04ae63c78f806b4586ec478c9b83bd0cd4668b
|
7
|
+
data.tar.gz: 3ed155cb9b0f10d70ee68a3cf8422fc21c3f3e43b0b773d93f2cf30120c0180b5d9823f55a1cf101f605ebd617c7f2a35a4c4335d0ad8a1949aba34a33af2f0b
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
data/chargebee.gemspec
CHANGED
@@ -4,7 +4,7 @@ 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.26.
|
7
|
+
s.version = '2.26.1'
|
8
8
|
s.date = '2023-05-16'
|
9
9
|
s.summary = "Ruby client for Chargebee API."
|
10
10
|
s.description = "Subscription Billing - Simple. Secure. Affordable. More details at www.chargebee.com."
|
data/lib/chargebee.rb
CHANGED
data/spec/chargebee_spec.rb
CHANGED
@@ -55,8 +55,10 @@ describe "chargebee" do
|
|
55
55
|
end
|
56
56
|
|
57
57
|
it "should properly convert the response json into proper object" do
|
58
|
-
@request.expects(:execute).once.returns(mock_response(simple_subscription))
|
58
|
+
@request.expects(:execute).once.returns(mock_response(simple_subscription, headers))
|
59
59
|
result = ChargeBee::Subscription.retrieve("simple_subscription")
|
60
|
+
h = result.get_response_headers
|
61
|
+
expect(h).to eq(headers)
|
60
62
|
s = result.subscription
|
61
63
|
expect(s.id).to eq("simple_subscription")
|
62
64
|
expect(s.plan_id).to eq('basic')
|
@@ -66,7 +68,7 @@ describe "chargebee" do
|
|
66
68
|
end
|
67
69
|
|
68
70
|
it "should properly convert the nested response json into proper object with sub types" do
|
69
|
-
@request.expects(:execute).once.returns(mock_response(nested_subscription))
|
71
|
+
@request.expects(:execute).once.returns(mock_response(nested_subscription, headers))
|
70
72
|
result = ChargeBee::Subscription.retrieve("nested_subscription")
|
71
73
|
s = result.subscription
|
72
74
|
expect(s.id).to eq("nested_subscription")
|
@@ -78,7 +80,7 @@ describe "chargebee" do
|
|
78
80
|
end
|
79
81
|
|
80
82
|
it "should properly convert the list response json into proper result object" do
|
81
|
-
@request.expects(:execute).once.returns(mock_response(list_subscriptions))
|
83
|
+
@request.expects(:execute).once.returns(mock_response(list_subscriptions, headers))
|
82
84
|
result = ChargeBee::Subscription.list({:limit => 2})
|
83
85
|
expect(result.length).to eq(2)
|
84
86
|
result.each do |i|
|
@@ -87,7 +89,7 @@ describe "chargebee" do
|
|
87
89
|
end
|
88
90
|
|
89
91
|
it "should parse event api response and provide the content properly" do
|
90
|
-
@request.expects(:execute).once.returns(mock_response(sample_event))
|
92
|
+
@request.expects(:execute).once.returns(mock_response(sample_event, headers))
|
91
93
|
result = ChargeBee::Event.retrieve("sample_event")
|
92
94
|
event = result.event
|
93
95
|
s = event.content.subscription
|
data/spec/sample_response.rb
CHANGED
@@ -12,6 +12,17 @@ def api_index_urls()
|
|
12
12
|
}
|
13
13
|
end
|
14
14
|
|
15
|
+
def headers
|
16
|
+
{
|
17
|
+
:cache_control=>"no-store, no-cache, must-revalidate",
|
18
|
+
:pragma=>"no-cache",
|
19
|
+
:content_type=>"application/json;charset=utf-8",
|
20
|
+
:content_length=>"986",
|
21
|
+
:date=>"Tue, 16 May 2023 08:12:00 GMT",
|
22
|
+
:server=>"ChargeBee"
|
23
|
+
}
|
24
|
+
end
|
25
|
+
|
15
26
|
def simple_subscription
|
16
27
|
{
|
17
28
|
:subscription => {
|
data/spec/spec_helper.rb
CHANGED
@@ -9,12 +9,13 @@ RSpec.configure do |config|
|
|
9
9
|
config.mock_with :mocha
|
10
10
|
end
|
11
11
|
|
12
|
-
def mock_response(body, code=200)
|
12
|
+
def mock_response(body, code=200, headers)
|
13
13
|
body = body.to_json if !(body.kind_of? String)
|
14
14
|
m = mock
|
15
|
-
m.instance_variable_set('@resp_values', { :body => body, :code => code })
|
15
|
+
m.instance_variable_set('@resp_values', { :body => body, :code => code, :headers => headers })
|
16
16
|
def m.body; @resp_values[:body]; end
|
17
17
|
def m.code; @resp_values[:code]; end
|
18
|
+
def m.headers; @resp_values[:headers]; end
|
18
19
|
m
|
19
20
|
end
|
20
21
|
|