chargify_api_ares 1.4.7 → 1.4.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/chargify_api_ares.gemspec +2 -2
- data/gemfiles/rails_3.gemfile.lock +1 -1
- data/gemfiles/rails_4.1.gemfile.lock +1 -1
- data/gemfiles/rails_4.gemfile.lock +1 -1
- data/lib/chargify_api_ares.rb +1 -0
- data/lib/chargify_api_ares/resources/coupon.rb +1 -1
- data/lib/chargify_api_ares/resources/customer.rb +5 -0
- data/lib/chargify_api_ares/resources/management_link.rb +9 -0
- data/spec/resources/coupon_spec.rb +1 -1
- data/spec/resources/customer_spec.rb +12 -0
- metadata +31 -29
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fb3a765f7ae0b2bd024cdf2c561b17c789b33899
|
4
|
+
data.tar.gz: d5e151269cdba78b80704bba7c35b015232b189d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 173677c5ddacf124ddb5d7bcaa070d1ce86e3092908065bfed05db10704346ddcd5532c68ec2effdbade023c311c40ec653ee14b6a40b7350a2f477c83bb964c
|
7
|
+
data.tar.gz: a0a72b1b94e6b7cacf96f1435b452700142954958d9b53c7ec0acce9459189e3a44c2c40b9843f833e6dbfab2873e933e94b46d7fe6c14fafc3820abe7121722
|
data/Gemfile.lock
CHANGED
data/chargify_api_ares.gemspec
CHANGED
@@ -4,8 +4,8 @@ Gem::Specification.new do |s|
|
|
4
4
|
s.rubygems_version = '1.3.7'
|
5
5
|
|
6
6
|
s.name = 'chargify_api_ares'
|
7
|
-
s.version = '1.4.
|
8
|
-
s.date = '
|
7
|
+
s.version = '1.4.10'
|
8
|
+
s.date = '2017-05-12'
|
9
9
|
s.summary = 'A Chargify API wrapper for Ruby using ActiveResource'
|
10
10
|
s.description = ''
|
11
11
|
s.authors = ["Chargify Development Team"]
|
data/lib/chargify_api_ares.rb
CHANGED
@@ -11,6 +11,7 @@ require 'chargify_api_ares/resources/coupon'
|
|
11
11
|
require 'chargify_api_ares/resources/customer_metadata'
|
12
12
|
require 'chargify_api_ares/resources/customer'
|
13
13
|
require 'chargify_api_ares/resources/event'
|
14
|
+
require 'chargify_api_ares/resources/management_link'
|
14
15
|
require 'chargify_api_ares/resources/migration'
|
15
16
|
require 'chargify_api_ares/resources/payment'
|
16
17
|
require 'chargify_api_ares/resources/payment_profile'
|
@@ -7,7 +7,7 @@ module Chargify
|
|
7
7
|
end
|
8
8
|
|
9
9
|
def self.find_by_product_family_id_and_code(product_family_id, code)
|
10
|
-
find(:one, :from => :
|
10
|
+
find(:one, :from => :find, :params => {:product_family_id => product_family_id, :code => code})
|
11
11
|
end
|
12
12
|
|
13
13
|
def self.validate(params = {})
|
@@ -15,6 +15,11 @@ module Chargify
|
|
15
15
|
Subscription.find(:all, :params => params)
|
16
16
|
end
|
17
17
|
|
18
|
+
def management_link(params = {})
|
19
|
+
params.merge!(:from => "/portal/customers/#{self.id}/management_link")
|
20
|
+
ManagementLink.find(:one, params)
|
21
|
+
end
|
22
|
+
|
18
23
|
def payment_profiles(params = {})
|
19
24
|
params.merge!({:customer_id => self.id})
|
20
25
|
PaymentProfile.find(:all, :params => params)
|
@@ -5,7 +5,7 @@ describe Chargify::Coupon, :fake_resource do
|
|
5
5
|
let(:existing_coupon) { build(:coupon, :code => '20OFF') }
|
6
6
|
|
7
7
|
before(:each) do
|
8
|
-
FakeWeb.register_uri(:get, "#{test_domain}/coupons/
|
8
|
+
FakeWeb.register_uri(:get, "#{test_domain}/coupons/find.xml?code=#{existing_coupon.code}&product_family_id=10", :body => existing_coupon.attributes.to_xml)
|
9
9
|
end
|
10
10
|
|
11
11
|
it "finds the correct coupon by product family and code" do
|
@@ -38,4 +38,16 @@ describe Chargify::Customer, :fake_resource do
|
|
38
38
|
end
|
39
39
|
end
|
40
40
|
|
41
|
+
context '#management_link' do
|
42
|
+
let(:customer) { Chargify::Customer.create(:id => 5, :reference => 'sigma') }
|
43
|
+
let(:management_link) { Chargify::ManagementLink.create(:customer_id => customer.id, :url => 'https://www.billingportal.com/manage/1/2/3') }
|
44
|
+
|
45
|
+
before(:each) do
|
46
|
+
FakeWeb.register_uri(:get, "#{test_domain}/portal/customers/#{customer.id}/management_link", :body => management_link.attributes.to_xml)
|
47
|
+
end
|
48
|
+
|
49
|
+
it "returns the management link belonging to the customer" do
|
50
|
+
expect(customer.management_link.attributes).to eq(management_link.attributes)
|
51
|
+
end
|
52
|
+
end
|
41
53
|
end
|
metadata
CHANGED
@@ -1,153 +1,153 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chargify_api_ares
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
4
|
+
version: 1.4.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chargify Development Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-05-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activeresource
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: 3.2.16
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: 3.2.16
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - ~>
|
31
|
+
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: 10.0.3
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - ~>
|
38
|
+
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: 10.0.3
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rspec
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - ~>
|
45
|
+
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: 2.12.0
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - ~>
|
52
|
+
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: 2.12.0
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: factory_girl
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- - ~>
|
59
|
+
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '2.6'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- - ~>
|
66
|
+
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '2.6'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: fakeweb
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- - ~>
|
73
|
+
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: 1.3.0
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- - ~>
|
80
|
+
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: 1.3.0
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: faker
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- - ~>
|
87
|
+
- - "~>"
|
88
88
|
- !ruby/object:Gem::Version
|
89
89
|
version: 1.1.2
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- - ~>
|
94
|
+
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: 1.1.2
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: pry
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
|
-
- -
|
101
|
+
- - ">="
|
102
102
|
- !ruby/object:Gem::Version
|
103
103
|
version: '0'
|
104
104
|
type: :development
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
|
-
- -
|
108
|
+
- - ">="
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '0'
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
112
|
name: vcr
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
114
114
|
requirements:
|
115
|
-
- -
|
115
|
+
- - ">="
|
116
116
|
- !ruby/object:Gem::Version
|
117
117
|
version: '0'
|
118
118
|
type: :development
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
121
|
requirements:
|
122
|
-
- -
|
122
|
+
- - ">="
|
123
123
|
- !ruby/object:Gem::Version
|
124
124
|
version: '0'
|
125
125
|
- !ruby/object:Gem::Dependency
|
126
126
|
name: dotenv
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|
128
128
|
requirements:
|
129
|
-
- -
|
129
|
+
- - ">="
|
130
130
|
- !ruby/object:Gem::Version
|
131
131
|
version: '0'
|
132
132
|
type: :development
|
133
133
|
prerelease: false
|
134
134
|
version_requirements: !ruby/object:Gem::Requirement
|
135
135
|
requirements:
|
136
|
-
- -
|
136
|
+
- - ">="
|
137
137
|
- !ruby/object:Gem::Version
|
138
138
|
version: '0'
|
139
139
|
- !ruby/object:Gem::Dependency
|
140
140
|
name: appraisal
|
141
141
|
requirement: !ruby/object:Gem::Requirement
|
142
142
|
requirements:
|
143
|
-
- -
|
143
|
+
- - ">="
|
144
144
|
- !ruby/object:Gem::Version
|
145
145
|
version: '0'
|
146
146
|
type: :development
|
147
147
|
prerelease: false
|
148
148
|
version_requirements: !ruby/object:Gem::Requirement
|
149
149
|
requirements:
|
150
|
-
- -
|
150
|
+
- - ">="
|
151
151
|
- !ruby/object:Gem::Version
|
152
152
|
version: '0'
|
153
153
|
description: ''
|
@@ -156,10 +156,10 @@ executables: []
|
|
156
156
|
extensions: []
|
157
157
|
extra_rdoc_files: []
|
158
158
|
files:
|
159
|
-
- .env
|
160
|
-
- .gitignore
|
161
|
-
- .rspec
|
162
|
-
- .travis.yml
|
159
|
+
- ".env"
|
160
|
+
- ".gitignore"
|
161
|
+
- ".rspec"
|
162
|
+
- ".travis.yml"
|
163
163
|
- Appraisals
|
164
164
|
- Gemfile
|
165
165
|
- Gemfile.lock
|
@@ -202,6 +202,7 @@ files:
|
|
202
202
|
- lib/chargify_api_ares/resources/customer_metafield.rb
|
203
203
|
- lib/chargify_api_ares/resources/event.rb
|
204
204
|
- lib/chargify_api_ares/resources/invoice.rb
|
205
|
+
- lib/chargify_api_ares/resources/management_link.rb
|
205
206
|
- lib/chargify_api_ares/resources/migration.rb
|
206
207
|
- lib/chargify_api_ares/resources/payment.rb
|
207
208
|
- lib/chargify_api_ares/resources/payment_profile.rb
|
@@ -257,17 +258,17 @@ require_paths:
|
|
257
258
|
- lib
|
258
259
|
required_ruby_version: !ruby/object:Gem::Requirement
|
259
260
|
requirements:
|
260
|
-
- -
|
261
|
+
- - ">="
|
261
262
|
- !ruby/object:Gem::Version
|
262
263
|
version: '0'
|
263
264
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
264
265
|
requirements:
|
265
|
-
- -
|
266
|
+
- - ">="
|
266
267
|
- !ruby/object:Gem::Version
|
267
268
|
version: '0'
|
268
269
|
requirements: []
|
269
270
|
rubyforge_project:
|
270
|
-
rubygems_version: 2.
|
271
|
+
rubygems_version: 2.4.8
|
271
272
|
signing_key:
|
272
273
|
specification_version: 3
|
273
274
|
summary: A Chargify API wrapper for Ruby using ActiveResource
|
@@ -302,3 +303,4 @@ test_files:
|
|
302
303
|
- spec/resources/usage_spec.rb
|
303
304
|
- spec/spec_helper.rb
|
304
305
|
- spec/support/fake_resource.rb
|
306
|
+
has_rdoc:
|