stripe 4.10.0 → 4.11.0

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
  SHA256:
3
- metadata.gz: '09105a67e4d42983626822bcf90bf3351cc649b675685eaf9cb32c3933906495'
4
- data.tar.gz: 210510e3a1ea6c59af40032f686c5e134b782ade08a6105d642f839ee29abe7c
3
+ metadata.gz: 81c34bec9bdd939d6ebe5a63c4a14e617e609fceaba92275168bd57b5f5f4f9d
4
+ data.tar.gz: 34365a8cd2d1a662984a387dba59891205a5a5e26bf4f7b7688d87340c210655
5
5
  SHA512:
6
- metadata.gz: 3c3c5cfe19a51851fb7b10db82f628a3584222ad8a7bf3151bc007d867659d0090c4eee8683edc4e2fd45f6ba875c117197522001dca145820e96ead9a627030
7
- data.tar.gz: 74e73fb61e12848686c1b842c149a3709576cbe82debf77f9aa1b213bf4a4c5e938c018d347c0edd7315a75f388b78140e1f546c9d80a45a13c343885056f4ec
6
+ metadata.gz: 1cb0774d3e51ac40a97ff62dd16543cc5782ceeca4f4b38922867a3d3635f7aee5581fb454025f4672b4b40e22d685a81265f3f8a4367907f6050ba010a0564c
7
+ data.tar.gz: 568a35c534b30e8d47be7a44f74401c590613e5f266746e4dc6214374350e3f7a855202d47e5846d0d787040548c3c2a6e11c027013dd421ecfd728453cf2e8c
@@ -1,30 +1,30 @@
1
1
  # This configuration was generated by
2
2
  # `rubocop --auto-gen-config`
3
- # on 2018-07-19 14:22:24 +0200 using RuboCop version 0.50.0.
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: 19
9
+ # Offense count: 20
10
10
  Metrics/AbcSize:
11
- Max: 54
11
+ Max: 53
12
12
 
13
- # Offense count: 27
13
+ # Offense count: 31
14
14
  # Configuration parameters: CountComments, ExcludedMethods.
15
15
  Metrics/BlockLength:
16
16
  Max: 498
17
17
 
18
- # Offense count: 8
18
+ # Offense count: 9
19
19
  # Configuration parameters: CountComments.
20
20
  Metrics/ClassLength:
21
- Max: 670
21
+ Max: 673
22
22
 
23
- # Offense count: 11
23
+ # Offense count: 12
24
24
  Metrics/CyclomaticComplexity:
25
25
  Max: 15
26
26
 
27
- # Offense count: 278
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: 5
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: 56
48
+ # Offense count: 78
49
49
  Style/Documentation:
50
50
  Enabled: false
@@ -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.10.0
1
+ 4.11.0
@@ -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
@@ -45,6 +45,8 @@ module Stripe
45
45
  end
46
46
  end
47
47
 
48
+ conn.proxy = Stripe.proxy if Stripe.proxy
49
+
48
50
  if Stripe.verify_ssl_certs
49
51
  conn.ssl.verify = true
50
52
  conn.ssl.cert_store = Stripe.ca_store
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Stripe
4
- VERSION = "4.10.0".freeze
4
+ VERSION = "4.11.0".freeze
5
5
  end
@@ -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.10.0
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-18 00:00:00.000000000 Z
11
+ date: 2019-03-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday