From 0cb23f65408720a6e390efa79f3fbebf87bdb7c8 Mon Sep 17 00:00:00 2001 From: "stripe-openapi[bot]" <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Mon, 27 Jan 2025 19:41:17 +0000 Subject: [PATCH] Update generated code (#1510) * Update generated code for v1421 * Update generated code for v1441 * Update generated code for v1455 --------- Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Co-authored-by: helenye-stripe <111009531+helenye-stripe@users.noreply.github.com> --- OPENAPI_VERSION | 2 +- lib/stripe/api_version.rb | 2 +- lib/stripe/resources/issuing/authorization.rb | 6 +++-- .../resources/treasury/financial_account.rb | 20 ++++++++++++++ .../treasury/financial_account_service.rb | 11 ++++++++ test/stripe/generated_examples_test.rb | 26 +++++++++++++++++++ 6 files changed, 63 insertions(+), 4 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index bf0daa66a..217ac84ad 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v1412 \ No newline at end of file +v1455 \ No newline at end of file diff --git a/lib/stripe/api_version.rb b/lib/stripe/api_version.rb index 9fc77642b..464a06ef3 100644 --- a/lib/stripe/api_version.rb +++ b/lib/stripe/api_version.rb @@ -3,6 +3,6 @@ module Stripe module ApiVersion - CURRENT = "2024-12-18.acacia" + CURRENT = "2025-01-27.acacia" end end diff --git a/lib/stripe/resources/issuing/authorization.rb b/lib/stripe/resources/issuing/authorization.rb index 898c8a342..4ad2ab45f 100644 --- a/lib/stripe/resources/issuing/authorization.rb +++ b/lib/stripe/resources/issuing/authorization.rb @@ -28,8 +28,8 @@ def approve(params = {}, opts = {}) opts: opts ) end - deprecate :approve, :none, 2024, 3 + deprecate :approve, :none, 2024, 3 # [Deprecated] Approves a pending Issuing Authorization object. This request should be made within the timeout window of the [real-time authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations) flow. # This method is deprecated. Instead, [respond directly to the webhook request to approve an authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations#authorization-handling). def self.approve(authorization, params = {}, opts = {}) @@ -40,6 +40,7 @@ def self.approve(authorization, params = {}, opts = {}) opts: opts ) end + class << self extend Gem::Deprecate deprecate :approve, :none, 2024, 3 @@ -55,8 +56,8 @@ def decline(params = {}, opts = {}) opts: opts ) end - deprecate :decline, :none, 2024, 3 + deprecate :decline, :none, 2024, 3 # [Deprecated] Declines a pending Issuing Authorization object. This request should be made within the timeout window of the [real time authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations) flow. # This method is deprecated. Instead, [respond directly to the webhook request to decline an authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations#authorization-handling). def self.decline(authorization, params = {}, opts = {}) @@ -67,6 +68,7 @@ def self.decline(authorization, params = {}, opts = {}) opts: opts ) end + class << self extend Gem::Deprecate deprecate :decline, :none, 2024, 3 diff --git a/lib/stripe/resources/treasury/financial_account.rb b/lib/stripe/resources/treasury/financial_account.rb index 3aeae6cc1..ecb39e784 100644 --- a/lib/stripe/resources/treasury/financial_account.rb +++ b/lib/stripe/resources/treasury/financial_account.rb @@ -15,6 +15,26 @@ def self.object_name "treasury.financial_account" end + # Closes a FinancialAccount. A FinancialAccount can only be closed if it has a zero balance, has no pending InboundTransfers, and has canceled all attached Issuing cards. + def close(params = {}, opts = {}) + request_stripe_object( + method: :post, + path: format("/v1/treasury/financial_accounts/%s/close", { financial_account: CGI.escape(self["id"]) }), + params: params, + opts: opts + ) + end + + # Closes a FinancialAccount. A FinancialAccount can only be closed if it has a zero balance, has no pending InboundTransfers, and has canceled all attached Issuing cards. + def self.close(financial_account, params = {}, opts = {}) + request_stripe_object( + method: :post, + path: format("/v1/treasury/financial_accounts/%s/close", { financial_account: CGI.escape(financial_account) }), + params: params, + opts: opts + ) + end + # Creates a new FinancialAccount. For now, each connected account can only have one FinancialAccount. def self.create(params = {}, opts = {}) request_stripe_object( diff --git a/lib/stripe/services/treasury/financial_account_service.rb b/lib/stripe/services/treasury/financial_account_service.rb index d38719ab1..6e845d24d 100644 --- a/lib/stripe/services/treasury/financial_account_service.rb +++ b/lib/stripe/services/treasury/financial_account_service.rb @@ -11,6 +11,17 @@ def initialize(requestor) @features = Stripe::Treasury::FinancialAccountFeaturesService.new(@requestor) end + # Closes a FinancialAccount. A FinancialAccount can only be closed if it has a zero balance, has no pending InboundTransfers, and has canceled all attached Issuing cards. + def close(financial_account, params = {}, opts = {}) + request( + method: :post, + path: format("/v1/treasury/financial_accounts/%s/close", { financial_account: CGI.escape(financial_account) }), + params: params, + opts: opts, + base_address: :api + ) + end + # Creates a new FinancialAccount. For now, each connected account can only have one FinancialAccount. def create(params = {}, opts = {}) request( diff --git a/test/stripe/generated_examples_test.rb b/test/stripe/generated_examples_test.rb index 8fb6fb697..e0ef2c584 100644 --- a/test/stripe/generated_examples_test.rb +++ b/test/stripe/generated_examples_test.rb @@ -5429,6 +5429,32 @@ class CodegennedExampleTest < Test::Unit::TestCase ) assert_requested :post, "#{Stripe::DEFAULT_API_BASE}/v1/terminal/readers/tmr_xxxxxxxxxxxxx/process_payment_intent" end + should "Test terminal readers process setup intent post" do + Stripe::Terminal::Reader.process_setup_intent( + "tmr_xxxxxxxxxxxxx", + { + setup_intent: "seti_xxxxxxxxxxxxx", + allow_redisplay: "always", + } + ) + assert_requested :post, "#{Stripe.api_base}/v1/terminal/readers/tmr_xxxxxxxxxxxxx/process_setup_intent" + end + should "Test terminal readers process setup intent post (service)" do + stub_request( + :post, + "#{Stripe::DEFAULT_API_BASE}/v1/terminal/readers/tmr_xxxxxxxxxxxxx/process_setup_intent" + ).to_return(body: "{}") + client = StripeClient.new("sk_test_123") + + client.v1.terminal.readers.process_setup_intent( + "tmr_xxxxxxxxxxxxx", + { + setup_intent: "seti_xxxxxxxxxxxxx", + allow_redisplay: "always", + } + ) + assert_requested :post, "#{Stripe::DEFAULT_API_BASE}/v1/terminal/readers/tmr_xxxxxxxxxxxxx/process_setup_intent" + end should "Test test helpers customers fund cash balance post" do Stripe::Customer::TestHelpers.fund_cash_balance( "cus_123",