stripe 13.5.0 → 13.5.1

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: 928062945af6605fafe312cf05d06a64fe7fb636f41f02ff6f816af0449dbe1a
4
- data.tar.gz: 7fccabdb8857bbdb1728f594c277fc4afdc5be8d44edc5eeac944ccac4cb53d3
3
+ metadata.gz: 045b4054e63e2191cdfbbc900a11dabf0cc57556a19fd107caead18f149c1de5
4
+ data.tar.gz: e82241197dee628472cbeb5843286ff02678f57709f70d63004248f586e09240
5
5
  SHA512:
6
- metadata.gz: 80c16055d8f85a1ffe0ed6f41e6082205d672886aa23b7a9f184ca9609ea4cd09855528bcc4341ad7360306bc82c18d2d364e91e7e4081d4cf848b553a0aed07
7
- data.tar.gz: abb2d60a2c14b95b1815dfd986310f7d75d663c9c339ad32a9b30e5273cba832a364911b2b248f82f9a851a01cef2622ddaea658926ddf3f1241d93d2dc68b1c
6
+ metadata.gz: 8dd1ce1578a5ac0b57ab297a3d64ae29ada8973dabf44e861e230ae2675f79a469ab50afda252f31840aa6392cddbaeaaf55893ea9d2b5cb442c24be351c4444
7
+ data.tar.gz: 6bcf1bc443a61abc5e4a9ca7515f1fd02587550b6728b5d8f4d6c78abaa6d0f83961b0c2d073d3e9f181bed9e27bbd2079b5c8d5d35665839db36a123fab7028
data/CHANGELOG.md CHANGED
@@ -1,4 +1,7 @@
1
1
  # Changelog
2
+ ## 13.5.1 - 2025-04-21
3
+ * [#1576](https://github.com/stripe/stripe-ruby/pull/1576) Explicitly pass through custom headers in retrieve
4
+
2
5
  ## 13.5.0 - 2025-02-24
3
6
  * [#1534](https://github.com/stripe/stripe-ruby/pull/1534) Update generated code
4
7
  * Fixed `Stripe::InvoiceLineItem.update` method.
data/Gemfile CHANGED
@@ -34,4 +34,8 @@ group :development do
34
34
  gem "pry"
35
35
  gem "pry-byebug"
36
36
  end
37
+
38
+ platforms :jruby do
39
+ gem "rbi", "0.2.4" # jruby does not support rbs, a new dependency in 0.3.0
40
+ end
37
41
  end
data/VERSION CHANGED
@@ -1 +1 @@
1
- 13.5.0
1
+ 13.5.1
@@ -67,7 +67,8 @@ module Stripe
67
67
  values.delete(:id)
68
68
  opts = Util.normalize_opts(opts)
69
69
  APIRequestor.active_requestor.execute_request_initialize_from(:post, save_url, :api, self,
70
- params: values, opts: opts,
70
+ params: values,
71
+ opts: RequestOptions.extract_opts_from_hash(opts),
71
72
  usage: ["save"])
72
73
  end
73
74
  extend Gem::Deprecate
@@ -64,7 +64,8 @@ module Stripe
64
64
  opts = Util.normalize_opts(opts)
65
65
 
66
66
  APIRequestor.active_requestor.execute_request_initialize_from(:post, resource_url, :api, self,
67
- params: values, opts: opts,
67
+ params: values,
68
+ opts: RequestOptions.extract_opts_from_hash(opts),
68
69
  usage: ["save"])
69
70
  end
70
71
  extend Gem::Deprecate
@@ -219,7 +219,7 @@ module Stripe
219
219
  # with future non-major changes.
220
220
  def execute_request_initialize_from(method, path, base_address, object,
221
221
  params: {}, opts: {}, usage: [])
222
- opts = RequestOptions.combine_opts(object.instance_variable_get(:@opts), opts)
222
+ opts = RequestOptions.combine_opts(object.instance_variable_get(:@opts) || {}, opts)
223
223
  opts = Util.normalize_opts(opts)
224
224
  http_resp, req_opts = execute_request_internal(
225
225
  method, path, base_address, params, opts, usage
@@ -98,7 +98,10 @@ module Stripe
98
98
  "It is not possible to refresh v2 objects. Please retrieve the object using the StripeClient instead."
99
99
  end
100
100
 
101
- @obj = @requestor.execute_request_initialize_from(:get, resource_url, :api, self, params: @retrieve_params)
101
+ opts = RequestOptions.extract_opts_from_hash(@retrieve_opts || {})
102
+ @retrieve_opts = {} # Make sure to clear the retrieve options
103
+ @obj = @requestor.execute_request_initialize_from(:get, resource_url, :api, self, params: @retrieve_params,
104
+ opts: opts)
102
105
  initialize_from(
103
106
  @obj.last_response.data,
104
107
  @obj.instance_variable_get(:@opts),
@@ -114,8 +117,12 @@ module Stripe
114
117
  "It is not possible to retrieve v2 objects on the resource. Please use the StripeClient instead."
115
118
  end
116
119
 
117
- opts = Util.normalize_opts(opts)
118
- instance = new(id, opts)
120
+ instance = new(id)
121
+ # Explicitly send options for the retrieve call, to preserve custom headers
122
+ # This is so we can pass custom headers from this static function
123
+ # to the instance variable method call
124
+ # The custom headers will be cleaned up with the rest of the RequestOptions
125
+ instance.instance_variable_set(:@retrieve_opts, Util.normalize_opts(opts))
119
126
  instance.refresh
120
127
  end
121
128
 
@@ -56,7 +56,7 @@ module Stripe
56
56
  # Merges requestor options hash on a StripeObject
57
57
  # with a per-request options hash, giving precedence
58
58
  # to the per-request options. Returns the merged request options.
59
- # Expects two hashes.
59
+ # Expects two hashes, expects extract_opts_from_hash to be called first!!!
60
60
  def self.combine_opts(object_opts, req_opts)
61
61
  merged_opts = {
62
62
  api_key: req_opts[:api_key] || object_opts[:api_key],
@@ -64,6 +64,7 @@ module Stripe
64
64
  stripe_account: req_opts[:stripe_account] || object_opts[:stripe_account],
65
65
  stripe_context: req_opts[:stripe_context] || object_opts[:stripe_context],
66
66
  stripe_version: req_opts[:stripe_version] || object_opts[:stripe_version],
67
+ headers: req_opts[:headers] || {},
67
68
  }
68
69
 
69
70
  # Remove nil values from headers
@@ -72,7 +72,7 @@ module Stripe
72
72
  "/#{CGI.escape(id)}"
73
73
  opts = Util.normalize_opts(opts)
74
74
  APIRequestor.active_requestor.execute_request_initialize_from(:delete, url, :api, self,
75
- params: params, opts: opts)
75
+ params: params, opts: RequestOptions.extract_opts_from_hash(opts))
76
76
  end
77
77
 
78
78
  def source_transactions(params = {}, opts = {})
@@ -468,13 +468,14 @@ module Stripe
468
468
 
469
469
  # Should only be for v2 events and lists, for now.
470
470
  protected def _request(method:, path:, base_address:, params: {}, opts: {})
471
- req_opts = RequestOptions.combine_opts(@opts, opts)
471
+ req_opts = RequestOptions.extract_opts_from_hash(opts)
472
+ req_opts = RequestOptions.combine_opts(@opts, req_opts)
472
473
  @requestor.execute_request(
473
474
  method,
474
475
  path,
475
476
  base_address,
476
477
  params: params,
477
- opts: RequestOptions.extract_opts_from_hash(req_opts)
478
+ opts: req_opts
478
479
  )
479
480
  end
480
481
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Stripe
4
- VERSION = "13.5.0"
4
+ VERSION = "13.5.1"
5
5
  end
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: 13.5.0
4
+ version: 13.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stripe
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2025-02-24 00:00:00.000000000 Z
11
+ date: 2025-04-21 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Stripe is the easiest way to accept payments online. See https://stripe.com
14
14
  for details.