stripe 5.12.0 → 5.12.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 55067d7f30895ad9f8db64722245e435ae1aefb70cb66f4a15ad21c377dab5c4
4
- data.tar.gz: eeff6f15f2862e5cc91e5736ebbd48d8e32c67a1b8422227f82fcff30e9141c8
3
+ metadata.gz: 0570b7f7b0bbe1a7c91a0a6cd07717d2e9331fe5d777726fb571474353fbff73
4
+ data.tar.gz: f746545c8410645471bc32bfddf4292dacf482b631da8fba0c7f7d1a8579dc30
5
5
  SHA512:
6
- metadata.gz: cc31ffaef1cbc83cda287389885cb89b0d0059f4f6b1f8b41d7061b69805912d32db132d87ec71ced2c64a9a9ae85701d906cc8aea8c4b16e9b427d7d7e63073
7
- data.tar.gz: 9762eb9b7e2a2cbb27e11fe8a4b1a0b33399982784a54e451fc093a663c32237e3f6f72d2e6eadf6ae123adc8ef93da270ae8a7a07b86a25a3038a790cf0dda5
6
+ metadata.gz: f251f509afb9f3eac4cebac9f78cd15be8c3fd53f08b2c746f6164e6f5f5b83145773f541c81ff438d2c7bb1a74ab4a25588fa8da3aeea2d96db50021aabef1c
7
+ data.tar.gz: dd8a64b42bed565a4cb09c8cc533bacf2be8180ad9e0b1269b1d740424234be7bccb90cc8e4a00bc95a076652df8f7d92548443bb3b3b28a115b1746be5177f4
data/CHANGELOG.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # Changelog
2
2
 
3
+ ## 5.12.1 - 2020-01-06
4
+ * [#890](https://github.com/stripe/stripe-ruby/pull/890) Override API key with `client_secret` in `OAuth.token`
5
+
3
6
  ## 5.12.0 - 2020-01-02
4
7
  * [#889](https://github.com/stripe/stripe-ruby/pull/889) Add support for retrieve source transaction API method
5
8
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 5.12.0
1
+ 5.12.1
data/lib/stripe/oauth.rb CHANGED
@@ -43,6 +43,7 @@ module Stripe
43
43
 
44
44
  def self.token(params = {}, opts = {})
45
45
  opts = Util.normalize_opts(opts)
46
+ opts[:api_key] = params[:client_secret] if params[:client_secret]
46
47
  resp, opts = OAuthOperations.request(
47
48
  :post, "/oauth/token", params, opts
48
49
  )
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Stripe
4
- VERSION = "5.12.0"
4
+ VERSION = "5.12.1"
5
5
  end
@@ -67,6 +67,22 @@ module Stripe
67
67
  code: "this_is_an_authorization_code")
68
68
  assert_equal("sk_access_token", resp.access_token)
69
69
  end
70
+
71
+ should "override the API key when client_secret is passed" do
72
+ stub_request(:post, "#{Stripe.connect_base}/oauth/token")
73
+ .with(body: {
74
+ "client_secret" => "client_secret_override",
75
+ "grant_type" => "authorization_code",
76
+ "code" => "this_is_an_authorization_code",
77
+ })
78
+ .with(headers: { "Authorization": "Bearer client_secret_override" })
79
+ .to_return(body: JSON.generate(access_token: "another_access_token"))
80
+
81
+ resp = OAuth.token(client_secret: "client_secret_override",
82
+ grant_type: "authorization_code",
83
+ code: "this_is_an_authorization_code")
84
+ assert_equal("another_access_token", resp.access_token)
85
+ end
70
86
  end
71
87
 
72
88
  context ".deauthorize" do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stripe
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.12.0
4
+ version: 5.12.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stripe
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-01-02 00:00:00.000000000 Z
11
+ date: 2020-01-06 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Stripe is the easiest way to accept payments online. See https://stripe.com
14
14
  for details.