chargify 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/chargify.gemspec +4 -3
- data/lib/chargify/client.rb +3 -1
- data/test/fixtures/subscription_not_found.json +1 -0
- data/test/test_chargify.rb +6 -0
- metadata +61 -29
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.1
|
data/chargify.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{chargify}
|
8
|
-
s.version = "0.2.
|
8
|
+
s.version = "0.2.1"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Wynn Netherland", "Nash Kabbara"]
|
12
|
-
s.date = %q{2010-
|
12
|
+
s.date = %q{2010-03-19}
|
13
13
|
s.description = %q{Ruby wrapper for the chargify.com SAAS and billing API}
|
14
14
|
s.email = %q{wynn.netherland@gmail.com}
|
15
15
|
s.extra_rdoc_files = [
|
@@ -35,6 +35,7 @@ Gem::Specification.new do |s|
|
|
35
35
|
"test/fixtures/product.json",
|
36
36
|
"test/fixtures/products.json",
|
37
37
|
"test/fixtures/subscription.json",
|
38
|
+
"test/fixtures/subscription_not_found.json",
|
38
39
|
"test/fixtures/subscriptions.json",
|
39
40
|
"test/helper.rb",
|
40
41
|
"test/test_chargify.rb"
|
@@ -42,7 +43,7 @@ Gem::Specification.new do |s|
|
|
42
43
|
s.homepage = %q{http://github.com/pengwynn/chargify}
|
43
44
|
s.rdoc_options = ["--charset=UTF-8"]
|
44
45
|
s.require_paths = ["lib"]
|
45
|
-
s.rubygems_version = %q{1.3.
|
46
|
+
s.rubygems_version = %q{1.3.6}
|
46
47
|
s.summary = %q{Ruby wrapper for the chargify.com SAAS and billing API}
|
47
48
|
s.test_files = [
|
48
49
|
"test/helper.rb",
|
data/lib/chargify/client.rb
CHANGED
@@ -74,7 +74,9 @@ module Chargify
|
|
74
74
|
end
|
75
75
|
|
76
76
|
def subscription(subscription_id)
|
77
|
-
|
77
|
+
raw_response = self.class.get("/subscriptions/#{subscription_id}.json")
|
78
|
+
return nil if raw_response.code != 200
|
79
|
+
Hashie::Mash.new(raw_response).subscription
|
78
80
|
end
|
79
81
|
|
80
82
|
# Returns all elements outputted by Chargify plus:
|
@@ -0,0 +1 @@
|
|
1
|
+
\r\n
|
data/test/test_chargify.rb
CHANGED
@@ -74,6 +74,12 @@ class TestChargify < Test::Unit::TestCase
|
|
74
74
|
subscription = @client.subscription(13)
|
75
75
|
subscription.customer.reference.should == 'bradleyjoyce'
|
76
76
|
end
|
77
|
+
|
78
|
+
should "return nil if a subscription is not found" do
|
79
|
+
stub_get "https://OU812:x@pengwynn.chargify.com/subscriptions/18.json", "subscription_not_found.json", 404
|
80
|
+
subscription = @client.subscription(18)
|
81
|
+
subscription.should == nil
|
82
|
+
end
|
77
83
|
|
78
84
|
should "update a customer subscription" do
|
79
85
|
stub_put "https://OU812:x@pengwynn.chargify.com/subscriptions/123.json", "subscription.json"
|
metadata
CHANGED
@@ -1,7 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chargify
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 0
|
7
|
+
- 2
|
8
|
+
- 1
|
9
|
+
version: 0.2.1
|
5
10
|
platform: ruby
|
6
11
|
authors:
|
7
12
|
- Wynn Netherland
|
@@ -10,69 +15,93 @@ autorequire:
|
|
10
15
|
bindir: bin
|
11
16
|
cert_chain: []
|
12
17
|
|
13
|
-
date: 2010-
|
18
|
+
date: 2010-03-19 00:00:00 -05:00
|
14
19
|
default_executable:
|
15
20
|
dependencies:
|
16
21
|
- !ruby/object:Gem::Dependency
|
17
22
|
name: hashie
|
18
|
-
|
19
|
-
|
20
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
prerelease: false
|
24
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
21
25
|
requirements:
|
22
26
|
- - ~>
|
23
27
|
- !ruby/object:Gem::Version
|
28
|
+
segments:
|
29
|
+
- 0
|
30
|
+
- 1
|
31
|
+
- 3
|
24
32
|
version: 0.1.3
|
25
|
-
|
33
|
+
type: :runtime
|
34
|
+
version_requirements: *id001
|
26
35
|
- !ruby/object:Gem::Dependency
|
27
36
|
name: httparty
|
28
|
-
|
29
|
-
|
30
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
prerelease: false
|
38
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
31
39
|
requirements:
|
32
40
|
- - ~>
|
33
41
|
- !ruby/object:Gem::Version
|
42
|
+
segments:
|
43
|
+
- 0
|
44
|
+
- 4
|
45
|
+
- 5
|
34
46
|
version: 0.4.5
|
35
|
-
|
47
|
+
type: :runtime
|
48
|
+
version_requirements: *id002
|
36
49
|
- !ruby/object:Gem::Dependency
|
37
50
|
name: thoughtbot-shoulda
|
38
|
-
|
39
|
-
|
40
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
prerelease: false
|
52
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
41
53
|
requirements:
|
42
54
|
- - ">="
|
43
55
|
- !ruby/object:Gem::Version
|
56
|
+
segments:
|
57
|
+
- 2
|
58
|
+
- 10
|
59
|
+
- 1
|
44
60
|
version: 2.10.1
|
45
|
-
|
61
|
+
type: :development
|
62
|
+
version_requirements: *id003
|
46
63
|
- !ruby/object:Gem::Dependency
|
47
64
|
name: jnunemaker-matchy
|
48
|
-
|
49
|
-
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
prerelease: false
|
66
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
51
67
|
requirements:
|
52
68
|
- - "="
|
53
69
|
- !ruby/object:Gem::Version
|
70
|
+
segments:
|
71
|
+
- 0
|
72
|
+
- 4
|
73
|
+
- 0
|
54
74
|
version: 0.4.0
|
55
|
-
|
75
|
+
type: :development
|
76
|
+
version_requirements: *id004
|
56
77
|
- !ruby/object:Gem::Dependency
|
57
78
|
name: mocha
|
58
|
-
|
59
|
-
|
60
|
-
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
prerelease: false
|
80
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
61
81
|
requirements:
|
62
82
|
- - "="
|
63
83
|
- !ruby/object:Gem::Version
|
84
|
+
segments:
|
85
|
+
- 0
|
86
|
+
- 9
|
87
|
+
- 4
|
64
88
|
version: 0.9.4
|
65
|
-
|
89
|
+
type: :development
|
90
|
+
version_requirements: *id005
|
66
91
|
- !ruby/object:Gem::Dependency
|
67
92
|
name: fakeweb
|
68
|
-
|
69
|
-
|
70
|
-
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
prerelease: false
|
94
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
71
95
|
requirements:
|
72
96
|
- - ">="
|
73
97
|
- !ruby/object:Gem::Version
|
98
|
+
segments:
|
99
|
+
- 1
|
100
|
+
- 2
|
101
|
+
- 5
|
74
102
|
version: 1.2.5
|
75
|
-
|
103
|
+
type: :development
|
104
|
+
version_requirements: *id006
|
76
105
|
description: Ruby wrapper for the chargify.com SAAS and billing API
|
77
106
|
email: wynn.netherland@gmail.com
|
78
107
|
executables: []
|
@@ -101,6 +130,7 @@ files:
|
|
101
130
|
- test/fixtures/product.json
|
102
131
|
- test/fixtures/products.json
|
103
132
|
- test/fixtures/subscription.json
|
133
|
+
- test/fixtures/subscription_not_found.json
|
104
134
|
- test/fixtures/subscriptions.json
|
105
135
|
- test/helper.rb
|
106
136
|
- test/test_chargify.rb
|
@@ -117,18 +147,20 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
117
147
|
requirements:
|
118
148
|
- - ">="
|
119
149
|
- !ruby/object:Gem::Version
|
150
|
+
segments:
|
151
|
+
- 0
|
120
152
|
version: "0"
|
121
|
-
version:
|
122
153
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
123
154
|
requirements:
|
124
155
|
- - ">="
|
125
156
|
- !ruby/object:Gem::Version
|
157
|
+
segments:
|
158
|
+
- 0
|
126
159
|
version: "0"
|
127
|
-
version:
|
128
160
|
requirements: []
|
129
161
|
|
130
162
|
rubyforge_project:
|
131
|
-
rubygems_version: 1.3.
|
163
|
+
rubygems_version: 1.3.6
|
132
164
|
signing_key:
|
133
165
|
specification_version: 3
|
134
166
|
summary: Ruby wrapper for the chargify.com SAAS and billing API
|