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 CHANGED
@@ -1,3 +1,8 @@
1
+ ## 1.1.1 - June 07, 2012
2
+
3
+ - Fix handling of cancel_uri
4
+
5
+
1
6
  ## 1.1.0 - May 25, 2012
2
7
 
3
8
  - Accept merchant_id as a client constructor param
@@ -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)
@@ -1,3 +1,3 @@
1
1
  module GoCardless
2
- VERSION = '1.1.0'.freeze
2
+ VERSION = '1.1.1'.freeze
3
3
  end
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: 3461773182973075480
4
+ hash: 4079999309947216651
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 1
9
- - 0
10
- version: 1.1.0
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-05-25 00:00:00 Z
19
+ date: 2012-06-07 00:00:00 Z
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
22
22
  name: oauth2