Merge pull request #1313 from stripe/latest-codegen-beta

Update generated code for beta
This commit is contained in:
stripe-openapi[bot] 2024-01-25 23:15:48 +00:00 committed by GitHub
commit fe66019c7d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 47 additions and 10 deletions

View File

@ -1 +1 @@
v756
v794

View File

@ -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

View File

@ -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 =>

View File

@ -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

View File

@ -134,6 +134,20 @@ module Stripe
)
end
# At any time, you can preview the upcoming invoice for a customer. This will show you all the charges that are pending, including subscription renewal charges, invoice item charges, etc. It will also show you any discounts that are applicable to the invoice.
#
# Note that when you are viewing an upcoming invoice, you are simply viewing a preview the invoice has not yet been created. As such, the upcoming invoice will not show up in invoice listing calls, and you cannot use the API to pay or edit the invoice. If you want to change the amount that your customer will be billed, you can add, remove, or update pending invoice items, or update the customer's discount.
#
# You can preview the effects of updating a subscription, including a preview of what proration will take place. To ensure that the actual proration is calculated exactly the same as the previewed proration, you should pass a proration_date parameter when doing the actual subscription update. The value passed in should be the same as the subscription_proration_date returned on the upcoming invoice resource. The recommended way to get only the prorations being previewed is to consider only proration line items where period[start] is equal to the subscription_proration_date on the upcoming invoice resource.
def self.create_preview(params = {}, opts = {})
request_stripe_object(
method: :post,
path: "/v1/invoices/create_preview",
params: params,
opts: opts
)
end
# Stripe automatically finalizes drafts before sending and attempting payment on invoices. However, if you'd like to finalize a draft invoice manually, you can do so using this method.
def self.finalize_invoice(invoice, params = {}, opts = {})
request_stripe_object(

View File

@ -17,7 +17,7 @@ module Stripe
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 @@ module Stripe
)
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 @@ module Stripe
)
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 @@ module Stripe
)
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 = {})

View File

@ -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