diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 32518f99..f107144c 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v1642 \ No newline at end of file +v1648 \ No newline at end of file diff --git a/lib/stripe/api_version.rb b/lib/stripe/api_version.rb index 44670ff5..998577da 100644 --- a/lib/stripe/api_version.rb +++ b/lib/stripe/api_version.rb @@ -3,6 +3,6 @@ module Stripe module ApiVersion - CURRENT = "2025-03-31.basil" + CURRENT = "2025-03-31.preview" end end diff --git a/lib/stripe/resources/confirmation_token.rb b/lib/stripe/resources/confirmation_token.rb index 9add367d..38978df7 100644 --- a/lib/stripe/resources/confirmation_token.rb +++ b/lib/stripe/resources/confirmation_token.rb @@ -34,8 +34,23 @@ module Stripe class PaymentMethodOptions < Stripe::StripeObject class Card < Stripe::StripeObject + class Installments < Stripe::StripeObject + class Plan < Stripe::StripeObject + # For `fixed_count` installment plans, this is the number of installment payments your customer will make to their credit card. + attr_reader :count + # For `fixed_count` installment plans, this is the interval between installment payments your customer will make to their credit card. + # One of `month`. + attr_reader :interval + # Type of installment plan, one of `fixed_count`. + attr_reader :type + end + # Attribute for field plan + attr_reader :plan + end # The `cvc_update` Token collected from the Payment Element. attr_reader :cvc_token + # Installment configuration for payments. + attr_reader :installments end # This hash contains the card payment method options. attr_reader :card @@ -1531,6 +1546,47 @@ module Stripe end end + class PaymentMethodOptions < Stripe::RequestParams + class Card < Stripe::RequestParams + class Installments < Stripe::RequestParams + class Plan < Stripe::RequestParams + # For `fixed_count` installment plans, this is required. It represents the number of installment payments your customer will make to their credit card. + attr_accessor :count + # For `fixed_count` installment plans, this is required. It represents the interval between installment payments your customer will make to their credit card. + # One of `month`. + attr_accessor :interval + # Type of installment plan, one of `fixed_count`. + attr_accessor :type + + def initialize(count: nil, interval: nil, type: nil) + @count = count + @interval = interval + @type = type + end + end + # The selected installment plan to use for this payment attempt. + # This parameter can only be provided during confirmation. + attr_accessor :plan + + def initialize(plan: nil) + @plan = plan + end + end + # Installment configuration for payments attempted on this PaymentIntent. + attr_accessor :installments + + def initialize(installments: nil) + @installments = installments + end + end + # Attribute for param field card + attr_accessor :card + + def initialize(card: nil) + @card = card + end + end + class Shipping < Stripe::RequestParams class Address < Stripe::RequestParams # City, district, suburb, town, or village. @@ -1581,6 +1637,8 @@ module Stripe attr_accessor :payment_method # If provided, this hash will be used to create a PaymentMethod. attr_accessor :payment_method_data + # Attribute for param field payment_method_options + attr_accessor :payment_method_options # Return URL used to confirm the Intent. attr_accessor :return_url # Indicates that you intend to make future payments with this ConfirmationToken's payment method. @@ -1594,6 +1652,7 @@ module Stripe expand: nil, payment_method: nil, payment_method_data: nil, + payment_method_options: nil, return_url: nil, setup_future_usage: nil, shipping: nil @@ -1601,6 +1660,7 @@ module Stripe @expand = expand @payment_method = payment_method @payment_method_data = payment_method_data + @payment_method_options = payment_method_options @return_url = return_url @setup_future_usage = setup_future_usage @shipping = shipping diff --git a/lib/stripe/resources/coupon.rb b/lib/stripe/resources/coupon.rb index cdf9ef63..c50d63a5 100644 --- a/lib/stripe/resources/coupon.rb +++ b/lib/stripe/resources/coupon.rb @@ -178,7 +178,7 @@ module Stripe attr_reader :currency # Coupons defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). attr_reader :currency_options - # One of `forever`, `once`, and `repeating`. Describes how long a customer who applies this coupon will get the discount. + # One of `forever`, `once`, or `repeating`. Describes how long a customer who applies this coupon will get the discount. attr_reader :duration # If `duration` is `repeating`, the number of months the coupon applies. Null if coupon `duration` is `forever` or `once`. attr_reader :duration_in_months diff --git a/lib/stripe/resources/invoice.rb b/lib/stripe/resources/invoice.rb index ca7da378..96b0e53e 100644 --- a/lib/stripe/resources/invoice.rb +++ b/lib/stripe/resources/invoice.rb @@ -4308,8 +4308,6 @@ module Stripe attr_reader :status # Attribute for field status_transitions attr_reader :status_transitions - # Attribute for field subscription - attr_reader :subscription # Total of all subscriptions, invoice items, and prorations on the invoice before any invoice level discount or exclusive tax is applied. Item discounts are already incorporated attr_reader :subtotal # The integer amount in cents (or local equivalent) representing the subtotal of the invoice before any invoice level discount or tax is applied. Item discounts are already incorporated @@ -4440,7 +4438,7 @@ module Stripe request_stripe_object(method: :post, path: "/v1/invoices", params: params, opts: opts) 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. + # At any time, you can preview the upcoming invoice for a subscription or subscription schedule. 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. # diff --git a/lib/stripe/services/invoice_service.rb b/lib/stripe/services/invoice_service.rb index 2ba7be5c..d3c80956 100644 --- a/lib/stripe/services/invoice_service.rb +++ b/lib/stripe/services/invoice_service.rb @@ -3744,7 +3744,7 @@ module Stripe request(method: :post, path: "/v1/invoices", params: params, opts: opts, base_address: :api) 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. + # At any time, you can preview the upcoming invoice for a subscription or subscription schedule. 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. # diff --git a/lib/stripe/services/test_helpers/confirmation_token_service.rb b/lib/stripe/services/test_helpers/confirmation_token_service.rb index 1dca0633..cb3049aa 100644 --- a/lib/stripe/services/test_helpers/confirmation_token_service.rb +++ b/lib/stripe/services/test_helpers/confirmation_token_service.rb @@ -673,6 +673,47 @@ module Stripe end end + class PaymentMethodOptions < Stripe::RequestParams + class Card < Stripe::RequestParams + class Installments < Stripe::RequestParams + class Plan < Stripe::RequestParams + # For `fixed_count` installment plans, this is required. It represents the number of installment payments your customer will make to their credit card. + attr_accessor :count + # For `fixed_count` installment plans, this is required. It represents the interval between installment payments your customer will make to their credit card. + # One of `month`. + attr_accessor :interval + # Type of installment plan, one of `fixed_count`. + attr_accessor :type + + def initialize(count: nil, interval: nil, type: nil) + @count = count + @interval = interval + @type = type + end + end + # The selected installment plan to use for this payment attempt. + # This parameter can only be provided during confirmation. + attr_accessor :plan + + def initialize(plan: nil) + @plan = plan + end + end + # Installment configuration for payments attempted on this PaymentIntent. + attr_accessor :installments + + def initialize(installments: nil) + @installments = installments + end + end + # Attribute for param field card + attr_accessor :card + + def initialize(card: nil) + @card = card + end + end + class Shipping < Stripe::RequestParams class Address < Stripe::RequestParams # City, district, suburb, town, or village. @@ -723,6 +764,8 @@ module Stripe attr_accessor :payment_method # If provided, this hash will be used to create a PaymentMethod. attr_accessor :payment_method_data + # Attribute for param field payment_method_options + attr_accessor :payment_method_options # Return URL used to confirm the Intent. attr_accessor :return_url # Indicates that you intend to make future payments with this ConfirmationToken's payment method. @@ -736,6 +779,7 @@ module Stripe expand: nil, payment_method: nil, payment_method_data: nil, + payment_method_options: nil, return_url: nil, setup_future_usage: nil, shipping: nil @@ -743,6 +787,7 @@ module Stripe @expand = expand @payment_method = payment_method @payment_method_data = payment_method_data + @payment_method_options = payment_method_options @return_url = return_url @setup_future_usage = setup_future_usage @shipping = shipping diff --git a/rbi/stripe.rbi b/rbi/stripe.rbi index 2ad457a6..ac884179 100644 --- a/rbi/stripe.rbi +++ b/rbi/stripe.rbi @@ -23200,9 +23200,29 @@ module Stripe end class PaymentMethodOptions < Stripe::StripeObject class Card < Stripe::StripeObject + class Installments < Stripe::StripeObject + class Plan < Stripe::StripeObject + # For `fixed_count` installment plans, this is the number of installment payments your customer will make to their credit card. + sig { returns(T.nilable(Integer)) } + attr_reader :count + # For `fixed_count` installment plans, this is the interval between installment payments your customer will make to their credit card. + # One of `month`. + sig { returns(T.nilable(String)) } + attr_reader :interval + # Type of installment plan, one of `fixed_count`. + sig { returns(String) } + attr_reader :type + end + # Attribute for field plan + sig { returns(Plan) } + attr_reader :plan + end # The `cvc_update` Token collected from the Payment Element. sig { returns(T.nilable(String)) } attr_reader :cvc_token + # Installment configuration for payments. + sig { returns(Installments) } + attr_reader :installments end # This hash contains the card payment method options. sig { returns(T.nilable(Card)) } @@ -25083,6 +25103,56 @@ module Stripe zip: nil ); end end + class PaymentMethodOptions < Stripe::RequestParams + class Card < Stripe::RequestParams + class Installments < Stripe::RequestParams + class Plan < Stripe::RequestParams + # For `fixed_count` installment plans, this is required. It represents the number of installment payments your customer will make to their credit card. + sig { returns(T.nilable(Integer)) } + attr_accessor :count + # For `fixed_count` installment plans, this is required. It represents the interval between installment payments your customer will make to their credit card. + # One of `month`. + sig { returns(T.nilable(String)) } + attr_accessor :interval + # Type of installment plan, one of `fixed_count`. + sig { returns(String) } + attr_accessor :type + sig { + params(count: T.nilable(Integer), interval: T.nilable(String), type: String).void + } + def initialize(count: nil, interval: nil, type: nil); end + end + # The selected installment plan to use for this payment attempt. + # This parameter can only be provided during confirmation. + sig { + returns(::Stripe::ConfirmationToken::CreateParams::PaymentMethodOptions::Card::Installments::Plan) + } + attr_accessor :plan + sig { + params(plan: ::Stripe::ConfirmationToken::CreateParams::PaymentMethodOptions::Card::Installments::Plan).void + } + def initialize(plan: nil); end + end + # Installment configuration for payments attempted on this PaymentIntent. + sig { + returns(T.nilable(::Stripe::ConfirmationToken::CreateParams::PaymentMethodOptions::Card::Installments)) + } + attr_accessor :installments + sig { + params(installments: T.nilable(::Stripe::ConfirmationToken::CreateParams::PaymentMethodOptions::Card::Installments)).void + } + def initialize(installments: nil); end + end + # Attribute for param field card + sig { + returns(T.nilable(::Stripe::ConfirmationToken::CreateParams::PaymentMethodOptions::Card)) + } + attr_accessor :card + sig { + params(card: T.nilable(::Stripe::ConfirmationToken::CreateParams::PaymentMethodOptions::Card)).void + } + def initialize(card: nil); end + end class Shipping < Stripe::RequestParams class Address < Stripe::RequestParams # City, district, suburb, town, or village. @@ -25138,6 +25208,9 @@ module Stripe # If provided, this hash will be used to create a PaymentMethod. sig { returns(T.nilable(::Stripe::ConfirmationToken::CreateParams::PaymentMethodData)) } attr_accessor :payment_method_data + # Attribute for param field payment_method_options + sig { returns(T.nilable(::Stripe::ConfirmationToken::CreateParams::PaymentMethodOptions)) } + attr_accessor :payment_method_options # Return URL used to confirm the Intent. sig { returns(T.nilable(String)) } attr_accessor :return_url @@ -25150,12 +25223,13 @@ module Stripe sig { returns(T.nilable(::Stripe::ConfirmationToken::CreateParams::Shipping)) } attr_accessor :shipping sig { - params(expand: T.nilable(T::Array[String]), payment_method: T.nilable(String), payment_method_data: T.nilable(::Stripe::ConfirmationToken::CreateParams::PaymentMethodData), return_url: T.nilable(String), setup_future_usage: T.nilable(String), shipping: T.nilable(::Stripe::ConfirmationToken::CreateParams::Shipping)).void + params(expand: T.nilable(T::Array[String]), payment_method: T.nilable(String), payment_method_data: T.nilable(::Stripe::ConfirmationToken::CreateParams::PaymentMethodData), payment_method_options: T.nilable(::Stripe::ConfirmationToken::CreateParams::PaymentMethodOptions), return_url: T.nilable(String), setup_future_usage: T.nilable(String), shipping: T.nilable(::Stripe::ConfirmationToken::CreateParams::Shipping)).void } def initialize( expand: nil, payment_method: nil, payment_method_data: nil, + payment_method_options: nil, return_url: nil, setup_future_usage: nil, shipping: nil @@ -25299,7 +25373,7 @@ module Stripe # Coupons defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). sig { returns(T::Hash[String, CurrencyOptions]) } attr_reader :currency_options - # One of `forever`, `once`, and `repeating`. Describes how long a customer who applies this coupon will get the discount. + # One of `forever`, `once`, or `repeating`. Describes how long a customer who applies this coupon will get the discount. sig { returns(String) } attr_reader :duration # If `duration` is `repeating`, the number of months the coupon applies. Null if coupon `duration` is `forever` or `once`. @@ -33017,9 +33091,6 @@ module Stripe # Attribute for field status_transitions sig { returns(StatusTransitions) } attr_reader :status_transitions - # Attribute for field subscription - sig { returns(T.nilable(T.any(String, Stripe::Subscription))) } - attr_reader :subscription # Total of all subscriptions, invoice items, and prorations on the invoice before any invoice level discount or exclusive tax is applied. Item discounts are already incorporated sig { returns(Integer) } attr_reader :subtotal @@ -37071,7 +37142,7 @@ module Stripe } def self.create(params = {}, opts = {}); 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. + # At any time, you can preview the upcoming invoice for a subscription or subscription schedule. 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. # @@ -90156,7 +90227,7 @@ module Stripe sig { returns(T.nilable(Integer)) } attr_reader :cancel_at # Whether this subscription will (if `status=active`) or did (if `status=canceled`) cancel at the end of the current billing period. - sig { returns(T.nilable(T::Boolean)) } + sig { returns(T::Boolean) } attr_reader :cancel_at_period_end # If the subscription has been canceled, the date of that cancellation. If the subscription was canceled with `cancel_at_period_end`, `canceled_at` will reflect the time of the most recent update request, not the end of the subscription period when the subscription is automatically moved to a canceled state. sig { returns(T.nilable(Integer)) } @@ -122949,6 +123020,56 @@ module Stripe zip: nil ); end end + class PaymentMethodOptions < Stripe::RequestParams + class Card < Stripe::RequestParams + class Installments < Stripe::RequestParams + class Plan < Stripe::RequestParams + # For `fixed_count` installment plans, this is required. It represents the number of installment payments your customer will make to their credit card. + sig { returns(T.nilable(Integer)) } + attr_accessor :count + # For `fixed_count` installment plans, this is required. It represents the interval between installment payments your customer will make to their credit card. + # One of `month`. + sig { returns(T.nilable(String)) } + attr_accessor :interval + # Type of installment plan, one of `fixed_count`. + sig { returns(String) } + attr_accessor :type + sig { + params(count: T.nilable(Integer), interval: T.nilable(String), type: String).void + } + def initialize(count: nil, interval: nil, type: nil); end + end + # The selected installment plan to use for this payment attempt. + # This parameter can only be provided during confirmation. + sig { + returns(::Stripe::TestHelpers::ConfirmationTokenService::CreateParams::PaymentMethodOptions::Card::Installments::Plan) + } + attr_accessor :plan + sig { + params(plan: ::Stripe::TestHelpers::ConfirmationTokenService::CreateParams::PaymentMethodOptions::Card::Installments::Plan).void + } + def initialize(plan: nil); end + end + # Installment configuration for payments attempted on this PaymentIntent. + sig { + returns(T.nilable(::Stripe::TestHelpers::ConfirmationTokenService::CreateParams::PaymentMethodOptions::Card::Installments)) + } + attr_accessor :installments + sig { + params(installments: T.nilable(::Stripe::TestHelpers::ConfirmationTokenService::CreateParams::PaymentMethodOptions::Card::Installments)).void + } + def initialize(installments: nil); end + end + # Attribute for param field card + sig { + returns(T.nilable(::Stripe::TestHelpers::ConfirmationTokenService::CreateParams::PaymentMethodOptions::Card)) + } + attr_accessor :card + sig { + params(card: T.nilable(::Stripe::TestHelpers::ConfirmationTokenService::CreateParams::PaymentMethodOptions::Card)).void + } + def initialize(card: nil); end + end class Shipping < Stripe::RequestParams class Address < Stripe::RequestParams # City, district, suburb, town, or village. @@ -123008,6 +123129,11 @@ module Stripe returns(T.nilable(::Stripe::TestHelpers::ConfirmationTokenService::CreateParams::PaymentMethodData)) } attr_accessor :payment_method_data + # Attribute for param field payment_method_options + sig { + returns(T.nilable(::Stripe::TestHelpers::ConfirmationTokenService::CreateParams::PaymentMethodOptions)) + } + attr_accessor :payment_method_options # Return URL used to confirm the Intent. sig { returns(T.nilable(String)) } attr_accessor :return_url @@ -123022,12 +123148,13 @@ module Stripe } attr_accessor :shipping sig { - params(expand: T.nilable(T::Array[String]), payment_method: T.nilable(String), payment_method_data: T.nilable(::Stripe::TestHelpers::ConfirmationTokenService::CreateParams::PaymentMethodData), return_url: T.nilable(String), setup_future_usage: T.nilable(String), shipping: T.nilable(::Stripe::TestHelpers::ConfirmationTokenService::CreateParams::Shipping)).void + params(expand: T.nilable(T::Array[String]), payment_method: T.nilable(String), payment_method_data: T.nilable(::Stripe::TestHelpers::ConfirmationTokenService::CreateParams::PaymentMethodData), payment_method_options: T.nilable(::Stripe::TestHelpers::ConfirmationTokenService::CreateParams::PaymentMethodOptions), return_url: T.nilable(String), setup_future_usage: T.nilable(String), shipping: T.nilable(::Stripe::TestHelpers::ConfirmationTokenService::CreateParams::Shipping)).void } def initialize( expand: nil, payment_method: nil, payment_method_data: nil, + payment_method_options: nil, return_url: nil, setup_future_usage: nil, shipping: nil @@ -134042,7 +134169,7 @@ module Stripe } def create(params = {}, opts = {}); 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. + # At any time, you can preview the upcoming invoice for a subscription or subscription schedule. 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. # diff --git a/rbi/stripe/resources/confirmation_token.rbi b/rbi/stripe/resources/confirmation_token.rbi index 5ee05474..89eb5f04 100644 --- a/rbi/stripe/resources/confirmation_token.rbi +++ b/rbi/stripe/resources/confirmation_token.rbi @@ -34,9 +34,29 @@ module Stripe end class PaymentMethodOptions < Stripe::StripeObject class Card < Stripe::StripeObject + class Installments < Stripe::StripeObject + class Plan < Stripe::StripeObject + # For `fixed_count` installment plans, this is the number of installment payments your customer will make to their credit card. + sig { returns(T.nilable(Integer)) } + attr_reader :count + # For `fixed_count` installment plans, this is the interval between installment payments your customer will make to their credit card. + # One of `month`. + sig { returns(T.nilable(String)) } + attr_reader :interval + # Type of installment plan, one of `fixed_count`. + sig { returns(String) } + attr_reader :type + end + # Attribute for field plan + sig { returns(Plan) } + attr_reader :plan + end # The `cvc_update` Token collected from the Payment Element. sig { returns(T.nilable(String)) } attr_reader :cvc_token + # Installment configuration for payments. + sig { returns(Installments) } + attr_reader :installments end # This hash contains the card payment method options. sig { returns(T.nilable(Card)) } @@ -1917,6 +1937,56 @@ module Stripe zip: nil ); end end + class PaymentMethodOptions < Stripe::RequestParams + class Card < Stripe::RequestParams + class Installments < Stripe::RequestParams + class Plan < Stripe::RequestParams + # For `fixed_count` installment plans, this is required. It represents the number of installment payments your customer will make to their credit card. + sig { returns(T.nilable(Integer)) } + attr_accessor :count + # For `fixed_count` installment plans, this is required. It represents the interval between installment payments your customer will make to their credit card. + # One of `month`. + sig { returns(T.nilable(String)) } + attr_accessor :interval + # Type of installment plan, one of `fixed_count`. + sig { returns(String) } + attr_accessor :type + sig { + params(count: T.nilable(Integer), interval: T.nilable(String), type: String).void + } + def initialize(count: nil, interval: nil, type: nil); end + end + # The selected installment plan to use for this payment attempt. + # This parameter can only be provided during confirmation. + sig { + returns(::Stripe::ConfirmationToken::CreateParams::PaymentMethodOptions::Card::Installments::Plan) + } + attr_accessor :plan + sig { + params(plan: ::Stripe::ConfirmationToken::CreateParams::PaymentMethodOptions::Card::Installments::Plan).void + } + def initialize(plan: nil); end + end + # Installment configuration for payments attempted on this PaymentIntent. + sig { + returns(T.nilable(::Stripe::ConfirmationToken::CreateParams::PaymentMethodOptions::Card::Installments)) + } + attr_accessor :installments + sig { + params(installments: T.nilable(::Stripe::ConfirmationToken::CreateParams::PaymentMethodOptions::Card::Installments)).void + } + def initialize(installments: nil); end + end + # Attribute for param field card + sig { + returns(T.nilable(::Stripe::ConfirmationToken::CreateParams::PaymentMethodOptions::Card)) + } + attr_accessor :card + sig { + params(card: T.nilable(::Stripe::ConfirmationToken::CreateParams::PaymentMethodOptions::Card)).void + } + def initialize(card: nil); end + end class Shipping < Stripe::RequestParams class Address < Stripe::RequestParams # City, district, suburb, town, or village. @@ -1972,6 +2042,9 @@ module Stripe # If provided, this hash will be used to create a PaymentMethod. sig { returns(T.nilable(::Stripe::ConfirmationToken::CreateParams::PaymentMethodData)) } attr_accessor :payment_method_data + # Attribute for param field payment_method_options + sig { returns(T.nilable(::Stripe::ConfirmationToken::CreateParams::PaymentMethodOptions)) } + attr_accessor :payment_method_options # Return URL used to confirm the Intent. sig { returns(T.nilable(String)) } attr_accessor :return_url @@ -1984,12 +2057,13 @@ module Stripe sig { returns(T.nilable(::Stripe::ConfirmationToken::CreateParams::Shipping)) } attr_accessor :shipping sig { - params(expand: T.nilable(T::Array[String]), payment_method: T.nilable(String), payment_method_data: T.nilable(::Stripe::ConfirmationToken::CreateParams::PaymentMethodData), return_url: T.nilable(String), setup_future_usage: T.nilable(String), shipping: T.nilable(::Stripe::ConfirmationToken::CreateParams::Shipping)).void + params(expand: T.nilable(T::Array[String]), payment_method: T.nilable(String), payment_method_data: T.nilable(::Stripe::ConfirmationToken::CreateParams::PaymentMethodData), payment_method_options: T.nilable(::Stripe::ConfirmationToken::CreateParams::PaymentMethodOptions), return_url: T.nilable(String), setup_future_usage: T.nilable(String), shipping: T.nilable(::Stripe::ConfirmationToken::CreateParams::Shipping)).void } def initialize( expand: nil, payment_method: nil, payment_method_data: nil, + payment_method_options: nil, return_url: nil, setup_future_usage: nil, shipping: nil diff --git a/rbi/stripe/resources/coupon.rbi b/rbi/stripe/resources/coupon.rbi index 65a900af..a2bcab7b 100644 --- a/rbi/stripe/resources/coupon.rbi +++ b/rbi/stripe/resources/coupon.rbi @@ -32,7 +32,7 @@ module Stripe # Coupons defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). sig { returns(T::Hash[String, CurrencyOptions]) } attr_reader :currency_options - # One of `forever`, `once`, and `repeating`. Describes how long a customer who applies this coupon will get the discount. + # One of `forever`, `once`, or `repeating`. Describes how long a customer who applies this coupon will get the discount. sig { returns(String) } attr_reader :duration # If `duration` is `repeating`, the number of months the coupon applies. Null if coupon `duration` is `forever` or `once`. diff --git a/rbi/stripe/resources/invoice.rbi b/rbi/stripe/resources/invoice.rbi index 4da1b0ef..74d7af17 100644 --- a/rbi/stripe/resources/invoice.rbi +++ b/rbi/stripe/resources/invoice.rbi @@ -820,9 +820,6 @@ module Stripe # Attribute for field status_transitions sig { returns(StatusTransitions) } attr_reader :status_transitions - # Attribute for field subscription - sig { returns(T.nilable(T.any(String, Stripe::Subscription))) } - attr_reader :subscription # Total of all subscriptions, invoice items, and prorations on the invoice before any invoice level discount or exclusive tax is applied. Item discounts are already incorporated sig { returns(Integer) } attr_reader :subtotal @@ -4874,7 +4871,7 @@ module Stripe } def self.create(params = {}, opts = {}); 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. + # At any time, you can preview the upcoming invoice for a subscription or subscription schedule. 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. # diff --git a/rbi/stripe/resources/subscription.rbi b/rbi/stripe/resources/subscription.rbi index 8844974c..c6dd442e 100644 --- a/rbi/stripe/resources/subscription.rbi +++ b/rbi/stripe/resources/subscription.rbi @@ -304,7 +304,7 @@ module Stripe sig { returns(T.nilable(Integer)) } attr_reader :cancel_at # Whether this subscription will (if `status=active`) or did (if `status=canceled`) cancel at the end of the current billing period. - sig { returns(T.nilable(T::Boolean)) } + sig { returns(T::Boolean) } attr_reader :cancel_at_period_end # If the subscription has been canceled, the date of that cancellation. If the subscription was canceled with `cancel_at_period_end`, `canceled_at` will reflect the time of the most recent update request, not the end of the subscription period when the subscription is automatically moved to a canceled state. sig { returns(T.nilable(Integer)) } diff --git a/rbi/stripe/services/invoice_service.rbi b/rbi/stripe/services/invoice_service.rbi index 2edfeba6..05338e47 100644 --- a/rbi/stripe/services/invoice_service.rbi +++ b/rbi/stripe/services/invoice_service.rbi @@ -4008,7 +4008,7 @@ module Stripe } def create(params = {}, opts = {}); 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. + # At any time, you can preview the upcoming invoice for a subscription or subscription schedule. 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. # diff --git a/rbi/stripe/services/test_helpers/confirmation_token_service.rbi b/rbi/stripe/services/test_helpers/confirmation_token_service.rbi index ebf29edf..d0c54991 100644 --- a/rbi/stripe/services/test_helpers/confirmation_token_service.rbi +++ b/rbi/stripe/services/test_helpers/confirmation_token_service.rbi @@ -768,6 +768,56 @@ module Stripe zip: nil ); end end + class PaymentMethodOptions < Stripe::RequestParams + class Card < Stripe::RequestParams + class Installments < Stripe::RequestParams + class Plan < Stripe::RequestParams + # For `fixed_count` installment plans, this is required. It represents the number of installment payments your customer will make to their credit card. + sig { returns(T.nilable(Integer)) } + attr_accessor :count + # For `fixed_count` installment plans, this is required. It represents the interval between installment payments your customer will make to their credit card. + # One of `month`. + sig { returns(T.nilable(String)) } + attr_accessor :interval + # Type of installment plan, one of `fixed_count`. + sig { returns(String) } + attr_accessor :type + sig { + params(count: T.nilable(Integer), interval: T.nilable(String), type: String).void + } + def initialize(count: nil, interval: nil, type: nil); end + end + # The selected installment plan to use for this payment attempt. + # This parameter can only be provided during confirmation. + sig { + returns(::Stripe::TestHelpers::ConfirmationTokenService::CreateParams::PaymentMethodOptions::Card::Installments::Plan) + } + attr_accessor :plan + sig { + params(plan: ::Stripe::TestHelpers::ConfirmationTokenService::CreateParams::PaymentMethodOptions::Card::Installments::Plan).void + } + def initialize(plan: nil); end + end + # Installment configuration for payments attempted on this PaymentIntent. + sig { + returns(T.nilable(::Stripe::TestHelpers::ConfirmationTokenService::CreateParams::PaymentMethodOptions::Card::Installments)) + } + attr_accessor :installments + sig { + params(installments: T.nilable(::Stripe::TestHelpers::ConfirmationTokenService::CreateParams::PaymentMethodOptions::Card::Installments)).void + } + def initialize(installments: nil); end + end + # Attribute for param field card + sig { + returns(T.nilable(::Stripe::TestHelpers::ConfirmationTokenService::CreateParams::PaymentMethodOptions::Card)) + } + attr_accessor :card + sig { + params(card: T.nilable(::Stripe::TestHelpers::ConfirmationTokenService::CreateParams::PaymentMethodOptions::Card)).void + } + def initialize(card: nil); end + end class Shipping < Stripe::RequestParams class Address < Stripe::RequestParams # City, district, suburb, town, or village. @@ -827,6 +877,11 @@ module Stripe returns(T.nilable(::Stripe::TestHelpers::ConfirmationTokenService::CreateParams::PaymentMethodData)) } attr_accessor :payment_method_data + # Attribute for param field payment_method_options + sig { + returns(T.nilable(::Stripe::TestHelpers::ConfirmationTokenService::CreateParams::PaymentMethodOptions)) + } + attr_accessor :payment_method_options # Return URL used to confirm the Intent. sig { returns(T.nilable(String)) } attr_accessor :return_url @@ -841,12 +896,13 @@ module Stripe } attr_accessor :shipping sig { - params(expand: T.nilable(T::Array[String]), payment_method: T.nilable(String), payment_method_data: T.nilable(::Stripe::TestHelpers::ConfirmationTokenService::CreateParams::PaymentMethodData), return_url: T.nilable(String), setup_future_usage: T.nilable(String), shipping: T.nilable(::Stripe::TestHelpers::ConfirmationTokenService::CreateParams::Shipping)).void + params(expand: T.nilable(T::Array[String]), payment_method: T.nilable(String), payment_method_data: T.nilable(::Stripe::TestHelpers::ConfirmationTokenService::CreateParams::PaymentMethodData), payment_method_options: T.nilable(::Stripe::TestHelpers::ConfirmationTokenService::CreateParams::PaymentMethodOptions), return_url: T.nilable(String), setup_future_usage: T.nilable(String), shipping: T.nilable(::Stripe::TestHelpers::ConfirmationTokenService::CreateParams::Shipping)).void } def initialize( expand: nil, payment_method: nil, payment_method_data: nil, + payment_method_options: nil, return_url: nil, setup_future_usage: nil, shipping: nil