stripe 3.31.1 → 4.0.3
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.
- checksums.yaml +4 -4
- data/.travis.yml +0 -1
- data/CHANGELOG.md +13 -0
- data/Gemfile +5 -9
- data/VERSION +1 -1
- data/lib/stripe/stripe_client.rb +14 -6
- data/lib/stripe/version.rb +1 -1
- data/stripe.gemspec +3 -2
- data/test/test_helper.rb +2 -1
- metadata +19 -5
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d48581c1171216fe7ef9531bec2b538d86c9efa3
|
|
4
|
+
data.tar.gz: 52b3b1afca13937918ba3e18b3bbdceeece78119
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 23ed293fa6fe762582cb8eb6fc544324e15d414775a7cd7c7ccd43ab2d0eef8b1686a1d2acdd65c31a90b94c503e6a29212df7fd61a2b0ddbb5b8fa6a8a2da15
|
|
7
|
+
data.tar.gz: 8682b7258691c520754931d7a3e09b4c9cb2291c96f01753f8fbcbb81f307aa8fedcdc64272a312be50b0675499a6c6f59028899070b5193bc050612d4393c12
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 4.0.3 - 2018-11-19
|
|
4
|
+
* [#703](https://github.com/stripe/stripe-ruby/pull/703) Don't use `Net::HTTP::Persistent` on Windows where it's not well supported
|
|
5
|
+
|
|
6
|
+
## 4.0.2 - 2018-11-16
|
|
7
|
+
* [#701](https://github.com/stripe/stripe-ruby/pull/701) Require minimum Faraday 0.13 for proper support of persistent connections
|
|
8
|
+
|
|
9
|
+
## 4.0.1 - 2018-11-15
|
|
10
|
+
* [#699](https://github.com/stripe/stripe-ruby/pull/699) Only send telemetry if `Request-Id` was present in the response
|
|
11
|
+
|
|
12
|
+
## 4.0.0 - 2018-11-15
|
|
13
|
+
* [#698](https://github.com/stripe/stripe-ruby/pull/698) Use persistent connections by default through `Net::HTTP::Persistent`
|
|
14
|
+
* [#698](https://github.com/stripe/stripe-ruby/pull/698) Drop support for Ruby 2.0 (which we consider a breaking change here)
|
|
15
|
+
|
|
3
16
|
## 3.31.1 - 2018-11-12
|
|
4
17
|
* [#697](https://github.com/stripe/stripe-ruby/pull/697) Send telemetry in milliseconds specifically
|
|
5
18
|
|
data/Gemfile
CHANGED
|
@@ -24,18 +24,14 @@ group :development do
|
|
|
24
24
|
# older Ruby versions. Check Ruby the version here and put a maximum
|
|
25
25
|
# constraint on Rack if necessary.
|
|
26
26
|
if RUBY_VERSION >= "2.2.2"
|
|
27
|
-
gem "rack", ">=
|
|
27
|
+
gem "rack", ">= 2.0.6"
|
|
28
28
|
else
|
|
29
|
-
gem "rack", ">= 1.
|
|
29
|
+
gem "rack", ">= 1.6.11", "< 2.0" # rubocop:disable Bundler/DuplicatedGem
|
|
30
30
|
end
|
|
31
31
|
|
|
32
32
|
platforms :mri do
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
gem "byebug"
|
|
37
|
-
gem "pry"
|
|
38
|
-
gem "pry-byebug"
|
|
39
|
-
end
|
|
33
|
+
gem "byebug"
|
|
34
|
+
gem "pry"
|
|
35
|
+
gem "pry-byebug"
|
|
40
36
|
end
|
|
41
37
|
end
|
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
4.0.3
|
data/lib/stripe/stripe_client.rb
CHANGED
|
@@ -31,11 +31,18 @@ module Stripe
|
|
|
31
31
|
# of connection re-use, so make sure that we have a separate connection
|
|
32
32
|
# object per thread.
|
|
33
33
|
Thread.current[:stripe_client_default_conn] ||= begin
|
|
34
|
-
conn = Faraday.new do |
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
34
|
+
conn = Faraday.new do |builder|
|
|
35
|
+
builder.use Faraday::Request::Multipart
|
|
36
|
+
builder.use Faraday::Request::UrlEncoded
|
|
37
|
+
builder.use Faraday::Response::RaiseError
|
|
38
|
+
|
|
39
|
+
# Net::HTTP::Persistent doesn't seem to do well on Windows or JRuby,
|
|
40
|
+
# so fall back to default there.
|
|
41
|
+
if Gem.win_platform? || RUBY_PLATFORM == "java"
|
|
42
|
+
builder.adapter :net_http
|
|
43
|
+
else
|
|
44
|
+
builder.adapter :net_http_persistent
|
|
45
|
+
end
|
|
39
46
|
end
|
|
40
47
|
|
|
41
48
|
if Stripe.verify_ssl_certs
|
|
@@ -218,7 +225,8 @@ module Stripe
|
|
|
218
225
|
resp = yield
|
|
219
226
|
context = context.dup_from_response(resp)
|
|
220
227
|
log_response(context, request_start, resp.status, resp.body)
|
|
221
|
-
|
|
228
|
+
|
|
229
|
+
if Stripe.enable_telemetry? && context.request_id
|
|
222
230
|
request_duration_ms = ((Time.now - request_start) * 1000).to_int
|
|
223
231
|
@last_request_metrics = StripeRequestMetrics.new(context.request_id, request_duration_ms)
|
|
224
232
|
end
|
data/lib/stripe/version.rb
CHANGED
data/stripe.gemspec
CHANGED
|
@@ -7,7 +7,7 @@ require "stripe/version"
|
|
|
7
7
|
Gem::Specification.new do |s|
|
|
8
8
|
s.name = "stripe"
|
|
9
9
|
s.version = Stripe::VERSION
|
|
10
|
-
s.required_ruby_version = ">= 2.
|
|
10
|
+
s.required_ruby_version = ">= 2.1.0"
|
|
11
11
|
s.summary = "Ruby bindings for the Stripe API"
|
|
12
12
|
s.description = "Stripe is the easiest way to accept payments online. See https://stripe.com for details."
|
|
13
13
|
s.author = "Stripe"
|
|
@@ -15,7 +15,8 @@ Gem::Specification.new do |s|
|
|
|
15
15
|
s.homepage = "https://stripe.com/docs/api/ruby"
|
|
16
16
|
s.license = "MIT"
|
|
17
17
|
|
|
18
|
-
s.add_dependency("faraday", "~> 0.
|
|
18
|
+
s.add_dependency("faraday", "~> 0.13")
|
|
19
|
+
s.add_dependency("net-http-persistent", "~> 3.0")
|
|
19
20
|
|
|
20
21
|
s.files = `git ls-files`.split("\n")
|
|
21
22
|
s.test_files = `git ls-files -- test/*`.split("\n")
|
data/test/test_helper.rb
CHANGED
|
@@ -27,7 +27,8 @@ WebMock.disable_net_connect!(allow: "localhost:#{MOCK_PORT}")
|
|
|
27
27
|
# we can print one error and fail fast so that it's more clear to the user how
|
|
28
28
|
# they should fix the problem.
|
|
29
29
|
begin
|
|
30
|
-
|
|
30
|
+
conn = Faraday::Connection.new("http://localhost:#{MOCK_PORT}")
|
|
31
|
+
resp = conn.get("/")
|
|
31
32
|
version = resp.headers["Stripe-Mock-Version"]
|
|
32
33
|
if version != "master" &&
|
|
33
34
|
Gem::Version.new(version) < Gem::Version.new(MOCK_MINIMUM_VERSION)
|
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:
|
|
4
|
+
version: 4.0.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Stripe
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2018-11-
|
|
11
|
+
date: 2018-11-19 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: faraday
|
|
@@ -16,14 +16,28 @@ dependencies:
|
|
|
16
16
|
requirements:
|
|
17
17
|
- - "~>"
|
|
18
18
|
- !ruby/object:Gem::Version
|
|
19
|
-
version: '0.
|
|
19
|
+
version: '0.13'
|
|
20
20
|
type: :runtime
|
|
21
21
|
prerelease: false
|
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
|
23
23
|
requirements:
|
|
24
24
|
- - "~>"
|
|
25
25
|
- !ruby/object:Gem::Version
|
|
26
|
-
version: '0.
|
|
26
|
+
version: '0.13'
|
|
27
|
+
- !ruby/object:Gem::Dependency
|
|
28
|
+
name: net-http-persistent
|
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
|
30
|
+
requirements:
|
|
31
|
+
- - "~>"
|
|
32
|
+
- !ruby/object:Gem::Version
|
|
33
|
+
version: '3.0'
|
|
34
|
+
type: :runtime
|
|
35
|
+
prerelease: false
|
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
37
|
+
requirements:
|
|
38
|
+
- - "~>"
|
|
39
|
+
- !ruby/object:Gem::Version
|
|
40
|
+
version: '3.0'
|
|
27
41
|
description: Stripe is the easiest way to accept payments online. See https://stripe.com
|
|
28
42
|
for details.
|
|
29
43
|
email: support@stripe.com
|
|
@@ -215,7 +229,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
215
229
|
requirements:
|
|
216
230
|
- - ">="
|
|
217
231
|
- !ruby/object:Gem::Version
|
|
218
|
-
version: 2.
|
|
232
|
+
version: 2.1.0
|
|
219
233
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
220
234
|
requirements:
|
|
221
235
|
- - ">="
|