stripe 4.10.0 → 4.11.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop_todo.yml +10 -10
- data/CHANGELOG.md +3 -0
- data/README.md +8 -0
- data/VERSION +1 -1
- data/lib/stripe.rb +3 -1
- data/lib/stripe/stripe_client.rb +2 -0
- data/lib/stripe/version.rb +1 -1
- data/test/stripe/stripe_client_test.rb +19 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 81c34bec9bdd939d6ebe5a63c4a14e617e609fceaba92275168bd57b5f5f4f9d
|
4
|
+
data.tar.gz: 34365a8cd2d1a662984a387dba59891205a5a5e26bf4f7b7688d87340c210655
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1cb0774d3e51ac40a97ff62dd16543cc5782ceeca4f4b38922867a3d3635f7aee5581fb454025f4672b4b40e22d685a81265f3f8a4367907f6050ba010a0564c
|
7
|
+
data.tar.gz: 568a35c534b30e8d47be7a44f74401c590613e5f266746e4dc6214374350e3f7a855202d47e5846d0d787040548c3c2a6e11c027013dd421ecfd728453cf2e8c
|
data/.rubocop_todo.yml
CHANGED
@@ -1,30 +1,30 @@
|
|
1
1
|
# This configuration was generated by
|
2
2
|
# `rubocop --auto-gen-config`
|
3
|
-
# on
|
3
|
+
# on 2019-03-25 18:32:26 -0700 using RuboCop version 0.50.0.
|
4
4
|
# The point is for the user to remove these configuration records
|
5
5
|
# one by one as the offenses are removed from the code base.
|
6
6
|
# Note that changes in the inspected code, or installation of new
|
7
7
|
# versions of RuboCop, may require this file to be generated again.
|
8
8
|
|
9
|
-
# Offense count:
|
9
|
+
# Offense count: 20
|
10
10
|
Metrics/AbcSize:
|
11
|
-
Max:
|
11
|
+
Max: 53
|
12
12
|
|
13
|
-
# Offense count:
|
13
|
+
# Offense count: 31
|
14
14
|
# Configuration parameters: CountComments, ExcludedMethods.
|
15
15
|
Metrics/BlockLength:
|
16
16
|
Max: 498
|
17
17
|
|
18
|
-
# Offense count:
|
18
|
+
# Offense count: 9
|
19
19
|
# Configuration parameters: CountComments.
|
20
20
|
Metrics/ClassLength:
|
21
|
-
Max:
|
21
|
+
Max: 673
|
22
22
|
|
23
|
-
# Offense count:
|
23
|
+
# Offense count: 12
|
24
24
|
Metrics/CyclomaticComplexity:
|
25
25
|
Max: 15
|
26
26
|
|
27
|
-
# Offense count:
|
27
|
+
# Offense count: 364
|
28
28
|
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
|
29
29
|
# URISchemes: http, https
|
30
30
|
Metrics/LineLength:
|
@@ -35,7 +35,7 @@ Metrics/LineLength:
|
|
35
35
|
Metrics/ParameterLists:
|
36
36
|
Max: 7
|
37
37
|
|
38
|
-
# Offense count:
|
38
|
+
# Offense count: 7
|
39
39
|
Metrics/PerceivedComplexity:
|
40
40
|
Max: 17
|
41
41
|
|
@@ -45,6 +45,6 @@ Style/ClassVars:
|
|
45
45
|
- 'lib/stripe/stripe_object.rb'
|
46
46
|
- 'test/stripe/api_resource_test.rb'
|
47
47
|
|
48
|
-
# Offense count:
|
48
|
+
# Offense count: 78
|
49
49
|
Style/Documentation:
|
50
50
|
Enabled: false
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,8 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 4.11.0 - 2019-03-26
|
4
|
+
* [#753](https://github.com/stripe/stripe-ruby/pull/753) Add a global proxy configuration parameter
|
5
|
+
|
3
6
|
## 4.10.0 - 2019-03-18
|
4
7
|
* [#745](https://github.com/stripe/stripe-ruby/pull/745) Add support for the `PaymentMethod` resource and APIs
|
5
8
|
* [#747](https://github.com/stripe/stripe-ruby/pull/747) Add support for retrieving a Checkout `Session`
|
data/README.md
CHANGED
@@ -114,6 +114,14 @@ end
|
|
114
114
|
puts resp.request_id
|
115
115
|
```
|
116
116
|
|
117
|
+
### Configuring a proxy
|
118
|
+
|
119
|
+
A proxy can be configured with `Stripe.proxy`:
|
120
|
+
|
121
|
+
```ruby
|
122
|
+
Stripe.proxy = "https://user:pass@example.com:1234"
|
123
|
+
```
|
124
|
+
|
117
125
|
### Configuring an API Version
|
118
126
|
|
119
127
|
By default, the library will use the API version pinned to the account making
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
4.
|
1
|
+
4.11.0
|
data/lib/stripe.rb
CHANGED
@@ -121,6 +121,8 @@ module Stripe
|
|
121
121
|
@log_level = nil
|
122
122
|
@logger = nil
|
123
123
|
|
124
|
+
@proxy = nil
|
125
|
+
|
124
126
|
@max_network_retries = 0
|
125
127
|
@max_network_retry_delay = 2
|
126
128
|
@initial_network_retry_delay = 0.5
|
@@ -136,7 +138,7 @@ module Stripe
|
|
136
138
|
|
137
139
|
class << self
|
138
140
|
attr_accessor :stripe_account, :api_key, :api_base, :verify_ssl_certs, :api_version, :client_id, :connect_base, :uploads_base,
|
139
|
-
:open_timeout, :read_timeout
|
141
|
+
:open_timeout, :read_timeout, :proxy
|
140
142
|
|
141
143
|
attr_reader :max_network_retry_delay, :initial_network_retry_delay
|
142
144
|
end
|
data/lib/stripe/stripe_client.rb
CHANGED
data/lib/stripe/version.rb
CHANGED
@@ -750,6 +750,25 @@ module Stripe
|
|
750
750
|
end
|
751
751
|
end
|
752
752
|
|
753
|
+
context "#proxy" do
|
754
|
+
should "run the request through the proxy" do
|
755
|
+
begin
|
756
|
+
Thread.current[:stripe_client_default_conn] = nil
|
757
|
+
|
758
|
+
Stripe.proxy = "http://localhost:8080"
|
759
|
+
|
760
|
+
client = StripeClient.new
|
761
|
+
client.request {}
|
762
|
+
|
763
|
+
assert_equal "http://localhost:8080", Stripe::StripeClient.default_conn.proxy.uri.to_s
|
764
|
+
ensure
|
765
|
+
Stripe.proxy = nil
|
766
|
+
|
767
|
+
Thread.current[:stripe_client_default_conn] = nil
|
768
|
+
end
|
769
|
+
end
|
770
|
+
end
|
771
|
+
|
753
772
|
context "#telemetry" do
|
754
773
|
teardown do
|
755
774
|
# make sure to always set telemetry back to false
|
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.
|
4
|
+
version: 4.11.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stripe
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-03-
|
11
|
+
date: 2019-03-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|