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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 25ebfbf84bcee0acb6cab757e949ab8654b7e41d
4
- data.tar.gz: '09546cf8adf0ad0dbfabd54675e256edfabdfab5'
3
+ metadata.gz: d48581c1171216fe7ef9531bec2b538d86c9efa3
4
+ data.tar.gz: 52b3b1afca13937918ba3e18b3bbdceeece78119
5
5
  SHA512:
6
- metadata.gz: c10a085b2465b5da8ba4490d6c34cd25be875fa5bdb0de22e4e02c25b457d7d57bf8476c8126c0a2f1c7df9d4f0b4a401f0341b0bc2b230cd3cc535b40e40f9d
7
- data.tar.gz: 6779c4a2e3561ec53bc52a929cb51c17d9b17b2eea2ffb35f511924a84a8690be9f32022055de581d165a34d45adb2e74598583ae532cd13a5e47db3277e0ef4
6
+ metadata.gz: 23ed293fa6fe762582cb8eb6fc544324e15d414775a7cd7c7ccd43ab2d0eef8b1686a1d2acdd65c31a90b94c503e6a29212df7fd61a2b0ddbb5b8fa6a8a2da15
7
+ data.tar.gz: 8682b7258691c520754931d7a3e09b4c9cb2291c96f01753f8fbcbb81f307aa8fedcdc64272a312be50b0675499a6c6f59028899070b5193bc050612d4393c12
data/.travis.yml CHANGED
@@ -1,7 +1,6 @@
1
1
  language: ruby
2
2
 
3
3
  rvm:
4
- - 2.0
5
4
  - 2.1
6
5
  - 2.2
7
6
  - 2.3
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", ">= 1.5"
27
+ gem "rack", ">= 2.0.6"
28
28
  else
29
- gem "rack", ">= 1.5", "< 2.0" # rubocop:disable Bundler/DuplicatedGem
29
+ gem "rack", ">= 1.6.11", "< 2.0" # rubocop:disable Bundler/DuplicatedGem
30
30
  end
31
31
 
32
32
  platforms :mri do
33
- # to avoid problems, bring Byebug in on just versions of Ruby under which
34
- # it's known to work well
35
- if Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new("2.0.0")
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
- 3.31.1
1
+ 4.0.3
@@ -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 |c|
35
- c.use Faraday::Request::Multipart
36
- c.use Faraday::Request::UrlEncoded
37
- c.use Faraday::Response::RaiseError
38
- c.adapter Faraday.default_adapter
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
- if Stripe.enable_telemetry?
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Stripe
4
- VERSION = "3.31.1".freeze
4
+ VERSION = "4.0.3".freeze
5
5
  end
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.0.0"
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.10")
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
- resp = Faraday.get("http://localhost:#{MOCK_PORT}/")
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: 3.31.1
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-13 00:00:00.000000000 Z
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.10'
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.10'
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.0.0
232
+ version: 2.1.0
219
233
  required_rubygems_version: !ruby/object:Gem::Requirement
220
234
  requirements:
221
235
  - - ">="