From 2ac989054549965309358d9b2f88aec7cf0da5e0 Mon Sep 17 00:00:00 2001 From: Helen Ye Date: Thu, 11 Jan 2024 12:54:26 -0500 Subject: [PATCH 1/8] wip --- lib/stripe/api_operations/search.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/stripe/api_operations/search.rb b/lib/stripe/api_operations/search.rb index 655ad74ee..be719ca38 100644 --- a/lib/stripe/api_operations/search.rb +++ b/lib/stripe/api_operations/search.rb @@ -1,8 +1,9 @@ # frozen_string_literal: true -# TODO: (major) Deprecated, Remove along with extends module Stripe module APIOperations + # TODO: (major) Deprecated, remove along with extends. + # Please use the search method fromw within the resource instead. module Search def _search(search_url, filters = {}, opts = {}) request_stripe_object( @@ -12,6 +13,9 @@ def _search(search_url, filters = {}, opts = {}) opts: opts ) end + + extend Gem::Deprecate + deprecate :_search, "request_stripe_object", 2024, 1 end end end From faa9d58a663739da3096cf367e5ab83801ab54ed Mon Sep 17 00:00:00 2001 From: Helen Ye Date: Thu, 18 Jan 2024 09:39:17 -0800 Subject: [PATCH 2/8] Update search to use the deprecate gem --- lib/stripe/api_operations/search.rb | 4 ++-- lib/stripe/resources/account.rb | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/stripe/api_operations/search.rb b/lib/stripe/api_operations/search.rb index be719ca38..7af48b423 100644 --- a/lib/stripe/api_operations/search.rb +++ b/lib/stripe/api_operations/search.rb @@ -2,8 +2,8 @@ module Stripe module APIOperations - # TODO: (major) Deprecated, remove along with extends. - # Please use the search method fromw within the resource instead. + # 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( diff --git a/lib/stripe/resources/account.rb b/lib/stripe/resources/account.rb index e094df33f..e41b3b191 100644 --- a/lib/stripe/resources/account.rb +++ b/lib/stripe/resources/account.rb @@ -11,7 +11,6 @@ module Stripe # for a Standard or Express account, some parameters are no longer returned. These are marked as **Custom Only** or **Custom and Express** # below. Learn about the differences [between accounts](https://stripe.com/docs/connect/accounts). class Account < APIResource - extend Gem::Deprecate extend Stripe::APIOperations::Create include Stripe::APIOperations::Delete extend Stripe::APIOperations::List From 08b00636a50f6e19214e32a045f25de532056e2c Mon Sep 17 00:00:00 2001 From: Helen Ye Date: Thu, 18 Jan 2024 16:46:51 -0800 Subject: [PATCH 3/8] Add test to warn about search being deprecated --- test/stripe/api_operations_test.rb | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/test/stripe/api_operations_test.rb b/test/stripe/api_operations_test.rb index e171ee92e..515290197 100644 --- a/test/stripe/api_operations_test.rb +++ b/test/stripe/api_operations_test.rb @@ -39,6 +39,26 @@ def self.protected_fields 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 From 86ac5fd3293097d7264529c4e48f74aefe8eb73c Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Fri, 19 Jan 2024 01:18:58 +0000 Subject: [PATCH 4/8] Update generated code for v769 --- OPENAPI_VERSION | 2 +- lib/stripe/resources/account.rb | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 560468415..4cf613156 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v756 \ No newline at end of file +v769 \ No newline at end of file diff --git a/lib/stripe/resources/account.rb b/lib/stripe/resources/account.rb index e094df33f..f5247ff6f 100644 --- a/lib/stripe/resources/account.rb +++ b/lib/stripe/resources/account.rb @@ -7,9 +7,8 @@ module Stripe # enabled to make live charges or receive payouts. # # For Custom accounts, the properties below are always returned. For other accounts, some properties are returned until that - # account has started to go through Connect Onboarding. Once you create an [Account Link](https://stripe.com/docs/api/account_links) - # for a Standard or Express account, some parameters are no longer returned. These are marked as **Custom Only** or **Custom and Express** - # below. Learn about the differences [between accounts](https://stripe.com/docs/connect/accounts). + # account has started to go through Connect Onboarding. Once you create an [Account Link](https://stripe.com/docs/api/account_links) or [Account Session](https://stripe.com/docs/api/account_sessions), + # some properties are only returned for Custom accounts. Learn about the differences [between accounts](https://stripe.com/docs/connect/accounts). class Account < APIResource extend Gem::Deprecate extend Stripe::APIOperations::Create From 499d0605d09fba1e831f90a109d9ff1b70223cd1 Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Fri, 19 Jan 2024 23:33:30 +0000 Subject: [PATCH 5/8] Update generated code for v771 --- OPENAPI_VERSION | 2 +- lib/stripe/object_types.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 4cf613156..acb2ee1ee 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v769 \ No newline at end of file +v771 \ No newline at end of file diff --git a/lib/stripe/object_types.rb b/lib/stripe/object_types.rb index 292a274bb..b0f308b49 100644 --- a/lib/stripe/object_types.rb +++ b/lib/stripe/object_types.rb @@ -12,6 +12,7 @@ def self.object_names_to_classes 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 @@ def self.object_names_to_classes 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 => From a1deb162d02bb941207c6e8a4bc5b0a586269b8d Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Mon, 22 Jan 2024 09:30:48 +0000 Subject: [PATCH 6/8] Update generated code for v773 --- OPENAPI_VERSION | 2 +- lib/stripe/resources/payout.rb | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index acb2ee1ee..9fd9fd9d0 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v771 \ No newline at end of file +v773 \ No newline at end of file diff --git a/lib/stripe/resources/payout.rb b/lib/stripe/resources/payout.rb index e50de02e4..0f4995ae2 100644 --- a/lib/stripe/resources/payout.rb +++ b/lib/stripe/resources/payout.rb @@ -17,7 +17,7 @@ class Payout < APIResource OBJECT_NAME = "payout" - # You can cancel a previously created payout if it hasn't been paid out yet. Stripe refunds the funds to your available balance. You can't cancel automatic Stripe payouts. + # You can cancel a previously created payout if its status is pending. Stripe refunds the funds to your available balance. You can't cancel automatic Stripe payouts. def cancel(params = {}, opts = {}) request_stripe_object( method: :post, @@ -27,7 +27,7 @@ def cancel(params = {}, opts = {}) ) end - # Reverses a payout by debiting the destination bank account. At this time, you can only reverse payouts for connected accounts to US bank accounts. If the payout is in the pending status, use /v1/payouts/:id/cancel instead. + # Reverses a payout by debiting the destination bank account. At this time, you can only reverse payouts for connected accounts to US bank accounts. If the payout is manual and in the pending status, use /v1/payouts/:id/cancel instead. # # By requesting a reversal through /v1/payouts/:id/reverse, you confirm that the authorized signatory of the selected bank account authorizes the debit on the bank account and that no other authorization is required. def reverse(params = {}, opts = {}) @@ -39,7 +39,7 @@ def reverse(params = {}, opts = {}) ) end - # You can cancel a previously created payout if it hasn't been paid out yet. Stripe refunds the funds to your available balance. You can't cancel automatic Stripe payouts. + # You can cancel a previously created payout if its status is pending. Stripe refunds the funds to your available balance. You can't cancel automatic Stripe payouts. def self.cancel(payout, params = {}, opts = {}) request_stripe_object( method: :post, @@ -49,7 +49,7 @@ def self.cancel(payout, params = {}, opts = {}) ) end - # Reverses a payout by debiting the destination bank account. At this time, you can only reverse payouts for connected accounts to US bank accounts. If the payout is in the pending status, use /v1/payouts/:id/cancel instead. + # Reverses a payout by debiting the destination bank account. At this time, you can only reverse payouts for connected accounts to US bank accounts. If the payout is manual and in the pending status, use /v1/payouts/:id/cancel instead. # # By requesting a reversal through /v1/payouts/:id/reverse, you confirm that the authorized signatory of the selected bank account authorizes the debit on the bank account and that no other authorization is required. def self.reverse(payout, params = {}, opts = {}) From c7d68d520074648510384160f5ead8835a640c77 Mon Sep 17 00:00:00 2001 From: "stripe-openapi[bot]" <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Thu, 25 Jan 2024 17:01:12 +0000 Subject: [PATCH 7/8] Update generated code (#1312) * Update generated code for v769 * Update generated code for v771 * Update generated code for v773 --------- Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Co-authored-by: pakrym-stripe <99349468+pakrym-stripe@users.noreply.github.com> --- OPENAPI_VERSION | 2 +- lib/stripe/object_types.rb | 2 +- lib/stripe/resources/account.rb | 5 ++--- lib/stripe/resources/payout.rb | 8 ++++---- 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 749c898fd..9fd9fd9d0 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v755 \ No newline at end of file +v773 \ No newline at end of file diff --git a/lib/stripe/object_types.rb b/lib/stripe/object_types.rb index 3879e9d35..ad8b5cc25 100644 --- a/lib/stripe/object_types.rb +++ b/lib/stripe/object_types.rb @@ -12,6 +12,7 @@ def self.object_names_to_classes SearchResultObject::OBJECT_NAME => SearchResultObject, # business objects + File::OBJECT_NAME_ALT => File, Account::OBJECT_NAME => Account, AccountLink::OBJECT_NAME => AccountLink, AccountSession::OBJECT_NAME => AccountSession, @@ -46,7 +47,6 @@ def self.object_names_to_classes 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::AccountOwner::OBJECT_NAME => FinancialConnections::AccountOwner, diff --git a/lib/stripe/resources/account.rb b/lib/stripe/resources/account.rb index e41b3b191..2924be373 100644 --- a/lib/stripe/resources/account.rb +++ b/lib/stripe/resources/account.rb @@ -7,9 +7,8 @@ module Stripe # enabled to make live charges or receive payouts. # # For Custom accounts, the properties below are always returned. For other accounts, some properties are returned until that - # account has started to go through Connect Onboarding. Once you create an [Account Link](https://stripe.com/docs/api/account_links) - # for a Standard or Express account, some parameters are no longer returned. These are marked as **Custom Only** or **Custom and Express** - # below. Learn about the differences [between accounts](https://stripe.com/docs/connect/accounts). + # account has started to go through Connect Onboarding. Once you create an [Account Link](https://stripe.com/docs/api/account_links) or [Account Session](https://stripe.com/docs/api/account_sessions), + # some properties are only returned for Custom accounts. Learn about the differences [between accounts](https://stripe.com/docs/connect/accounts). class Account < APIResource extend Stripe::APIOperations::Create include Stripe::APIOperations::Delete diff --git a/lib/stripe/resources/payout.rb b/lib/stripe/resources/payout.rb index e50de02e4..0f4995ae2 100644 --- a/lib/stripe/resources/payout.rb +++ b/lib/stripe/resources/payout.rb @@ -17,7 +17,7 @@ class Payout < APIResource OBJECT_NAME = "payout" - # You can cancel a previously created payout if it hasn't been paid out yet. Stripe refunds the funds to your available balance. You can't cancel automatic Stripe payouts. + # You can cancel a previously created payout if its status is pending. Stripe refunds the funds to your available balance. You can't cancel automatic Stripe payouts. def cancel(params = {}, opts = {}) request_stripe_object( method: :post, @@ -27,7 +27,7 @@ def cancel(params = {}, opts = {}) ) end - # Reverses a payout by debiting the destination bank account. At this time, you can only reverse payouts for connected accounts to US bank accounts. If the payout is in the pending status, use /v1/payouts/:id/cancel instead. + # Reverses a payout by debiting the destination bank account. At this time, you can only reverse payouts for connected accounts to US bank accounts. If the payout is manual and in the pending status, use /v1/payouts/:id/cancel instead. # # By requesting a reversal through /v1/payouts/:id/reverse, you confirm that the authorized signatory of the selected bank account authorizes the debit on the bank account and that no other authorization is required. def reverse(params = {}, opts = {}) @@ -39,7 +39,7 @@ def reverse(params = {}, opts = {}) ) end - # You can cancel a previously created payout if it hasn't been paid out yet. Stripe refunds the funds to your available balance. You can't cancel automatic Stripe payouts. + # You can cancel a previously created payout if its status is pending. Stripe refunds the funds to your available balance. You can't cancel automatic Stripe payouts. def self.cancel(payout, params = {}, opts = {}) request_stripe_object( method: :post, @@ -49,7 +49,7 @@ def self.cancel(payout, params = {}, opts = {}) ) end - # Reverses a payout by debiting the destination bank account. At this time, you can only reverse payouts for connected accounts to US bank accounts. If the payout is in the pending status, use /v1/payouts/:id/cancel instead. + # Reverses a payout by debiting the destination bank account. At this time, you can only reverse payouts for connected accounts to US bank accounts. If the payout is manual and in the pending status, use /v1/payouts/:id/cancel instead. # # By requesting a reversal through /v1/payouts/:id/reverse, you confirm that the authorized signatory of the selected bank account authorizes the debit on the bank account and that no other authorization is required. def self.reverse(payout, params = {}, opts = {}) From 7055e504b1676a61c778ceb2f285851dbcf6bfb2 Mon Sep 17 00:00:00 2001 From: "stripe-openapi[bot]" <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Thu, 25 Jan 2024 09:13:22 -0800 Subject: [PATCH 8/8] Update generated code for v793 (#1315) Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> --- OPENAPI_VERSION | 2 +- lib/stripe/resources/account.rb | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 9fd9fd9d0..55b7a77b1 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v773 \ No newline at end of file +v793 \ No newline at end of file diff --git a/lib/stripe/resources/account.rb b/lib/stripe/resources/account.rb index 2924be373..f5247ff6f 100644 --- a/lib/stripe/resources/account.rb +++ b/lib/stripe/resources/account.rb @@ -10,6 +10,7 @@ module Stripe # account has started to go through Connect Onboarding. Once you create an [Account Link](https://stripe.com/docs/api/account_links) or [Account Session](https://stripe.com/docs/api/account_sessions), # some properties are only returned for Custom accounts. Learn about the differences [between accounts](https://stripe.com/docs/connect/accounts). class Account < APIResource + extend Gem::Deprecate extend Stripe::APIOperations::Create include Stripe::APIOperations::Delete extend Stripe::APIOperations::List