Skip to content

Commit

Permalink
Update generated code (#1510)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
  • Loading branch information
stripe-openapi[bot] and helenye-stripe authored Jan 27, 2025
1 parent 5304640 commit 0cb23f6
Show file tree
Hide file tree
Showing 6 changed files with 63 additions and 4 deletions.
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v1412
v1455
2 changes: 1 addition & 1 deletion lib/stripe/api_version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@

module Stripe
module ApiVersion
CURRENT = "2024-12-18.acacia"
CURRENT = "2025-01-27.acacia"
end
end
6 changes: 4 additions & 2 deletions lib/stripe/resources/issuing/authorization.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {})
Expand All @@ -40,6 +40,7 @@ def self.approve(authorization, params = {}, opts = {})
opts: opts
)
end

class << self
extend Gem::Deprecate
deprecate :approve, :none, 2024, 3
Expand All @@ -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 = {})
Expand All @@ -67,6 +68,7 @@ def self.decline(authorization, params = {}, opts = {})
opts: opts
)
end

class << self
extend Gem::Deprecate
deprecate :decline, :none, 2024, 3
Expand Down
20 changes: 20 additions & 0 deletions lib/stripe/resources/treasury/financial_account.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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/%<financial_account>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/%<financial_account>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(
Expand Down
11 changes: 11 additions & 0 deletions lib/stripe/services/treasury/financial_account_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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/%<financial_account>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(
Expand Down
26 changes: 26 additions & 0 deletions test/stripe/generated_examples_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 0cb23f6

Please sign in to comment.