stripe 1.39.0 → 1.40.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 +4 -4
- data/History.txt +4 -0
- data/VERSION +1 -1
- data/lib/stripe.rb +22 -1
- data/lib/stripe/stripe_object.rb +0 -8
- data/lib/stripe/version.rb +1 -1
- data/test/stripe/api_resource_test.rb +0 -15
- data/test/stripe/stripe_object_test.rb +0 -9
- 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: df8595ba1c8112e53a16598f41277d6fe8e0f120
|
4
|
+
data.tar.gz: c4511690653728df59c9e060ed1e01967fdd8e4e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: abab2102477a032ee062eade9b36b4a99a2704c5e831d7e43d9500ca63e7d6bd800dd256ec6ee3525d585cde3b2da3244326a9c134e28125eb879ee65e30cd8a
|
7
|
+
data.tar.gz: 725cb8e7ac1c6899311a750a90b905451340b41f34ed5a737d420d20108791366beb7f475d384760497c2345a8a6b622b1e23c9472fbc18bc1c7b03a6b91ce96
|
data/History.txt
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.
|
1
|
+
1.40.0
|
data/lib/stripe.rb
CHANGED
@@ -75,6 +75,7 @@ module Stripe
|
|
75
75
|
@initial_network_retry_delay = 0.5
|
76
76
|
|
77
77
|
@ca_bundle_path = DEFAULT_CA_BUNDLE_PATH
|
78
|
+
@ca_store = nil
|
78
79
|
@verify_ssl_certs = true
|
79
80
|
|
80
81
|
@open_timeout = 30
|
@@ -111,7 +112,7 @@ module Stripe
|
|
111
112
|
|
112
113
|
if verify_ssl_certs
|
113
114
|
request_opts = {:verify_ssl => OpenSSL::SSL::VERIFY_PEER,
|
114
|
-
:
|
115
|
+
:ssl_cert_store => ca_store}
|
115
116
|
else
|
116
117
|
request_opts = {:verify_ssl => false}
|
117
118
|
unless @verify_ssl_warned
|
@@ -156,6 +157,26 @@ module Stripe
|
|
156
157
|
|
157
158
|
def self.ca_bundle_path=(path)
|
158
159
|
@ca_bundle_path = path
|
160
|
+
|
161
|
+
# empty this field so a new store is initialized
|
162
|
+
@ca_store = nil
|
163
|
+
end
|
164
|
+
|
165
|
+
# A certificate store initialized from the the bundle in #ca_bundle_path and
|
166
|
+
# which is used to validate TLS on every request.
|
167
|
+
#
|
168
|
+
# This was added to the give the gem "pseudo thread safety" in that it seems
|
169
|
+
# when initiating many parallel requests marshaling the certificate store is
|
170
|
+
# the most likely point of failure (see issue #382). Any program attempting
|
171
|
+
# to leverage this pseudo safety should make a call to this method (i.e.
|
172
|
+
# `Stripe.ca_store`) in their initialization code because it marshals lazily
|
173
|
+
# and is itself not thread safe.
|
174
|
+
def self.ca_store
|
175
|
+
@ca_store ||= begin
|
176
|
+
store = OpenSSL::X509::Store.new
|
177
|
+
store.add_file(ca_bundle_path)
|
178
|
+
store
|
179
|
+
end
|
159
180
|
end
|
160
181
|
|
161
182
|
def self.max_network_retries
|
data/lib/stripe/stripe_object.rb
CHANGED
@@ -329,14 +329,6 @@ module Stripe
|
|
329
329
|
when nil
|
330
330
|
''
|
331
331
|
|
332
|
-
# The logic here is that essentially any object embedded in another
|
333
|
-
# object that had a `type` is actually an API resource of a different
|
334
|
-
# type that's been included in the response. These other resources must
|
335
|
-
# be updated from their proper endpoints, and therefore they are not
|
336
|
-
# included when serializing even if they've been modified.
|
337
|
-
when APIResource
|
338
|
-
nil
|
339
|
-
|
340
332
|
when Array
|
341
333
|
update = value.map { |v| serialize_params_value(v, nil, true, force) }
|
342
334
|
|
data/lib/stripe/version.rb
CHANGED
@@ -551,21 +551,6 @@ module Stripe
|
|
551
551
|
acct.save
|
552
552
|
end
|
553
553
|
|
554
|
-
should 'not save nested API resources' do
|
555
|
-
ch = Stripe::Charge.construct_from({
|
556
|
-
:id => 'charge_id',
|
557
|
-
:customer => {
|
558
|
-
:object => 'customer',
|
559
|
-
:id => 'customer_id'
|
560
|
-
}
|
561
|
-
})
|
562
|
-
|
563
|
-
@mock.expects(:post).once.with("#{Stripe.api_base}/v1/charges/charge_id", nil, '').returns(make_response({"id" => "charge_id"}))
|
564
|
-
|
565
|
-
ch.customer.description = 'Bob'
|
566
|
-
ch.save
|
567
|
-
end
|
568
|
-
|
569
554
|
should 'correctly handle replaced nested objects' do
|
570
555
|
acct = Stripe::Account.construct_from({
|
571
556
|
:id => 'myid',
|
@@ -240,15 +240,6 @@ module Stripe
|
|
240
240
|
assert_equal([{ :foo => "bar" }], serialized[:metadata])
|
241
241
|
end
|
242
242
|
|
243
|
-
should "#serialize_params and remove embedded APIResources" do
|
244
|
-
obj = Stripe::StripeObject.construct_from({
|
245
|
-
:customer => Customer.construct_from({})
|
246
|
-
})
|
247
|
-
|
248
|
-
serialized = obj.serialize_params
|
249
|
-
assert_equal({}, serialized)
|
250
|
-
end
|
251
|
-
|
252
243
|
should "#serialize_params takes a force option" do
|
253
244
|
obj = Stripe::StripeObject.construct_from({
|
254
245
|
:id => 'id',
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: stripe
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.40.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ross Boucher
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-
|
12
|
+
date: 2016-04-06 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rest-client
|