v13 regression: stripe_version
no longer supported as option in ApiResource.retrieve
.
#1482
Labels
stripe_version
no longer supported as option in ApiResource.retrieve
.
#1482
Describe the bug
Before v13, we were able to pass
stripe_version
as option when calling something likeStripe::PaymentMethod.retrieve(id, stripe_version: '2022-11-15')
. This is being ignored as of v13.I'm pretty confident that this was introduced by changing how opts are handled between v12 and v13.
In v12, the gem would call
RequestOptions.extract_opts_from_hash(opts)
on whatever was passed in as options in the call to.retrieve
.stripe-ruby/lib/stripe/api_operations/request.rb
Line 43 in 91c68e4
This would allow any of these keys to be passed into the method call
stripe-ruby/lib/stripe/request_options.rb
Lines 13 to 19 in 91c68e4
In v13 however, a different method is used:
RequestOptions.combine_opts(object.instance_variable_get(:@opts), opts)
stripe-ruby/lib/stripe/api_requestor.rb
Line 222 in e4233f0
In this case the opts passed to retrieve only make their way to
ApiRequestor
as instance variables. And incombine_opts
we only allow the keyapi_version
to be used from the object opts.stripe-ruby/lib/stripe/request_options.rb
Line 66 in e4233f0
To Reproduce
Stripe. api_version
Expected behavior
I would expect the API version to work the same way as before v13 since this was not mentioned as a breaking change.
Code snippets
No response
OS
macOS
Language version
Ruby 3.4
Library version
stripe-ruby v.13.1.0
API version
Any
Additional context
No response
The text was updated successfully, but these errors were encountered: