diff options
author | Ramya Rao <100975018+ramya-stripe@users.noreply.github.com> | 2025-04-01 16:13:24 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-04-01 16:13:24 -0700 |
commit | 95624863e1f9d18dc5dd8e80000bb3692c7ab8fc (patch) | |
tree | 53ddba439832e0b5fc940445bd26e7046c3f928a | |
parent | 4d905c71eb12bb3a5251555ee2722386954dd9d6 (diff) |
Generate beta SDKs for Open API version 1648 (#1482)
-rw-r--r-- | OPENAPI_VERSION | 2 | ||||
-rw-r--r-- | stripe/_api_version.py | 2 | ||||
-rw-r--r-- | stripe/_confirmation_token.py | 62 | ||||
-rw-r--r-- | stripe/_coupon.py | 2 | ||||
-rw-r--r-- | stripe/_invoice.py | 4 | ||||
-rw-r--r-- | stripe/_invoice_service.py | 4 | ||||
-rw-r--r-- | stripe/_payment_intent.py | 53 | ||||
-rw-r--r-- | stripe/_payment_intent_service.py | 48 | ||||
-rw-r--r-- | stripe/test_helpers/_confirmation_token_service.py | 38 |
9 files changed, 208 insertions, 7 deletions
diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 6b6014df..f107144c 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v1641 \ No newline at end of file +v1648 \ No newline at end of file diff --git a/stripe/_api_version.py b/stripe/_api_version.py index 174f150b..8ae3e03f 100644 --- a/stripe/_api_version.py +++ b/stripe/_api_version.py @@ -1,4 +1,4 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec class _ApiVersion: - CURRENT = "2025-03-31.basil" + CURRENT = "2025-03-31.preview" diff --git a/stripe/_confirmation_token.py b/stripe/_confirmation_token.py index a6a7f4aa..06a50ff8 100644 --- a/stripe/_confirmation_token.py +++ b/stripe/_confirmation_token.py @@ -64,10 +64,34 @@ class ConfirmationToken(APIResource["ConfirmationToken"]): class PaymentMethodOptions(StripeObject): class Card(StripeObject): + class Installments(StripeObject): + class Plan(StripeObject): + count: Optional[int] + """ + For `fixed_count` installment plans, this is the number of installment payments your customer will make to their credit card. + """ + interval: Optional[Literal["month"]] + """ + For `fixed_count` installment plans, this is the interval between installment payments your customer will make to their credit card. + One of `month`. + """ + type: Literal["fixed_count"] + """ + Type of installment plan, one of `fixed_count`. + """ + + plan: Optional[Plan] + _inner_class_types = {"plan": Plan} + cvc_token: Optional[str] """ The `cvc_update` Token collected from the Payment Element. """ + installments: Optional[Installments] + """ + Installment configuration for payments. + """ + _inner_class_types = {"installments": Installments} card: Optional[Card] """ @@ -1688,6 +1712,9 @@ class ConfirmationToken(APIResource["ConfirmationToken"]): """ If provided, this hash will be used to create a PaymentMethod. """ + payment_method_options: NotRequired[ + "ConfirmationToken.CreateParamsPaymentMethodOptions" + ] return_url: NotRequired[str] """ Return URL used to confirm the Intent. @@ -2574,6 +2601,41 @@ class ConfirmationToken(APIResource["ConfirmationToken"]): class CreateParamsPaymentMethodDataZip(TypedDict): pass + class CreateParamsPaymentMethodOptions(TypedDict): + card: NotRequired[ + "ConfirmationToken.CreateParamsPaymentMethodOptionsCard" + ] + + class CreateParamsPaymentMethodOptionsCard(TypedDict): + installments: NotRequired[ + "ConfirmationToken.CreateParamsPaymentMethodOptionsCardInstallments" + ] + """ + Installment configuration for payments attempted on this PaymentIntent. + """ + + class CreateParamsPaymentMethodOptionsCardInstallments(TypedDict): + plan: "ConfirmationToken.CreateParamsPaymentMethodOptionsCardInstallmentsPlan" + """ + The selected installment plan to use for this payment attempt. + This parameter can only be provided during confirmation. + """ + + class CreateParamsPaymentMethodOptionsCardInstallmentsPlan(TypedDict): + count: NotRequired[int] + """ + For `fixed_count` installment plans, this is required. It represents the number of installment payments your customer will make to their credit card. + """ + interval: NotRequired[Literal["month"]] + """ + 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`. + """ + type: Literal["fixed_count"] + """ + Type of installment plan, one of `fixed_count`. + """ + class CreateParamsShipping(TypedDict): address: "ConfirmationToken.CreateParamsShippingAddress" """ diff --git a/stripe/_coupon.py b/stripe/_coupon.py index 125282fa..9b9a1c51 100644 --- a/stripe/_coupon.py +++ b/stripe/_coupon.py @@ -200,7 +200,7 @@ class Coupon( """ duration: Literal["forever", "once", "repeating"] """ - 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. """ duration_in_months: Optional[int] """ diff --git a/stripe/_invoice.py b/stripe/_invoice.py index ede19d76..3537394c 100644 --- a/stripe/_invoice.py +++ b/stripe/_invoice.py @@ -6196,7 +6196,7 @@ class Invoice( cls, **params: Unpack["Invoice.CreatePreviewParams"] ) -> "Invoice": """ - 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. @@ -6218,7 +6218,7 @@ class Invoice( cls, **params: Unpack["Invoice.CreatePreviewParams"] ) -> "Invoice": """ - 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/stripe/_invoice_service.py b/stripe/_invoice_service.py index ee7314b1..eb276573 100644 --- a/stripe/_invoice_service.py +++ b/stripe/_invoice_service.py @@ -4845,7 +4845,7 @@ class InvoiceService(StripeService): options: RequestOptions = {}, ) -> Invoice: """ - 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. @@ -4870,7 +4870,7 @@ class InvoiceService(StripeService): options: RequestOptions = {}, ) -> Invoice: """ - 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/stripe/_payment_intent.py b/stripe/_payment_intent.py index e919d05f..c00af7e3 100644 --- a/stripe/_payment_intent.py +++ b/stripe/_payment_intent.py @@ -1855,6 +1855,9 @@ class PaymentIntent( When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://stripe.com/strong-customer-authentication). """ + class Billie(StripeObject): + pass + class Blik(StripeObject): setup_future_usage: Optional[Literal["none"]] """ @@ -2973,6 +2976,7 @@ class PaymentIntent( au_becs_debit: Optional[AuBecsDebit] bacs_debit: Optional[BacsDebit] bancontact: Optional[Bancontact] + billie: Optional[Billie] blik: Optional[Blik] boleto: Optional[Boleto] card: Optional[Card] @@ -3029,6 +3033,7 @@ class PaymentIntent( "au_becs_debit": AuBecsDebit, "bacs_debit": BacsDebit, "bancontact": Bancontact, + "billie": Billie, "blik": Blik, "boleto": Boleto, "card": Card, @@ -5658,6 +5663,12 @@ class PaymentIntent( """ If this is a `bancontact` PaymentMethod, this sub-hash contains details about the Bancontact payment method options. """ + billie: NotRequired[ + "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsBillie" + ] + """ + If this is a `billie` PaymentMethod, this sub-hash contains details about the Billie payment method options. + """ blik: NotRequired[ "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsBlik" ] @@ -6162,6 +6173,16 @@ class PaymentIntent( If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ + class ConfirmParamsPaymentMethodOptionsBillie(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] + """ + Controls when the funds are captured from the customer's account. + + If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + """ + class ConfirmParamsPaymentMethodOptionsBlik(TypedDict): code: NotRequired[str] """ @@ -9500,6 +9521,12 @@ class PaymentIntent( """ If this is a `bancontact` PaymentMethod, this sub-hash contains details about the Bancontact payment method options. """ + billie: NotRequired[ + "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsBillie" + ] + """ + If this is a `billie` PaymentMethod, this sub-hash contains details about the Billie payment method options. + """ blik: NotRequired[ "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsBlik" ] @@ -10004,6 +10031,16 @@ class PaymentIntent( If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ + class CreateParamsPaymentMethodOptionsBillie(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] + """ + Controls when the funds are captured from the customer's account. + + If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + """ + class CreateParamsPaymentMethodOptionsBlik(TypedDict): code: NotRequired[str] """ @@ -13478,6 +13515,12 @@ class PaymentIntent( """ If this is a `bancontact` PaymentMethod, this sub-hash contains details about the Bancontact payment method options. """ + billie: NotRequired[ + "Literal['']|PaymentIntent.ModifyParamsPaymentMethodOptionsBillie" + ] + """ + If this is a `billie` PaymentMethod, this sub-hash contains details about the Billie payment method options. + """ blik: NotRequired[ "Literal['']|PaymentIntent.ModifyParamsPaymentMethodOptionsBlik" ] @@ -13982,6 +14025,16 @@ class PaymentIntent( If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ + class ModifyParamsPaymentMethodOptionsBillie(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] + """ + Controls when the funds are captured from the customer's account. + + If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + """ + class ModifyParamsPaymentMethodOptionsBlik(TypedDict): code: NotRequired[str] """ diff --git a/stripe/_payment_intent_service.py b/stripe/_payment_intent_service.py index f215e981..452085f9 100644 --- a/stripe/_payment_intent_service.py +++ b/stripe/_payment_intent_service.py @@ -2560,6 +2560,12 @@ class PaymentIntentService(StripeService): """ If this is a `bancontact` PaymentMethod, this sub-hash contains details about the Bancontact payment method options. """ + billie: NotRequired[ + "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsBillie" + ] + """ + If this is a `billie` PaymentMethod, this sub-hash contains details about the Billie payment method options. + """ blik: NotRequired[ "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsBlik" ] @@ -3064,6 +3070,16 @@ class PaymentIntentService(StripeService): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ + class ConfirmParamsPaymentMethodOptionsBillie(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] + """ + Controls when the funds are captured from the customer's account. + + If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + """ + class ConfirmParamsPaymentMethodOptionsBlik(TypedDict): code: NotRequired[str] """ @@ -6456,6 +6472,12 @@ class PaymentIntentService(StripeService): """ If this is a `bancontact` PaymentMethod, this sub-hash contains details about the Bancontact payment method options. """ + billie: NotRequired[ + "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsBillie" + ] + """ + If this is a `billie` PaymentMethod, this sub-hash contains details about the Billie payment method options. + """ blik: NotRequired[ "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsBlik" ] @@ -6960,6 +6982,16 @@ class PaymentIntentService(StripeService): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ + class CreateParamsPaymentMethodOptionsBillie(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] + """ + Controls when the funds are captured from the customer's account. + + If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + """ + class CreateParamsPaymentMethodOptionsBlik(TypedDict): code: NotRequired[str] """ @@ -10540,6 +10572,12 @@ class PaymentIntentService(StripeService): """ If this is a `bancontact` PaymentMethod, this sub-hash contains details about the Bancontact payment method options. """ + billie: NotRequired[ + "Literal['']|PaymentIntentService.UpdateParamsPaymentMethodOptionsBillie" + ] + """ + If this is a `billie` PaymentMethod, this sub-hash contains details about the Billie payment method options. + """ blik: NotRequired[ "Literal['']|PaymentIntentService.UpdateParamsPaymentMethodOptionsBlik" ] @@ -11044,6 +11082,16 @@ class PaymentIntentService(StripeService): If you've already set `setup_future_usage` and you're performing a request using a publishable key, you can only update the value from `on_session` to `off_session`. """ + class UpdateParamsPaymentMethodOptionsBillie(TypedDict): + capture_method: NotRequired["Literal['']|Literal['manual']"] + """ + Controls when the funds are captured from the customer's account. + + If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. + + If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. + """ + class UpdateParamsPaymentMethodOptionsBlik(TypedDict): code: NotRequired[str] """ diff --git a/stripe/test_helpers/_confirmation_token_service.py b/stripe/test_helpers/_confirmation_token_service.py index 3483adb7..7774c496 100644 --- a/stripe/test_helpers/_confirmation_token_service.py +++ b/stripe/test_helpers/_confirmation_token_service.py @@ -23,6 +23,9 @@ class ConfirmationTokenService(StripeService): """ If provided, this hash will be used to create a PaymentMethod. """ + payment_method_options: NotRequired[ + "ConfirmationTokenService.CreateParamsPaymentMethodOptions" + ] return_url: NotRequired[str] """ Return URL used to confirm the Intent. @@ -921,6 +924,41 @@ class ConfirmationTokenService(StripeService): class CreateParamsPaymentMethodDataZip(TypedDict): pass + class CreateParamsPaymentMethodOptions(TypedDict): + card: NotRequired[ + "ConfirmationTokenService.CreateParamsPaymentMethodOptionsCard" + ] + + class CreateParamsPaymentMethodOptionsCard(TypedDict): + installments: NotRequired[ + "ConfirmationTokenService.CreateParamsPaymentMethodOptionsCardInstallments" + ] + """ + Installment configuration for payments attempted on this PaymentIntent. + """ + + class CreateParamsPaymentMethodOptionsCardInstallments(TypedDict): + plan: "ConfirmationTokenService.CreateParamsPaymentMethodOptionsCardInstallmentsPlan" + """ + The selected installment plan to use for this payment attempt. + This parameter can only be provided during confirmation. + """ + + class CreateParamsPaymentMethodOptionsCardInstallmentsPlan(TypedDict): + count: NotRequired[int] + """ + For `fixed_count` installment plans, this is required. It represents the number of installment payments your customer will make to their credit card. + """ + interval: NotRequired[Literal["month"]] + """ + 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`. + """ + type: Literal["fixed_count"] + """ + Type of installment plan, one of `fixed_count`. + """ + class CreateParamsShipping(TypedDict): address: "ConfirmationTokenService.CreateParamsShippingAddress" """ |