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

Update generated code for beta
This commit is contained in:
stripe-openapi[bot] 2024-07-25 14:29:09 -07:00 committed by GitHub
commit 6e65602f6e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
15 changed files with 157 additions and 25 deletions

View File

@ -1,5 +1,21 @@
# Changelog
## 12.4.0 - 2024-07-25
* [#1437](https://github.com/stripe/stripe-ruby/pull/1437) Update generated code
* Add support for `update` method on resource `Checkout.Session`
## 12.3.0 - 2024-07-18
* [#1436](https://github.com/stripe/stripe-ruby/pull/1436) Fixed changelog for major release 12.0.0
* [#1435](https://github.com/stripe/stripe-ruby/pull/1435) Add deprecation warning for `APIResource.request`
## 12.2.0 - 2024-07-12
* [#1430](https://github.com/stripe/stripe-ruby/pull/1430) Update generated code
* [#1433](https://github.com/stripe/stripe-ruby/pull/1433) Add usage to raw_request call
* [#1431](https://github.com/stripe/stripe-ruby/pull/1431) Add `raw_request`
- Adds the ability to make raw requests to the Stripe API, by providing an HTTP method and url. This is an alternative to using `Stripe::APIResource.request(...)` to make custom requests, which is discouraged and will be broken in a future major version.
## 12.2.0-beta.1 - 2024-07-05
* [#1428](https://github.com/stripe/stripe-ruby/pull/1428) Update generated code for beta
* Add support for new resource `FinancialConnections.Institution`
@ -26,21 +42,7 @@
* [#1419](https://github.com/stripe/stripe-ruby/pull/1419)
This release changes the pinned API version to 2024-06-20. Please read the [API Upgrade Guide](https://stripe.com/docs/upgrades#2024-06-20) and carefully review the API changes before upgrading.
### ⚠️ Breaking changes
* Singleton `retrieve` method now requires `params` to be passed as the first argument. Existing calls to singleton `retrieve` method with only `opts` argument will have to be updated to account for the addition of `params` argument.
```ruby
params = { expand: ["available"] }
opts = { stripe_account: "acct_123" }
# ❌ No longer works
Stripe::Balance.retrieve(opts)
# ✅ Correct way to call retrieve method
Stripe::Balance.retrieve(params, opts)
```
### Additions
* Add support for `finalize_amount` test helper method on resource `Issuing.Authorization`

View File

@ -1 +1 @@
v1108
v1156

View File

@ -79,6 +79,8 @@ module Stripe
# place for backwards compatibility. Consider removing it on the next
# major.
alias request execute_resource_request
extend Gem::Deprecate
deprecate :request, "Stripe.raw_request", 2024, 7
private def error_on_non_string_user_opts(opts)
Util::OPTS_USER_SPECIFIED.each do |opt|
@ -135,6 +137,8 @@ module Stripe
# See notes on `alias` above.
alias request execute_resource_request
extend Gem::Deprecate
deprecate :request, "Stripe.raw_request", 2024, 7
end
end
end

View File

@ -4,6 +4,6 @@
module Stripe
module ApiVersion
CURRENT = "2024-06-20"
PREVIEW = "2024-05-23.preview-v2"
PREVIEW = "2024-07-16.preview-v2"
end
end

View File

@ -24,6 +24,7 @@ module Stripe
Balance.object_name => Balance,
BalanceTransaction.object_name => BalanceTransaction,
BankAccount.object_name => BankAccount,
Billing::Alert.object_name => Billing::Alert,
Billing::Meter.object_name => Billing::Meter,
Billing::MeterEvent.object_name => Billing::MeterEvent,
Billing::MeterEventAdjustment.object_name => Billing::MeterEventAdjustment,
@ -124,6 +125,7 @@ module Stripe
Subscription.object_name => Subscription,
SubscriptionItem.object_name => SubscriptionItem,
SubscriptionSchedule.object_name => SubscriptionSchedule,
Tax::Association.object_name => Tax::Association,
Tax::Calculation.object_name => Tax::Calculation,
Tax::CalculationLineItem.object_name => Tax::CalculationLineItem,
Tax::Form.object_name => Tax::Form,

View File

@ -12,6 +12,7 @@ require "stripe/resources/apps/secret"
require "stripe/resources/balance"
require "stripe/resources/balance_transaction"
require "stripe/resources/bank_account"
require "stripe/resources/billing/alert"
require "stripe/resources/billing/meter"
require "stripe/resources/billing/meter_event"
require "stripe/resources/billing/meter_event_adjustment"
@ -111,6 +112,7 @@ require "stripe/resources/source_transaction"
require "stripe/resources/subscription"
require "stripe/resources/subscription_item"
require "stripe/resources/subscription_schedule"
require "stripe/resources/tax/association"
require "stripe/resources/tax/calculation"
require "stripe/resources/tax/calculation_line_item"
require "stripe/resources/tax/form"

View File

@ -0,0 +1,87 @@
# File generated from our OpenAPI spec
# frozen_string_literal: true
module Stripe
module Billing
# A billing alert is a resource that notifies you when a certain usage threshold on a meter is crossed. For example, you might create a billing alert to notify you when a certain user made 100 API requests.
class Alert < APIResource
extend Stripe::APIOperations::Create
extend Stripe::APIOperations::List
OBJECT_NAME = "billing.alert"
def self.object_name
"billing.alert"
end
# Reactivates this alert, allowing it to trigger again.
def activate(params = {}, opts = {})
request_stripe_object(
method: :post,
path: format("/v1/billing/alerts/%<id>s/activate", { id: CGI.escape(self["id"]) }),
params: params,
opts: opts
)
end
# Reactivates this alert, allowing it to trigger again.
def self.activate(id, params = {}, opts = {})
request_stripe_object(
method: :post,
path: format("/v1/billing/alerts/%<id>s/activate", { id: CGI.escape(id) }),
params: params,
opts: opts
)
end
# Archives this alert, removing it from the list view and APIs. This is non-reversible.
def archive(params = {}, opts = {})
request_stripe_object(
method: :post,
path: format("/v1/billing/alerts/%<id>s/archive", { id: CGI.escape(self["id"]) }),
params: params,
opts: opts
)
end
# Archives this alert, removing it from the list view and APIs. This is non-reversible.
def self.archive(id, params = {}, opts = {})
request_stripe_object(
method: :post,
path: format("/v1/billing/alerts/%<id>s/archive", { id: CGI.escape(id) }),
params: params,
opts: opts
)
end
# Creates a billing alert
def self.create(params = {}, opts = {})
request_stripe_object(method: :post, path: "/v1/billing/alerts", params: params, opts: opts)
end
# Deactivates this alert, preventing it from triggering.
def deactivate(params = {}, opts = {})
request_stripe_object(
method: :post,
path: format("/v1/billing/alerts/%<id>s/deactivate", { id: CGI.escape(self["id"]) }),
params: params,
opts: opts
)
end
# Deactivates this alert, preventing it from triggering.
def self.deactivate(id, params = {}, opts = {})
request_stripe_object(
method: :post,
path: format("/v1/billing/alerts/%<id>s/deactivate", { id: CGI.escape(id) }),
params: params,
opts: opts
)
end
# Lists billing active and inactive alerts
def self.list(filters = {}, opts = {})
request_stripe_object(method: :get, path: "/v1/billing/alerts", params: filters, opts: opts)
end
end
end
end

View File

@ -16,7 +16,7 @@ module Stripe
# Create sessions on-demand when customers intend to manage their subscriptions
# and billing details.
#
# Learn more in the [integration guide](https://stripe.com/docs/billing/subscriptions/integrating-customer-portal).
# Related guide: [Customer management](https://stripe.com/customer-management)
class Session < APIResource
extend Stripe::APIOperations::Create

View File

@ -20,6 +20,7 @@ module Stripe
class Session < APIResource
extend Stripe::APIOperations::Create
extend Stripe::APIOperations::List
include Stripe::APIOperations::Save
OBJECT_NAME = "checkout.session"
def self.object_name
@ -89,6 +90,16 @@ module Stripe
opts: opts
)
end
# Updates a Session object.
def self.update(id, params = {}, opts = {})
request_stripe_object(
method: :post,
path: format("/v1/checkout/sessions/%<id>s", { id: CGI.escape(id) }),
params: params,
opts: opts
)
end
end
end
end

View File

@ -3,7 +3,7 @@
module Stripe
module FinancialConnections
# An institution represents a banking institution which may be available for an end user to select in the Financial Connections authentication flow.
# An institution represents a financial institution to which an end user can connect using the Financial Connections authentication flow.
class Institution < APIResource
extend Stripe::APIOperations::List

View File

@ -13,7 +13,7 @@ module Stripe
# API. To configure and create VerificationReports, use the
# [VerificationSession](https://stripe.com/docs/api/identity/verification_sessions) API.
#
# Related guides: [Accessing verification results](https://stripe.com/docs/identity/verification-sessions#results).
# Related guide: [Accessing verification results](https://stripe.com/docs/identity/verification-sessions#results).
class VerificationReport < APIResource
extend Stripe::APIOperations::List

View File

@ -5,7 +5,7 @@ module Stripe
# A payment method domain represents a web domain that you have registered with Stripe.
# Stripe Elements use registered payment method domains to control where certain payment methods are shown.
#
# Related guides: [Payment method domains](https://stripe.com/docs/payments/payment-methods/pmd-registration).
# Related guide: [Payment method domains](https://stripe.com/docs/payments/payment-methods/pmd-registration).
class PaymentMethodDomain < APIResource
extend Stripe::APIOperations::Create
extend Stripe::APIOperations::List

View File

@ -56,7 +56,7 @@ module Stripe
request_stripe_object(method: :post, path: "/v1/refunds", params: params, opts: opts)
end
# Returns a list of all refunds you created. We return the refunds in sorted order, with the most recent refunds appearing first The 10 most recent refunds are always available by default on the Charge object.
# Returns a list of all refunds you created. We return the refunds in sorted order, with the most recent refunds appearing first. The 10 most recent refunds are always available by default on the Charge object.
def self.list(filters = {}, opts = {})
request_stripe_object(method: :get, path: "/v1/refunds", params: filters, opts: opts)
end

View File

@ -115,7 +115,7 @@ module Stripe
# Updates an existing subscription to match the specified parameters.
# When changing prices or quantities, we optionally prorate the price we charge next month to make up for any price changes.
# To preview how the proration is calculated, use the [upcoming invoice](https://stripe.com/docs/api/invoices/upcoming) endpoint.
# To preview how the proration is calculated, use the [create preview](https://stripe.com/docs/api/invoices/create_preview) endpoint.
#
# By default, we prorate subscription changes. For example, if a customer signs up on May 1 for a 100 price, they'll be billed 100 immediately. If on May 15 they switch to a 200 price, then on June 1 they'll be billed 250 (200 for a renewal of her subscription, plus a 50 prorating adjustment for half of the previous month's 100 difference). Similarly, a downgrade generates a credit that is applied to the next invoice. We also prorate when you make quantity changes.
#
@ -123,11 +123,11 @@ module Stripe
#
#
# The billing interval is changed (for example, from monthly to yearly).
# The subscription moves from free to paid, or paid to free.
# The subscription moves from free to paid.
# A trial starts or ends.
#
#
# In these cases, we apply a credit for the unused time on the previous price, immediately charge the customer using the new price, and reset the billing date.
# In these cases, we apply a credit for the unused time on the previous price, immediately charge the customer using the new price, and reset the billing date. Learn about how [Stripe immediately attempts payment for subscription changes](https://stripe.com/billing/subscriptions/upgrade-downgrade#immediate-payment).
#
# If you want to charge for an upgrade immediately, pass proration_behavior as always_invoice to create prorations, automatically invoice the customer for those proration adjustments, and attempt to collect payment. If you pass create_prorations, the prorations are created but not automatically invoiced. If you want to bill the customer for the prorations before the subscription's renewal date, you need to manually [invoice the customer](https://stripe.com/docs/api/invoices/create).
#

View File

@ -0,0 +1,24 @@
# File generated from our OpenAPI spec
# frozen_string_literal: true
module Stripe
module Tax
# A Tax Association exposes the Tax Transactions that Stripe attempted to create on your behalf based on the PaymentIntent input
class Association < APIResource
OBJECT_NAME = "tax.association"
def self.object_name
"tax.association"
end
# Finds a tax association object by PaymentIntent id.
def self.find(params = {}, opts = {})
request_stripe_object(
method: :get,
path: "/v1/tax/associations/find",
params: params,
opts: opts
)
end
end
end
end