stripe 1.39.0 → 1.40.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d85fbb3d136599c0b9bae5cb778c12f9ae096d63
4
- data.tar.gz: 67f6bc92701eb682d59e02475b40856cbcd809f2
3
+ metadata.gz: df8595ba1c8112e53a16598f41277d6fe8e0f120
4
+ data.tar.gz: c4511690653728df59c9e060ed1e01967fdd8e4e
5
5
  SHA512:
6
- metadata.gz: 7862e43d639dd5fefe90dd86d08849f93632fe53bb32d891b501e0b57756dc6057edec00a1985baab7a2bfa5ad0314211798e4e892bdf331f1354d9bb936a84b
7
- data.tar.gz: 45f6bbf7da450324722d0fa9d6f03ce3eaf22fc28cd56c2f82d1d181d6e6f3bf482e55df59a894fee7aff3ff903e235d5d1033881b26f0d19070fa5e7399748c
6
+ metadata.gz: abab2102477a032ee062eade9b36b4a99a2704c5e831d7e43d9500ca63e7d6bd800dd256ec6ee3525d585cde3b2da3244326a9c134e28125eb879ee65e30cd8a
7
+ data.tar.gz: 725cb8e7ac1c6899311a750a90b905451340b41f34ed5a737d420d20108791366beb7f475d384760497c2345a8a6b622b1e23c9472fbc18bc1c7b03a6b91ce96
@@ -1,3 +1,7 @@
1
+ === 1.40.0 2016-04-06
2
+
3
+ * Fix bug that omitted subresources from serialization
4
+
1
5
  === 1.39.0 2016-03-31
2
6
 
3
7
  * Update CA cert bundle for compatibility with OpenSSL versions below 1.0.1
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.39.0
1
+ 1.40.0
@@ -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
- :ssl_ca_file => @ca_bundle_path}
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
@@ -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
 
@@ -1,3 +1,3 @@
1
1
  module Stripe
2
- VERSION = '1.39.0'
2
+ VERSION = '1.40.0'
3
3
  end
@@ -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.39.0
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-03-31 00:00:00.000000000 Z
12
+ date: 2016-04-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rest-client