gocardless 1.1.0 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +5 -0
- data/lib/gocardless/client.rb +2 -0
- data/lib/gocardless/version.rb +1 -1
- data/spec/client_spec.rb +16 -0
- metadata +4 -4
data/CHANGELOG.md
CHANGED
data/lib/gocardless/client.rb
CHANGED
@@ -338,6 +338,7 @@ module GoCardless
|
|
338
338
|
|
339
339
|
limit_params[:merchant_id] = merchant_id
|
340
340
|
redirect_uri = limit_params.delete(:redirect_uri)
|
341
|
+
cancel_uri = limit_params.delete(:cancel_uri)
|
341
342
|
state = limit_params.delete(:state)
|
342
343
|
|
343
344
|
params = {
|
@@ -347,6 +348,7 @@ module GoCardless
|
|
347
348
|
type => limit_params,
|
348
349
|
}
|
349
350
|
params[:redirect_uri] = redirect_uri unless redirect_uri.nil?
|
351
|
+
params[:cancel_uri] = cancel_uri unless cancel_uri.nil?
|
350
352
|
params[:state] = state unless state.nil?
|
351
353
|
|
352
354
|
sign_params(params)
|
data/lib/gocardless/version.rb
CHANGED
data/spec/client_spec.rb
CHANGED
@@ -64,6 +64,16 @@ describe GoCardless::Client do
|
|
64
64
|
query['client_id'].first.should == @app_id
|
65
65
|
end
|
66
66
|
|
67
|
+
it "includes the cancel uri if present" do
|
68
|
+
cancel_uri = 'http://test/cancel'
|
69
|
+
url = URI.parse(@client.authorize_url(
|
70
|
+
:redirect_uri => @redirect_uri,
|
71
|
+
:cancel_uri => cancel_uri
|
72
|
+
))
|
73
|
+
query = CGI.parse(url.query)
|
74
|
+
query['cancel_uri'].first.should == cancel_uri
|
75
|
+
end
|
76
|
+
|
67
77
|
it "encodes prefilling parameters correctly" do
|
68
78
|
params = {:merchant => {:user => {:email => "a@b.com"}}}
|
69
79
|
url = @client.authorize_url(params.merge(:redirect_uri => @redirect_uri))
|
@@ -363,6 +373,12 @@ describe GoCardless::Client do
|
|
363
373
|
get_params(url)["redirect_uri"].should == "http://www.google.com"
|
364
374
|
end
|
365
375
|
|
376
|
+
it "should include the cancel_uri in the URL query" do
|
377
|
+
params = { 'a' => '1', 'b' => '2', :cancel_uri => "http://www.google.com" }
|
378
|
+
url = @client.send(:new_limit_url, :subscription, params)
|
379
|
+
get_params(url)["cancel_uri"].should == "http://www.google.com"
|
380
|
+
end
|
381
|
+
|
366
382
|
it "should add merchant_id to the limit" do
|
367
383
|
url = @client.send(:new_limit_url, :subscription, {})
|
368
384
|
get_params(url)['subscription[merchant_id]'].should == @merchant_id
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gocardless
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 4079999309947216651
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 1.1.
|
9
|
+
- 1
|
10
|
+
version: 1.1.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Harry Marr
|
@@ -16,7 +16,7 @@ autorequire:
|
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date: 2012-
|
19
|
+
date: 2012-06-07 00:00:00 Z
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
22
22
|
name: oauth2
|