gocardless 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/gocardless.gemspec +2 -2
- data/lib/gocardless/bill.rb +1 -0
- data/lib/gocardless/client.rb +2 -0
- data/lib/gocardless/version.rb +1 -1
- data/spec/client_spec.rb +13 -1
- metadata +6 -6
data/gocardless.gemspec
CHANGED
@@ -9,9 +9,9 @@ Gem::Specification.new do |gem|
|
|
9
9
|
gem.add_development_dependency "yard", "~> 0.7.3"
|
10
10
|
gem.add_development_dependency "redcarpet", "~> 1.17.2"
|
11
11
|
|
12
|
-
gem.authors = ["Harry Marr"]
|
12
|
+
gem.authors = ["Harry Marr, Tom Blomfield"]
|
13
13
|
gem.description = %q{A Ruby wrapper for the GoCardless API}
|
14
|
-
gem.email = ['
|
14
|
+
gem.email = ['developers@gocardless.com']
|
15
15
|
gem.files = `git ls-files`.split("\n")
|
16
16
|
gem.homepage = 'https://github.com/gocardless/gocardless-ruby'
|
17
17
|
gem.name = 'gocardless'
|
data/lib/gocardless/bill.rb
CHANGED
data/lib/gocardless/client.rb
CHANGED
@@ -326,6 +326,7 @@ module GoCardless
|
|
326
326
|
|
327
327
|
limit_params[:merchant_id] = merchant_id
|
328
328
|
redirect_uri = limit_params.delete(:redirect_uri)
|
329
|
+
state = limit_params.delete(:state)
|
329
330
|
|
330
331
|
params = {
|
331
332
|
:nonce => generate_nonce,
|
@@ -334,6 +335,7 @@ module GoCardless
|
|
334
335
|
type => limit_params,
|
335
336
|
}
|
336
337
|
params[:redirect_uri] = redirect_uri unless redirect_uri.nil?
|
338
|
+
params[:state] = state unless state.nil?
|
337
339
|
|
338
340
|
sign_params(params)
|
339
341
|
|
data/lib/gocardless/version.rb
CHANGED
data/spec/client_spec.rb
CHANGED
@@ -329,6 +329,18 @@ describe GoCardless::Client do
|
|
329
329
|
end
|
330
330
|
end
|
331
331
|
|
332
|
+
it "should include the state in the URL query" do
|
333
|
+
params = { 'a' => '1', 'b' => '2', :state => "blah" }
|
334
|
+
url = @client.send(:new_limit_url, :subscription, params)
|
335
|
+
get_params(url)["state"].should == "blah"
|
336
|
+
end
|
337
|
+
|
338
|
+
it "should include the redirect_uri in the URL query" do
|
339
|
+
params = { 'a' => '1', 'b' => '2', :redirect_uri => "http://www.google.com" }
|
340
|
+
url = @client.send(:new_limit_url, :subscription, params)
|
341
|
+
get_params(url)["redirect_uri"].should == "http://www.google.com"
|
342
|
+
end
|
343
|
+
|
332
344
|
it "should add merchant_id to the limit" do
|
333
345
|
url = @client.send(:new_limit_url, :subscription, {})
|
334
346
|
get_params(url)['subscription[merchant_id]'].should == @merchant_id
|
@@ -353,7 +365,7 @@ describe GoCardless::Client do
|
|
353
365
|
|
354
366
|
it "should include a timestamp" do
|
355
367
|
# Time.now returning Pacific time
|
356
|
-
time = Time.parse('Sat Jan 01 00:00:00 -0800')
|
368
|
+
time = Time.parse('Sat Jan 01 2011 00:00:00 -0800')
|
357
369
|
Time.expects(:now).returns time
|
358
370
|
params = get_params(@client.send(:new_limit_url, :subscription, :x => 1))
|
359
371
|
# Check that timezone is ISO formatted UTC
|
metadata
CHANGED
@@ -1,21 +1,21 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gocardless
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 25
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 1
|
10
|
+
version: 0.1.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
|
-
- Harry Marr
|
13
|
+
- Harry Marr, Tom Blomfield
|
14
14
|
autorequire:
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date:
|
18
|
+
date: 2012-01-12 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: oauth2
|
@@ -116,7 +116,7 @@ dependencies:
|
|
116
116
|
version_requirements: *id006
|
117
117
|
description: A Ruby wrapper for the GoCardless API
|
118
118
|
email:
|
119
|
-
-
|
119
|
+
- developers@gocardless.com
|
120
120
|
executables: []
|
121
121
|
|
122
122
|
extensions: []
|