mirror of
https://github.com/stripe/stripe-ruby.git
synced 2025-07-30 00:01:17 -04:00
Compare commits
7 Commits
86ac5fd329
...
499d0605d0
Author | SHA1 | Date | |
---|---|---|---|
|
499d0605d0 | ||
|
1705995709 | ||
|
37293f6aba | ||
|
08b00636a5 | ||
|
37fa3c1228 | ||
|
faa9d58a66 | ||
|
2ac9890545 |
@ -1 +1 @@
|
||||
v769
|
||||
v771
|
@ -1,8 +1,9 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
# TODO: (major) Deprecated, Remove along with extends
|
||||
module Stripe
|
||||
module APIOperations
|
||||
# The _search method via API Operations is deprecated.
|
||||
# Please use the search method from within the resource instead.
|
||||
module Search
|
||||
def _search(search_url, filters = {}, opts = {})
|
||||
request_stripe_object(
|
||||
@ -12,6 +13,9 @@ module Stripe
|
||||
opts: opts
|
||||
)
|
||||
end
|
||||
|
||||
extend Gem::Deprecate
|
||||
deprecate :_search, "request_stripe_object", 2024, 1
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -12,6 +12,7 @@ module Stripe
|
||||
SearchResultObject::OBJECT_NAME => SearchResultObject,
|
||||
|
||||
# business objects
|
||||
File::OBJECT_NAME_ALT => File,
|
||||
Account::OBJECT_NAME => Account,
|
||||
AccountLink::OBJECT_NAME => AccountLink,
|
||||
AccountNotice::OBJECT_NAME => AccountNotice,
|
||||
@ -51,7 +52,6 @@ module Stripe
|
||||
Event::OBJECT_NAME => Event,
|
||||
ExchangeRate::OBJECT_NAME => ExchangeRate,
|
||||
File::OBJECT_NAME => File,
|
||||
File::OBJECT_NAME_ALT => File,
|
||||
FileLink::OBJECT_NAME => FileLink,
|
||||
FinancialConnections::Account::OBJECT_NAME => FinancialConnections::Account,
|
||||
FinancialConnections::AccountInferredBalance::OBJECT_NAME =>
|
||||
|
@ -39,6 +39,26 @@ module Stripe
|
||||
end
|
||||
end
|
||||
|
||||
context ".search" do
|
||||
should "warn that ._search is deprecated" do
|
||||
old_stderr = $stderr
|
||||
$stderr = StringIO.new
|
||||
begin
|
||||
stub_request(:post, "#{Stripe.api_base}/v1/customers/search?query=foo:bar")
|
||||
.to_return(body: JSON.generate(object: "customer"))
|
||||
|
||||
client = StripeClient.new
|
||||
client.request { Customer._search("/v1/customers/search", query: "foo:bar") }
|
||||
|
||||
message = "NOTE: Stripe::Customer._search is deprecated; use request_stripe_object " \
|
||||
"instead. It will be removed on or after 2024-01."
|
||||
assert_match Regexp.new(message), $stderr.string
|
||||
ensure
|
||||
$stderr = old_stderr
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
context ".nested_resource_class_methods" do
|
||||
class MainResource < APIResource # rubocop:todo Lint/ConstantDefinitionInBlock
|
||||
extend Stripe::APIOperations::NestedResource
|
||||
|
Loading…
x
Reference in New Issue
Block a user