stripe 1.53.0 → 1.54.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/History.txt +4 -0
- data/VERSION +1 -1
- data/lib/stripe.rb +18 -16
- data/lib/stripe/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2e8c4b76709e3ec68cbde150b1a649435e1e1f29
|
4
|
+
data.tar.gz: 702b785a0995a4eb697a97ff3b6699c54e139d37
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e00542306c9b283d4a982fc5cdfce20e64f955517cca663baa0c2f6f5e9c0da7851f8895b9fa71c447e7fdfa785faa465cec2a930ec0064f3842bfbbcc9a247d
|
7
|
+
data.tar.gz: 5dd42345b9e9722cb4512010f6cffa56bac39c9ddcb4acfff228135fd3d4ac44c3098ca8f25abc7f371472a377c16783fad160ca545b454f23447ef3e65d1025
|
data/History.txt
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.
|
1
|
+
1.54.0
|
data/lib/stripe.rb
CHANGED
@@ -70,10 +70,22 @@ require 'stripe/errors/rate_limit_error'
|
|
70
70
|
module Stripe
|
71
71
|
DEFAULT_CA_BUNDLE_PATH = File.dirname(__FILE__) + '/data/ca-certificates.crt'
|
72
72
|
|
73
|
-
#
|
74
|
-
#
|
75
|
-
|
76
|
-
|
73
|
+
# Exceptions which we'd like to retry. This includes both socket errors that
|
74
|
+
# may represent an intermittent problem and some special HTTP statuses.
|
75
|
+
RETRY_EXCEPTIONS = [
|
76
|
+
# Destination refused the connection. This could occur from a single
|
77
|
+
# saturated server, so retry in case it's intermittent.
|
78
|
+
Errno::ECONNREFUSED,
|
79
|
+
|
80
|
+
# Connection reset. This occasionally occurs on a server problem, and
|
81
|
+
# deserves a retry because the server should terminate all requests
|
82
|
+
# properly even if they were invalid.
|
83
|
+
Errno::ECONNRESET,
|
84
|
+
|
85
|
+
# Timed out making the connection. It's worth retrying under this
|
86
|
+
# circumstance.
|
87
|
+
Errno::ETIMEDOUT,
|
88
|
+
|
77
89
|
# A server may respond with a 409 to indicate that there is a concurrent
|
78
90
|
# request executing with the same idempotency key. In the case that a
|
79
91
|
# request failed due to a connection problem and the client has retried too
|
@@ -442,18 +454,8 @@ module Stripe
|
|
442
454
|
end
|
443
455
|
|
444
456
|
def self.should_retry?(e, retry_count)
|
445
|
-
|
446
|
-
|
447
|
-
# Certificate validation problem: do not retry.
|
448
|
-
return false if e.is_a?(RestClient::SSLCertificateNotVerified)
|
449
|
-
|
450
|
-
# Generally don't retry when we got a successful response back from the
|
451
|
-
# Stripe API server, but with some exceptions (for more details, see notes
|
452
|
-
# on RETRY_HTTP_EXCEPTIONS).
|
453
|
-
return false if e.is_a?(RestClient::ExceptionWithResponse) &&
|
454
|
-
!RETRY_HTTP_EXCEPTIONS.any? { |klass| e.is_a?(klass) }
|
455
|
-
|
456
|
-
return true
|
457
|
+
retry_count < self.max_network_retries &&
|
458
|
+
RETRY_EXCEPTIONS.any? { |klass| e.is_a?(klass) }
|
457
459
|
end
|
458
460
|
|
459
461
|
def self.sleep_time(retry_count)
|
data/lib/stripe/version.rb
CHANGED
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: 1.
|
4
|
+
version: 1.54.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stripe
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-09-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|