braintree 2.80.0 → 2.80.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -42,8 +42,8 @@ module Braintree
42
42
  end
43
43
  end
44
44
 
45
- def connect_url(params)
46
- params[:client_id] = @config.client_id
45
+ def connect_url(raw_params)
46
+ params = raw_params.merge({:client_id => @config.client_id})
47
47
  user_params = _sub_query(params, :user)
48
48
  business_params = _sub_query(params, :business)
49
49
  payment_methods = _sub_array_query(params, :payment_methods)
@@ -53,8 +53,7 @@ module Braintree
53
53
  concat(payment_methods)
54
54
 
55
55
  query_string = query.map { |k, v| "#{CGI.escape(k.to_s)}=#{CGI.escape(v.to_s)}" }.join("&")
56
- url = "#{@config.base_url}/oauth/connect?#{query_string}"
57
- "#{url}&signature=#{_compute_signature(url)}&algorithm=SHA256"
56
+ "#{@config.base_url}/oauth/connect?#{query_string}"
58
57
  end
59
58
 
60
59
  def _sub_query(params, root)
@@ -70,10 +69,5 @@ module Braintree
70
69
  ["#{root}[]", value]
71
70
  end
72
71
  end
73
-
74
- def _compute_signature(url)
75
- key_digest = OpenSSL::Digest::SHA256.digest(@config.client_secret)
76
- OpenSSL::HMAC.hexdigest(OpenSSL::Digest::SHA256.new, key_digest, url)
77
- end
78
72
  end
79
73
  end
@@ -2,7 +2,7 @@ module Braintree
2
2
  module Version
3
3
  Major = 2
4
4
  Minor = 80
5
- Tiny = 0
5
+ Tiny = 1
6
6
 
7
7
  String = "#{Major}.#{Minor}.#{Tiny}"
8
8
  end
@@ -193,9 +193,6 @@ describe "OAuth" do
193
193
  query["business[fulfillment_completed_in]"].should == ["7"]
194
194
  query["business[currency]"].should == ["USD"]
195
195
  query["business[website]"].should == ["http://example.com"]
196
-
197
- query["signature"][0].length.should == 64
198
- query["algorithm"].should == ["SHA256"]
199
196
  end
200
197
 
201
198
  it "builds the query string with multiple payment_methods" do
@@ -216,19 +213,13 @@ describe "OAuth" do
216
213
  query["payment_methods[]"].should include("paypal")
217
214
  query["payment_methods[]"].should include("credit_card")
218
215
  end
219
- end
220
216
 
221
- describe "_compute_signature" do
222
- it "computes the correct signature" do
223
- @gateway = Braintree::Gateway.new(
224
- :client_id => "client_id$development$integration_client_id",
225
- :client_secret => "client_secret$development$integration_client_secret",
226
- :logger => Logger.new("/dev/null")
227
- )
228
- url = "http://localhost:3000/oauth/connect?business%5Bname%5D=We+Like+Spaces&client_id=client_id%24development%24integration_client_id"
229
- signature = @gateway.oauth._compute_signature(url)
217
+ it "doesn't mutate the options" do
218
+ params = {:payment_methods => ["credit_card"]}
219
+
220
+ @gateway.oauth.connect_url(params)
230
221
 
231
- signature.should == "a36bcf10dd982e2e47e0d6a2cb930aea47ade73f954b7d59c58dae6167894d41"
222
+ params.should == {:payment_methods => ["credit_card"]}
232
223
  end
233
224
  end
234
225
  end
@@ -1944,7 +1944,7 @@ describe Braintree::Transaction do
1944
1944
  }
1945
1945
  )
1946
1946
  result.success?.should == true
1947
- result.transaction.status.should == Braintree::Transaction::Status::Settled
1947
+ result.transaction.status.should == Braintree::Transaction::Status::Settling
1948
1948
  end
1949
1949
  end
1950
1950
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: braintree
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.80.0
4
+ version: 2.80.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-11-22 00:00:00.000000000 Z
12
+ date: 2017-11-27 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: builder