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 +4 -4
- data/CHANGELOG.md +3 -0
- data/Gemfile +4 -0
- data/VERSION +1 -1
- data/lib/stripe/api_operations/save.rb +2 -1
- data/lib/stripe/api_operations/singleton_save.rb +2 -1
- data/lib/stripe/api_requestor.rb +1 -1
- data/lib/stripe/api_resource.rb +10 -3
- data/lib/stripe/request_options.rb +2 -1
- data/lib/stripe/resources/source.rb +1 -1
- data/lib/stripe/stripe_object.rb +3 -2
- data/lib/stripe/version.rb +1 -1
- 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: 045b4054e63e2191cdfbbc900a11dabf0cc57556a19fd107caead18f149c1de5
|
4
|
+
data.tar.gz: e82241197dee628472cbeb5843286ff02678f57709f70d63004248f586e09240
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
13.5.
|
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,
|
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,
|
67
|
+
params: values,
|
68
|
+
opts: RequestOptions.extract_opts_from_hash(opts),
|
68
69
|
usage: ["save"])
|
69
70
|
end
|
70
71
|
extend Gem::Deprecate
|
data/lib/stripe/api_requestor.rb
CHANGED
@@ -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
|
data/lib/stripe/api_resource.rb
CHANGED
@@ -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
|
-
|
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
|
-
|
118
|
-
|
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 = {})
|
data/lib/stripe/stripe_object.rb
CHANGED
@@ -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.
|
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:
|
478
|
+
opts: req_opts
|
478
479
|
)
|
479
480
|
end
|
480
481
|
|
data/lib/stripe/version.rb
CHANGED
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.
|
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-
|
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.
|