diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5e1080937..f59e56c82 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,10 +28,12 @@ jobs: permissions: contents: read steps: - - uses: extractions/setup-just@v2 - - uses: actions/checkout@v3 + - uses: extractions/setup-just@53165ef7e734c5c07cb06b3c8e7b647c5aa16db3 # v4.0.0 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false - name: Set up Python 3 - uses: actions/setup-python@v4 + uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 with: python-version: "3.13" - name: check examples w/ mypy (against python@3.13) @@ -55,11 +57,13 @@ jobs: permissions: contents: read steps: - - uses: extractions/setup-just@v2 - - uses: actions/checkout@v3 + - uses: extractions/setup-just@53165ef7e734c5c07cb06b3c8e7b647c5aa16db3 # v4.0.0 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false - name: Set up Python 3 - uses: actions/setup-python@v4 + uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 with: python-version: "3.10" @@ -68,7 +72,7 @@ jobs: just build - name: "Upload Artifact" - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: name: dist path: dist/ @@ -101,10 +105,12 @@ jobs: # use any modern-ish version python_version: "3.14" steps: - - uses: extractions/setup-just@v2 - - uses: actions/checkout@v3 + - uses: extractions/setup-just@53165ef7e734c5c07cb06b3c8e7b647c5aa16db3 # v4.0.0 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false - name: Set up Python ${{ matrix.python_version }} - uses: actions/setup-python@v4 + uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 with: python-version: ${{ matrix.python_version }} - uses: stripe/openapi/actions/stripe-mock@master @@ -128,12 +134,15 @@ jobs: id-token: write steps: - name: Download all workflow run artifacts - uses: actions/download-artifact@v4 + # v8 errors on an artifact digest mismatch; v4 only warned. A mismatch + # means the artifact `test` gated on isn't the one reaching PyPI, so + # failing is right — set `digest-mismatch: warn` if it ever misfires. + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: name: dist path: dist - name: Publish packages to PyPI - uses: pypa/gh-action-pypi-publish@release/v1 + uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # v1.14.2 with: packages-dir: dist/ - uses: stripe/openapi/actions/notify-release@master diff --git a/.github/workflows/zizmor.yml b/.github/workflows/zizmor.yml new file mode 100644 index 000000000..b9b202bee --- /dev/null +++ b/.github/workflows/zizmor.yml @@ -0,0 +1,21 @@ +on: [push, pull_request] +name: Workflow security + +permissions: {} + +jobs: + zizmor: + name: zizmor + runs-on: ubuntu-latest + permissions: + contents: read + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + - uses: zizmorcore/zizmor-action@3dc1ecc9bcb9e94e9b2c709687979e1298497054 # v0.6.2 + with: + advanced-security: false + annotations: true + min-severity: high + version: 1.29.0 diff --git a/.github/zizmor.yml b/.github/zizmor.yml new file mode 100644 index 000000000..25cd8201c --- /dev/null +++ b/.github/zizmor.yml @@ -0,0 +1,8 @@ +# Actions under the stripe namespace are unpinned on purpose. +# This is deliberately scoped to that namespace so that other actions +# still require a full commit hash. +rules: + unpinned-uses: + config: + policies: + "stripe/openapi/*": ref-pin diff --git a/CHANGELOG.md b/CHANGELOG.md index 6c48680bd..109e36584 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -36,6 +36,41 @@ This release changes the pinned API version to 2026-08-26.preview. * Add support for new value `blik_recurring_payments` on enum `EventsV2CoreAccountIncludingConfigurationMerchantCapabilityStatusUpdatedEvent.updated_capability` * [#1880](https://github.com/stripe/stripe-python/pull/1880) Add non-verified manged handlers +## 15.6.0 - 2026-08-26 +This release changes the pinned API version to 2026-08-26.dahlia. + +* [#1881](https://github.com/stripe/stripe-python/pull/1881) Add new `EventNotificationHandler` class for better thin event management + + - We've been putting a lot of time into rethinking the event handling experience in the SDKs. This new class is the culmination [of that effort](https://stripe.dev/blog/event-notification-handlers-thin-events). + - They're designed for a tight coupling with both `StripeClient` and the fully-typed nature of [thin events](https://docs.stripe.com/event-destinations#thin-events). This delivers painless event destination upgrades, in-editor checks for common mistakes, and better code modularity. + - Now that we've released [thin event notifications for v1 objects](https://docs.stripe.com/changelog#2026-08-26.dahlia), these new handlers are our recommended path for all integrations using thin event notifications. + - See more detailed docs here: https://docs.stripe.com/webhooks/event-notification-handlers + - As part of this work, we've widened some of the types our webhook-related methods take so they play more nicely with the types commonly returned by popular web frameworks ([#1888](https://github.com/stripe/stripe-python/pull/1888)) + +* [#1876](https://github.com/stripe/stripe-python/pull/1876) Update generated code + * Add support for new resource `billing.FeedbackOption` + * Add support for `create`, `deactivate`, `list`, `modify`, and `retrieve` methods on resource `billing.FeedbackOption` + * Add support for `payment_method_settings` on `AccountSession.Component` and `AccountSessionCreateParamsComponent` + * Add support for `feedback_options` on `BillingPortal.Configuration.Feature.SubscriptionCancel.CancellationReason`, `billing_portal.ConfigurationCreateParamsFeatureSubscriptionCancelCancellationReason`, and `billing_portal.ConfigurationModifyParamsFeatureSubscriptionCancelCancellationReason` + * Add support for new value `customer_update` on enums `BillingPortal.Session.Flow.type` and `billing_portal.SessionCreateParamsFlowDatum.type` + * Add support for `customer_update` on `BillingPortal.Session.Flow` + * Add support for `funding_source_group` on `Charge.PaymentMethodDetail.Card.Wallet.Link` and `Charge.PaymentMethodDetail.Link` + * Add support for `funding_types_blocked` on `Checkout.Session.PaymentMethodOption.Card.Restriction` and `checkout.SessionCreateParamsPaymentMethodOptionCardRestriction` + * Add support for `metadata` on `ConfirmationToken` + * Add support for `active_entitlements` and `customer_portal` on `CustomerSession.Component` and `CustomerSessionCreateParamsComponent` + * Add support for `country` on `FinancialConnections.Session.Filter` + * Add support for `frozen_fields` on `InvoiceItem` + * Add support for `billie` on `Invoice.PaymentSetting.PaymentMethodOption`, `InvoiceCreateParamsPaymentSettingPaymentMethodOption`, `InvoiceModifyParamsPaymentSettingPaymentMethodOption`, `Subscription.PaymentSetting.PaymentMethodOption`, `SubscriptionCreateParamsPaymentSettingPaymentMethodOption`, and `SubscriptionModifyParamsPaymentSettingPaymentMethodOption` + * Add support for new value `billie` on enums `Invoice.PaymentSetting.payment_method_types`, `InvoiceCreateParamsPaymentSetting.payment_method_types`, `InvoiceModifyParamsPaymentSetting.payment_method_types`, `Subscription.PaymentSetting.payment_method_types`, `SubscriptionCreateParamsPaymentSetting.payment_method_types`, and `SubscriptionModifyParamsPaymentSetting.payment_method_types` + * ⚠️ Remove support for `cryptogram` on `PaymentAttemptRecord.PaymentMethodDetail.Card.ThreeDSecure` and `PaymentRecord.PaymentMethodDetail.Card.ThreeDSecure` + * Add support for new value `touch_n_go` on enums `PaymentIntent.allowed_payment_method_types`, `PaymentIntentConfirmParams.allowed_payment_method_types`, `PaymentIntentCreateParams.allowed_payment_method_types`, `PaymentIntentModifyParams.allowed_payment_method_types`, `SetupIntent.allowed_payment_method_types`, `SetupIntentConfirmParams.allowed_payment_method_types`, `SetupIntentCreateParams.allowed_payment_method_types`, and `SetupIntentModifyParams.allowed_payment_method_types` + * Change `PaymentIntent.allowed_payment_method_types` and `SetupIntent.allowed_payment_method_types` to be required + * Add support for `application_fee_amount`, `application_fee_percent`, `on_behalf_of`, and `transfer_data` on `PaymentLinkModifyParams` + * Add support for `feedback_option` on `Subscription.CancellationDetail`, `SubscriptionCancelParamsCancellationDetail`, and `SubscriptionModifyParamsCancellationDetail` + * Add support for `igic` on `Tax.Registration.CountryOption.At`, `Tax.Registration.CountryOption.Be`, `Tax.Registration.CountryOption.Bg`, `Tax.Registration.CountryOption.Cy`, `Tax.Registration.CountryOption.Cz`, `Tax.Registration.CountryOption.De`, `Tax.Registration.CountryOption.Dk`, `Tax.Registration.CountryOption.E`, `Tax.Registration.CountryOption.Ee`, `Tax.Registration.CountryOption.Fi`, `Tax.Registration.CountryOption.Fr`, `Tax.Registration.CountryOption.Gr`, `Tax.Registration.CountryOption.Hr`, `Tax.Registration.CountryOption.Hu`, `Tax.Registration.CountryOption.Ie`, `Tax.Registration.CountryOption.It`, `Tax.Registration.CountryOption.Lt`, `Tax.Registration.CountryOption.Lu`, `Tax.Registration.CountryOption.Lv`, `Tax.Registration.CountryOption.Mt`, `Tax.Registration.CountryOption.Nl`, `Tax.Registration.CountryOption.Pl`, `Tax.Registration.CountryOption.Pt`, `Tax.Registration.CountryOption.Ro`, `Tax.Registration.CountryOption.Se`, `Tax.Registration.CountryOption.Si`, `Tax.Registration.CountryOption.Sk`, `tax.RegistrationCreateParamsCountryOptionAt`, `tax.RegistrationCreateParamsCountryOptionBe`, `tax.RegistrationCreateParamsCountryOptionBg`, `tax.RegistrationCreateParamsCountryOptionCy`, `tax.RegistrationCreateParamsCountryOptionCz`, `tax.RegistrationCreateParamsCountryOptionDe`, `tax.RegistrationCreateParamsCountryOptionDk`, `tax.RegistrationCreateParamsCountryOptionE`, `tax.RegistrationCreateParamsCountryOptionEe`, `tax.RegistrationCreateParamsCountryOptionFi`, `tax.RegistrationCreateParamsCountryOptionFr`, `tax.RegistrationCreateParamsCountryOptionGr`, `tax.RegistrationCreateParamsCountryOptionHr`, `tax.RegistrationCreateParamsCountryOptionHu`, `tax.RegistrationCreateParamsCountryOptionIe`, `tax.RegistrationCreateParamsCountryOptionIt`, `tax.RegistrationCreateParamsCountryOptionLt`, `tax.RegistrationCreateParamsCountryOptionLu`, `tax.RegistrationCreateParamsCountryOptionLv`, `tax.RegistrationCreateParamsCountryOptionMt`, `tax.RegistrationCreateParamsCountryOptionNl`, `tax.RegistrationCreateParamsCountryOptionPl`, `tax.RegistrationCreateParamsCountryOptionPt`, `tax.RegistrationCreateParamsCountryOptionRo`, `tax.RegistrationCreateParamsCountryOptionSe`, `tax.RegistrationCreateParamsCountryOptionSi`, and `tax.RegistrationCreateParamsCountryOptionSk` + * Add support for new value `2026-08-26.dahlia` on enum `WebhookEndpointCreateParams.api_version` + * Add support for error codes `authentication_failure`, `capability_not_active`, `expired_payment_method`, `incorrect_postal_code`, `invalid_canceled_subscription_fields`, and `payment_method_restricted` on `Invoice.LastFinalizationError`, `PaymentIntent.LastPaymentError`, `SetupAttempt.SetupError`, `SetupIntent.LastSetupError`, `StripeError`, and `Terminal.Reader.Action.ApiError` + ## 15.6.0a2 - 2026-08-19 * [#1875](https://github.com/stripe/stripe-python/pull/1875) Update generated code for private-preview * Add support for new resources `PaymentPlan` and `billing.FeedbackOption` diff --git a/CODEGEN_VERSION b/CODEGEN_VERSION index 308945cbf..d48c9e4d1 100644 --- a/CODEGEN_VERSION +++ b/CODEGEN_VERSION @@ -1 +1 @@ -baff58c9d515cdd5f5c3231d101989d588788c6f \ No newline at end of file +a048e64d0832201fc86c45de6f10db62ee780bef \ No newline at end of file diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 28d67d2bf..02d7b3616 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v2442 \ No newline at end of file +v2458 \ No newline at end of file diff --git a/README.md b/README.md index f6929e52c..8b40fd997 100644 --- a/README.md +++ b/README.md @@ -293,6 +293,17 @@ sends by default. If you are overriding `stripe.api_version` / `stripe_version` [webhook endpoint](https://stripe.com/docs/webhooks#api-versions) tied to an older version, be aware that the data you see at runtime may not match the types. +### Open and Closed Enums + +Many of Stripe API enums are open, meaning Stripe may add new values even on older API versions. +To reflect this, open enum fields are typed as `Union[Literal[...], str]` rather than a plain `Literal[...]`. +This ensures the field has the correct type for both values known at SDK release time and other values that may be added later. + +A small number of enums are closed, meaning Stripe guarantees no new values will be added without an API version change. + +Refer to the [API Reference](https://docs.stripe.com) for the latest set of allowed values. + + ### Public Preview SDKs Stripe has features in the [public preview phase](https://docs.stripe.com/release-phases) that can be accessed via versions of this package that have the `bX` suffix like `12.2.0b2`. diff --git a/justfile b/justfile index a56d62314..c9a7a6800 100644 --- a/justfile +++ b/justfile @@ -35,11 +35,11 @@ typecheck: install-test-deps install-dev-deps # ⭐ format all code format: install-dev-deps - ruff format . --quiet + ruff format . > /dev/null # verify formatting, but don't modify files format-check: install-dev-deps - ruff format . --check --quiet + ruff format . --check > /dev/null # remove venv & build artifacts clean: diff --git a/stripe/_account.py b/stripe/_account.py index 9e8fde208..987928f87 100644 --- a/stripe/_account.py +++ b/stripe/_account.py @@ -597,6 +597,12 @@ class Capabilities(StripeObject): """ The status of the SEPA Direct Debits payments capability of the account, or whether the account can directly process SEPA Direct Debits charges. """ + sequra_payments: Optional[ + Union[Literal["active", "inactive", "pending"], str] + ] + """ + The status of the SeQura capability of the account, or whether the account can directly process SeQura payments. + """ shopeepay_payments: Optional[ Union[Literal["active", "inactive", "pending"], str] ] diff --git a/stripe/_account_session.py b/stripe/_account_session.py index 9028c8e2a..68a08f942 100644 --- a/stripe/_account_session.py +++ b/stripe/_account_session.py @@ -157,6 +157,17 @@ class Features(StripeObject): features: Features _inner_class_types = {"features": Features} + class CapitalFinancingManualPayment(StripeObject): + class Features(StripeObject): + pass + + enabled: bool + """ + Whether the embedded component is enabled. + """ + features: Features + _inner_class_types = {"features": Features} + class CapitalFinancingPromotion(StripeObject): class Features(StripeObject): pass @@ -692,6 +703,12 @@ class Features(StripeObject): """ capital_financing: Optional[CapitalFinancing] capital_financing_application: Optional[CapitalFinancingApplication] + capital_financing_manual_payment: Optional[ + CapitalFinancingManualPayment + ] + """ + Configuration for the [Capital financing manual payment](https://docs.stripe.com/connect/supported-embedded-components/capital-financing-manual-payment/) embedded component. + """ capital_financing_promotion: Optional[CapitalFinancingPromotion] check_scanning: Optional[CheckScanning] """ @@ -758,6 +775,7 @@ class Features(StripeObject): "bills": Bills, "capital_financing": CapitalFinancing, "capital_financing_application": CapitalFinancingApplication, + "capital_financing_manual_payment": CapitalFinancingManualPayment, "capital_financing_promotion": CapitalFinancingPromotion, "check_scanning": CheckScanning, "disputes_list": DisputesList, diff --git a/stripe/_api_requestor.py b/stripe/_api_requestor.py index b7c90f80c..912b1a425 100644 --- a/stripe/_api_requestor.py +++ b/stripe/_api_requestor.py @@ -29,6 +29,7 @@ log_debug, log_info, dashboard_link, + validate_path, _convert_to_stripe_object, get_api_mode, ) @@ -658,6 +659,7 @@ def _args_for_request_with_retries( "questions." ) + validate_path(url) abs_url = "%s%s" % ( self._options.base_addresses.get(base_address), url, diff --git a/stripe/_billing_service.py b/stripe/_billing_service.py index e4b3f4ca4..955470c6e 100644 --- a/stripe/_billing_service.py +++ b/stripe/_billing_service.py @@ -14,6 +14,7 @@ CreditBalanceTransactionService, ) from stripe.billing._credit_grant_service import CreditGrantService + from stripe.billing._feedback_option_service import FeedbackOptionService from stripe.billing._meter_event_adjustment_service import ( MeterEventAdjustmentService, ) @@ -35,6 +36,10 @@ "stripe.billing._credit_grant_service", "CreditGrantService", ], + "feedback_options": [ + "stripe.billing._feedback_option_service", + "FeedbackOptionService", + ], "meters": ["stripe.billing._meter_service", "MeterService"], "meter_events": [ "stripe.billing._meter_event_service", @@ -53,6 +58,7 @@ class BillingService(StripeService): credit_balance_summary: "CreditBalanceSummaryService" credit_balance_transactions: "CreditBalanceTransactionService" credit_grants: "CreditGrantService" + feedback_options: "FeedbackOptionService" meters: "MeterService" meter_events: "MeterEventService" meter_event_adjustments: "MeterEventAdjustmentService" diff --git a/stripe/_charge.py b/stripe/_charge.py index b9c3f9db3..d0a51dc36 100644 --- a/stripe/_charge.py +++ b/stripe/_charge.py @@ -642,7 +642,6 @@ class ThreeDSecure(StripeObject): Literal[ "attempt_acknowledged", "authenticated", - "data_share_only", "exempted", "failed", "not_supported", @@ -2299,6 +2298,12 @@ class SepaDebit(StripeObject): Find the ID of the mandate used for this payment under the [payment_method_details.sepa_debit.mandate](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-sepa_debit-mandate) property on the Charge. Use this mandate ID to [retrieve the Mandate](https://docs.stripe.com/api/mandates/retrieve). """ + class Sequra(StripeObject): + transaction_id: Optional[str] + """ + The SeQura transaction ID associated with this payment. + """ + class Shopeepay(StripeObject): pass @@ -2512,6 +2517,7 @@ class Zip(StripeObject): scalapay: Optional[Scalapay] sepa_credit_transfer: Optional[SepaCreditTransfer] sepa_debit: Optional[SepaDebit] + sequra: Optional[Sequra] shopeepay: Optional[Shopeepay] sofort: Optional[Sofort] stripe_account: Optional[StripeAccount] @@ -2589,6 +2595,7 @@ class Zip(StripeObject): "scalapay": Scalapay, "sepa_credit_transfer": SepaCreditTransfer, "sepa_debit": SepaDebit, + "sequra": Sequra, "shopeepay": Shopeepay, "sofort": Sofort, "stripe_account": StripeAccount, diff --git a/stripe/_confirmation_token.py b/stripe/_confirmation_token.py index f34357686..66ac2a19c 100644 --- a/stripe/_confirmation_token.py +++ b/stripe/_confirmation_token.py @@ -2,7 +2,7 @@ # File generated from our OpenAPI spec from stripe._api_resource import APIResource from stripe._expandable_field import ExpandableField -from stripe._stripe_object import StripeObject +from stripe._stripe_object import StripeObject, UntypedStripeObject from stripe._test_helpers import APIResourceTestHelpers from typing import ClassVar, List, Optional, Union, cast from typing_extensions import Literal, Type, Unpack, TYPE_CHECKING @@ -1031,7 +1031,7 @@ class Fpx(StripeObject): """ class GiftCard(StripeObject): - brand: Literal["svs"] + brand: Union[Literal["svs"], str] """ The brand of the gift card. """ @@ -1508,6 +1508,9 @@ class GeneratedFrom(StripeObject): """ _inner_class_types = {"generated_from": GeneratedFrom} + class Sequra(StripeObject): + pass + class Shopeepay(StripeObject): pass @@ -1719,6 +1722,7 @@ class Zip(StripeObject): satispay: Optional[Satispay] scalapay: Optional[Scalapay] sepa_debit: Optional[SepaDebit] + sequra: Optional[Sequra] shopeepay: Optional[Shopeepay] sofort: Optional[Sofort] stripe_balance: Optional[StripeBalance] @@ -1783,6 +1787,7 @@ class Zip(StripeObject): "satispay", "scalapay", "sepa_debit", + "sequra", "shopeepay", "sofort", "stripe_balance", @@ -1862,6 +1867,7 @@ class Zip(StripeObject): "satispay": Satispay, "scalapay": Scalapay, "sepa_debit": SepaDebit, + "sequra": Sequra, "shopeepay": Shopeepay, "sofort": Sofort, "stripe_balance": StripeBalance, @@ -1934,6 +1940,10 @@ class Address(StripeObject): """ Data used for generating a Mandate. """ + metadata: Optional[UntypedStripeObject[str]] + """ + Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + """ object: Literal["confirmation_token"] """ String representing the object's type. Objects of the same type share the same value. diff --git a/stripe/_customer_tax_exemption.py b/stripe/_customer_tax_exemption.py index b3d12cc07..fd5775fd4 100644 --- a/stripe/_customer_tax_exemption.py +++ b/stripe/_customer_tax_exemption.py @@ -32,8 +32,17 @@ class Us(StripeObject): ca: Optional[Ca] country: str + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ created: int + """ + Time at which the object was created. Measured in seconds since the Unix epoch. + """ customer: str + """ + ID of the customer this tax exemption belongs to. + """ deleted: Optional[bool] """ Present and true when the exemption has been deleted. @@ -47,7 +56,16 @@ class Us(StripeObject): ISO 8601 date (YYYY-MM-DD) when the exemption expires. """ id: str + """ + Unique identifier for the object. + """ livemode: bool + """ + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. + """ object: Literal["customer_tax_exemption"] + """ + String representing the object's type. Objects of the same type share the same value. + """ us: Optional[Us] _inner_class_types = {"ca": Ca, "us": Us} diff --git a/stripe/_discount.py b/stripe/_discount.py index bb8118689..f69445fc1 100644 --- a/stripe/_discount.py +++ b/stripe/_discount.py @@ -2,7 +2,7 @@ # File generated from our OpenAPI spec from stripe._expandable_field import ExpandableField from stripe._stripe_object import StripeObject -from typing import ClassVar, Optional +from typing import ClassVar, Optional, Union from typing_extensions import Literal, TYPE_CHECKING if TYPE_CHECKING: @@ -36,7 +36,7 @@ class Source(StripeObject): """ The coupon that was redeemed to create this discount. """ - type: Literal["coupon"] + type: Union[Literal["coupon"], str] """ The source type of the discount. """ diff --git a/stripe/_gift_card.py b/stripe/_gift_card.py index 29798326b..934b92879 100644 --- a/stripe/_gift_card.py +++ b/stripe/_gift_card.py @@ -3,7 +3,7 @@ from stripe._createable_api_resource import CreateableAPIResource from stripe._expandable_field import ExpandableField from stripe._util import class_method_variant, sanitize_id -from typing import ClassVar, Optional, cast, overload +from typing import ClassVar, Optional, Union, cast, overload from typing_extensions import Literal, Unpack, TYPE_CHECKING if TYPE_CHECKING: @@ -27,7 +27,7 @@ class GiftCard(CreateableAPIResource["GiftCard"]): """ OBJECT_NAME: ClassVar[Literal["gift_card"]] = "gift_card" - brand: Literal["svs"] + brand: Union[Literal["svs"], str] """ The brand of the gift card. """ diff --git a/stripe/_invoice.py b/stripe/_invoice.py index 2c7480d94..a3ed2ea35 100644 --- a/stripe/_invoice.py +++ b/stripe/_invoice.py @@ -495,6 +495,7 @@ class LastFinalizationError(StripeObject): "api_key_expired", "application_fees_not_allowed", "approval_required", + "authentication_failure", "authentication_required", "balance_insufficient", "balance_invalid_parameter", @@ -507,6 +508,7 @@ class LastFinalizationError(StripeObject): "bank_account_verification_failed", "billing_invalid_mandate", "bitcoin_upgrade_required", + "capability_not_active", "capture_charge_authorization_expired", "capture_unauthorized_payment", "card_decline_rate_limit_exceeded", @@ -531,6 +533,7 @@ class LastFinalizationError(StripeObject): "debit_not_authorized", "email_invalid", "expired_card", + "expired_payment_method", "failed_tax_calculation", "financial_account_balance_does_not_support_currency", "financial_account_capability_not_enabled", @@ -550,6 +553,7 @@ class LastFinalizationError(StripeObject): "incorrect_address", "incorrect_cvc", "incorrect_number", + "incorrect_postal_code", "incorrect_zip", "india_recurring_payment_mandate_canceled", "instant_payouts_config_disabled", @@ -559,6 +563,7 @@ class LastFinalizationError(StripeObject): "insufficient_funds", "intent_invalid_state", "intent_verification_method_missing", + "invalid_canceled_subscription_fields", "invalid_card_type", "invalid_characters", "invalid_charge_amount", @@ -618,6 +623,7 @@ class LastFinalizationError(StripeObject): "payment_method_not_available", "payment_method_provider_decline", "payment_method_provider_timeout", + "payment_method_restricted", "payment_method_unactivated", "payment_method_unexpected_state", "payment_method_unsupported_type", @@ -1338,6 +1344,7 @@ class WechatPay(StripeObject): "sofort", "stripe_balance", "swish", + "truemoney", "twint", "upi", "us_bank_account", diff --git a/stripe/_multipart_data_generator.py b/stripe/_multipart_data_generator.py index 3151df83e..ec91d22b4 100644 --- a/stripe/_multipart_data_generator.py +++ b/stripe/_multipart_data_generator.py @@ -1,13 +1,29 @@ -import random import io +import secrets from stripe._encode import _api_encode +# Number of random bytes used to build the boundary, matching stripe-ruby's +# `SecureRandom.hex(30)` and Go's mime/multipart. This must come from a CSPRNG: +# multipart/form-data is only safe if the delimiter cannot be guessed by anyone +# able to influence the content, since a value containing the delimiter gets +# parsed as additional parts. +BOUNDARY_BYTES = 30 + + +def _escape_header_value(value: str) -> str: + """Make a value safe to interpolate into a part header. + + An unescaped quote would end the quoted-string early, and CR/LF would + introduce additional header lines or parts. + """ + return value.replace('"', "%22").replace("\r", " ").replace("\n", " ") + class MultipartDataGenerator(object): data: io.BytesIO line_break: str - boundary: int + boundary: str chunk_size: int def __init__(self, chunk_size: int = 1028): @@ -36,9 +52,9 @@ def add_params(self, params): filename = str(value.name) self._write('Content-Disposition: form-data; name="') - self._write(key) + self._write(_escape_header_value(key)) self._write('"; filename="') - self._write(filename) + self._write(_escape_header_value(filename)) self._write('"') self._write(self.line_break) self._write("Content-Type: application/octet-stream") @@ -48,7 +64,7 @@ def add_params(self, params): self._write_file(value) else: self._write('Content-Disposition: form-data; name="') - self._write(key) + self._write(_escape_header_value(key)) self._write('"') self._write(self.line_break) self._write(self.line_break) @@ -83,5 +99,5 @@ def _write_file(self, f): break self._write(file_contents) - def _initialize_boundary(self): - return random.randint(0, 2**63) + def _initialize_boundary(self) -> str: + return secrets.token_hex(BOUNDARY_BYTES) diff --git a/stripe/_object_classes.py b/stripe/_object_classes.py index 3f519ff6c..0802932a8 100644 --- a/stripe/_object_classes.py +++ b/stripe/_object_classes.py @@ -339,6 +339,10 @@ "stripe.radar._account_evaluation", "AccountEvaluation", ), + "radar.billing_evaluation": ( + "stripe.radar._billing_evaluation", + "BillingEvaluation", + ), "radar.customer_evaluation": ( "stripe.radar._customer_evaluation", "CustomerEvaluation", diff --git a/stripe/_order.py b/stripe/_order.py index 664497552..75a35b5b4 100644 --- a/stripe/_order.py +++ b/stripe/_order.py @@ -564,7 +564,7 @@ class WechatPay(StripeObject): """ The client type that the end customer will pay from """ - setup_future_usage: Optional[Literal["none"]] + setup_future_usage: Optional[Union[Literal["none"], str]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. diff --git a/stripe/_payment_attempt_record.py b/stripe/_payment_attempt_record.py index 3bebc49c6..267f21507 100644 --- a/stripe/_payment_attempt_record.py +++ b/stripe/_payment_attempt_record.py @@ -305,7 +305,7 @@ class Card(StripeObject): """ card: Optional[Card] - type: Optional[Literal["card"]] + type: Optional[Union[Literal["card"], str]] """ funding type of the underlying payment method. """ @@ -560,7 +560,6 @@ class ThreeDSecure(StripeObject): Literal[ "attempt_acknowledged", "authenticated", - "data_share_only", "exempted", "failed", "not_supported", @@ -1941,7 +1940,7 @@ class Card(StripeObject): """ card: Optional[Card] - type: Optional[Literal["card"]] + type: Optional[Union[Literal["card"], str]] """ Funding type of the underlying payment method. """ @@ -2020,6 +2019,12 @@ class SepaDebit(StripeObject): Find the ID of the mandate used for this payment under the [payment_method_details.sepa_debit.mandate](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-sepa_debit-mandate) property on the Charge. Use this mandate ID to [retrieve the Mandate](https://docs.stripe.com/api/mandates/retrieve). """ + class Sequra(StripeObject): + transaction_id: Optional[str] + """ + The SeQura transaction ID associated with this payment. + """ + class Shopeepay(StripeObject): pass @@ -2248,6 +2253,7 @@ class Zip(StripeObject): scalapay: Optional[Scalapay] sepa_credit_transfer: Optional[SepaCreditTransfer] sepa_debit: Optional[SepaDebit] + sequra: Optional[Sequra] shopeepay: Optional[Shopeepay] sofort: Optional[Sofort] stripe_account: Optional[StripeAccount] @@ -2327,6 +2333,7 @@ class Zip(StripeObject): "scalapay": Scalapay, "sepa_credit_transfer": SepaCreditTransfer, "sepa_debit": SepaDebit, + "sequra": Sequra, "shopeepay": Shopeepay, "sofort": Sofort, "stripe_account": StripeAccount, diff --git a/stripe/_payment_intent.py b/stripe/_payment_intent.py index 561161eca..d98159fcd 100644 --- a/stripe/_payment_intent.py +++ b/stripe/_payment_intent.py @@ -347,6 +347,7 @@ class LastPaymentError(StripeObject): "api_key_expired", "application_fees_not_allowed", "approval_required", + "authentication_failure", "authentication_required", "balance_insufficient", "balance_invalid_parameter", @@ -359,6 +360,7 @@ class LastPaymentError(StripeObject): "bank_account_verification_failed", "billing_invalid_mandate", "bitcoin_upgrade_required", + "capability_not_active", "capture_charge_authorization_expired", "capture_unauthorized_payment", "card_decline_rate_limit_exceeded", @@ -383,6 +385,7 @@ class LastPaymentError(StripeObject): "debit_not_authorized", "email_invalid", "expired_card", + "expired_payment_method", "failed_tax_calculation", "financial_account_balance_does_not_support_currency", "financial_account_capability_not_enabled", @@ -402,6 +405,7 @@ class LastPaymentError(StripeObject): "incorrect_address", "incorrect_cvc", "incorrect_number", + "incorrect_postal_code", "incorrect_zip", "india_recurring_payment_mandate_canceled", "instant_payouts_config_disabled", @@ -411,6 +415,7 @@ class LastPaymentError(StripeObject): "insufficient_funds", "intent_invalid_state", "intent_verification_method_missing", + "invalid_canceled_subscription_fields", "invalid_card_type", "invalid_characters", "invalid_charge_amount", @@ -470,6 +475,7 @@ class LastPaymentError(StripeObject): "payment_method_not_available", "payment_method_provider_decline", "payment_method_provider_timeout", + "payment_method_restricted", "payment_method_unactivated", "payment_method_unexpected_state", "payment_method_unsupported_type", @@ -3578,6 +3584,9 @@ class MandateOptions(StripeObject): """ Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. """ + verification_method: Optional[ + Literal["automatic", "payer_name_verification"] + ] _inner_class_types = {"mandate_options": MandateOptions} class Bancontact(StripeObject): @@ -4954,6 +4963,22 @@ class MandateOptions(StripeObject): """ _inner_class_types = {"mandate_options": MandateOptions} + class Sequra(StripeObject): + capture_method: Optional[Literal["manual"]] + """ + Controls when the funds will be captured from the customer's account. + """ + setup_future_usage: Optional[Literal["none"]] + """ + Indicates that you intend to make future payments with this PaymentIntent's payment method. + + If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](https://docs.stripe.com/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](https://docs.stripe.com/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + + If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + + When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](https://docs.stripe.com/strong-customer-authentication). + """ + class Shopeepay(StripeObject): setup_future_usage: Optional[Literal["none"]] """ @@ -5231,7 +5256,7 @@ class WechatPay(StripeObject): """ The client type that the end customer will pay from """ - setup_future_usage: Optional[Literal["none"]] + setup_future_usage: Optional[Union[Literal["none"], str]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -5308,6 +5333,7 @@ class Zip(StripeObject): satispay: Optional[Satispay] scalapay: Optional[Scalapay] sepa_debit: Optional[SepaDebit] + sequra: Optional[Sequra] shopeepay: Optional[Shopeepay] sofort: Optional[Sofort] stripe_balance: Optional[StripeBalance] @@ -5374,6 +5400,7 @@ class Zip(StripeObject): "satispay": Satispay, "scalapay": Scalapay, "sepa_debit": SepaDebit, + "sequra": Sequra, "shopeepay": Shopeepay, "sofort": Sofort, "stripe_balance": StripeBalance, @@ -5611,6 +5638,7 @@ class PaymentData(StripeObject): "swish", "tamara", "test_pay", + "touch_n_go", "truemoney", "twint", "upi", @@ -5777,6 +5805,7 @@ class PaymentData(StripeObject): "satispay", "scalapay", "sepa_debit", + "sequra", "shopeepay", "sofort", "stripe_balance", diff --git a/stripe/_payment_location_capability.py b/stripe/_payment_location_capability.py index e0b398d6a..b671437cc 100644 --- a/stripe/_payment_location_capability.py +++ b/stripe/_payment_location_capability.py @@ -79,7 +79,7 @@ class Error(StripeObject): """ The account that the capability enables functionality for. """ - capability: Literal["fr_meal_vouchers_conecs_payments"] + capability: Union[Literal["fr_meal_vouchers_conecs_payments"], str] """ The identifier for the capability. """ diff --git a/stripe/_payment_method.py b/stripe/_payment_method.py index 5230f5b57..0038cf280 100644 --- a/stripe/_payment_method.py +++ b/stripe/_payment_method.py @@ -1010,7 +1010,7 @@ class Fpx(StripeObject): """ class GiftCard(StripeObject): - brand: Literal["svs"] + brand: Union[Literal["svs"], str] """ The brand of the gift card. """ @@ -1811,6 +1811,7 @@ class Zip(StripeObject): "satispay", "scalapay", "sepa_debit", + "sequra", "shopeepay", "sofort", "stripe_balance", diff --git a/stripe/_payment_record.py b/stripe/_payment_record.py index d71c658e3..5adb48384 100644 --- a/stripe/_payment_record.py +++ b/stripe/_payment_record.py @@ -320,7 +320,7 @@ class Card(StripeObject): """ card: Optional[Card] - type: Optional[Literal["card"]] + type: Optional[Union[Literal["card"], str]] """ funding type of the underlying payment method. """ @@ -575,7 +575,6 @@ class ThreeDSecure(StripeObject): Literal[ "attempt_acknowledged", "authenticated", - "data_share_only", "exempted", "failed", "not_supported", @@ -1956,7 +1955,7 @@ class Card(StripeObject): """ card: Optional[Card] - type: Optional[Literal["card"]] + type: Optional[Union[Literal["card"], str]] """ Funding type of the underlying payment method. """ @@ -2035,6 +2034,12 @@ class SepaDebit(StripeObject): Find the ID of the mandate used for this payment under the [payment_method_details.sepa_debit.mandate](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-sepa_debit-mandate) property on the Charge. Use this mandate ID to [retrieve the Mandate](https://docs.stripe.com/api/mandates/retrieve). """ + class Sequra(StripeObject): + transaction_id: Optional[str] + """ + The SeQura transaction ID associated with this payment. + """ + class Shopeepay(StripeObject): pass @@ -2263,6 +2268,7 @@ class Zip(StripeObject): scalapay: Optional[Scalapay] sepa_credit_transfer: Optional[SepaCreditTransfer] sepa_debit: Optional[SepaDebit] + sequra: Optional[Sequra] shopeepay: Optional[Shopeepay] sofort: Optional[Sofort] stripe_account: Optional[StripeAccount] @@ -2342,6 +2348,7 @@ class Zip(StripeObject): "scalapay": Scalapay, "sepa_credit_transfer": SepaCreditTransfer, "sepa_debit": SepaDebit, + "sequra": Sequra, "shopeepay": Shopeepay, "sofort": Sofort, "stripe_account": StripeAccount, diff --git a/stripe/_quote_preview_invoice.py b/stripe/_quote_preview_invoice.py index 1ddd446e0..d28743e75 100644 --- a/stripe/_quote_preview_invoice.py +++ b/stripe/_quote_preview_invoice.py @@ -450,6 +450,7 @@ class LastFinalizationError(StripeObject): "api_key_expired", "application_fees_not_allowed", "approval_required", + "authentication_failure", "authentication_required", "balance_insufficient", "balance_invalid_parameter", @@ -462,6 +463,7 @@ class LastFinalizationError(StripeObject): "bank_account_verification_failed", "billing_invalid_mandate", "bitcoin_upgrade_required", + "capability_not_active", "capture_charge_authorization_expired", "capture_unauthorized_payment", "card_decline_rate_limit_exceeded", @@ -486,6 +488,7 @@ class LastFinalizationError(StripeObject): "debit_not_authorized", "email_invalid", "expired_card", + "expired_payment_method", "failed_tax_calculation", "financial_account_balance_does_not_support_currency", "financial_account_capability_not_enabled", @@ -505,6 +508,7 @@ class LastFinalizationError(StripeObject): "incorrect_address", "incorrect_cvc", "incorrect_number", + "incorrect_postal_code", "incorrect_zip", "india_recurring_payment_mandate_canceled", "instant_payouts_config_disabled", @@ -514,6 +518,7 @@ class LastFinalizationError(StripeObject): "insufficient_funds", "intent_invalid_state", "intent_verification_method_missing", + "invalid_canceled_subscription_fields", "invalid_card_type", "invalid_characters", "invalid_charge_amount", @@ -573,6 +578,7 @@ class LastFinalizationError(StripeObject): "payment_method_not_available", "payment_method_provider_decline", "payment_method_provider_timeout", + "payment_method_restricted", "payment_method_unactivated", "payment_method_unexpected_state", "payment_method_unsupported_type", @@ -1293,6 +1299,7 @@ class WechatPay(StripeObject): "sofort", "stripe_balance", "swish", + "truemoney", "twint", "upi", "us_bank_account", diff --git a/stripe/_quote_preview_subscription_schedule.py b/stripe/_quote_preview_subscription_schedule.py index 101029612..63958ebe7 100644 --- a/stripe/_quote_preview_subscription_schedule.py +++ b/stripe/_quote_preview_subscription_schedule.py @@ -330,7 +330,7 @@ class UnusedTimeFrom(StripeObject): """ Determines how to handle debits and credits when pausing. """ - type: Literal["subscription"] + type: Union[Literal["subscription"], str] """ The type of pause settings. """ diff --git a/stripe/_radar_service.py b/stripe/_radar_service.py index d14f26d37..556ed7456 100644 --- a/stripe/_radar_service.py +++ b/stripe/_radar_service.py @@ -8,6 +8,9 @@ from stripe.radar._account_evaluation_service import ( AccountEvaluationService, ) + from stripe.radar._billing_evaluation_service import ( + BillingEvaluationService, + ) from stripe.radar._customer_evaluation_service import ( CustomerEvaluationService, ) @@ -28,6 +31,10 @@ "stripe.radar._account_evaluation_service", "AccountEvaluationService", ], + "billing_evaluations": [ + "stripe.radar._billing_evaluation_service", + "BillingEvaluationService", + ], "customer_evaluations": [ "stripe.radar._customer_evaluation_service", "CustomerEvaluationService", @@ -54,6 +61,7 @@ class RadarService(StripeService): account_evaluations: "AccountEvaluationService" + billing_evaluations: "BillingEvaluationService" customer_evaluations: "CustomerEvaluationService" early_fraud_warnings: "EarlyFraudWarningService" issuing_authorization_evaluations: "IssuingAuthorizationEvaluationService" diff --git a/stripe/_setup_attempt.py b/stripe/_setup_attempt.py index e7fd40753..86070d056 100644 --- a/stripe/_setup_attempt.py +++ b/stripe/_setup_attempt.py @@ -121,7 +121,6 @@ class ThreeDSecure(StripeObject): Literal[ "attempt_acknowledged", "authenticated", - "data_share_only", "exempted", "failed", "not_supported", @@ -564,6 +563,7 @@ class SetupError(StripeObject): "api_key_expired", "application_fees_not_allowed", "approval_required", + "authentication_failure", "authentication_required", "balance_insufficient", "balance_invalid_parameter", @@ -576,6 +576,7 @@ class SetupError(StripeObject): "bank_account_verification_failed", "billing_invalid_mandate", "bitcoin_upgrade_required", + "capability_not_active", "capture_charge_authorization_expired", "capture_unauthorized_payment", "card_decline_rate_limit_exceeded", @@ -600,6 +601,7 @@ class SetupError(StripeObject): "debit_not_authorized", "email_invalid", "expired_card", + "expired_payment_method", "failed_tax_calculation", "financial_account_balance_does_not_support_currency", "financial_account_capability_not_enabled", @@ -619,6 +621,7 @@ class SetupError(StripeObject): "incorrect_address", "incorrect_cvc", "incorrect_number", + "incorrect_postal_code", "incorrect_zip", "india_recurring_payment_mandate_canceled", "instant_payouts_config_disabled", @@ -628,6 +631,7 @@ class SetupError(StripeObject): "insufficient_funds", "intent_invalid_state", "intent_verification_method_missing", + "invalid_canceled_subscription_fields", "invalid_card_type", "invalid_characters", "invalid_charge_amount", @@ -687,6 +691,7 @@ class SetupError(StripeObject): "payment_method_not_available", "payment_method_provider_decline", "payment_method_provider_timeout", + "payment_method_restricted", "payment_method_unactivated", "payment_method_unexpected_state", "payment_method_unsupported_type", diff --git a/stripe/_setup_intent.py b/stripe/_setup_intent.py index 433f800ab..f6b5a8e11 100644 --- a/stripe/_setup_intent.py +++ b/stripe/_setup_intent.py @@ -114,6 +114,7 @@ class LastSetupError(StripeObject): "api_key_expired", "application_fees_not_allowed", "approval_required", + "authentication_failure", "authentication_required", "balance_insufficient", "balance_invalid_parameter", @@ -126,6 +127,7 @@ class LastSetupError(StripeObject): "bank_account_verification_failed", "billing_invalid_mandate", "bitcoin_upgrade_required", + "capability_not_active", "capture_charge_authorization_expired", "capture_unauthorized_payment", "card_decline_rate_limit_exceeded", @@ -150,6 +152,7 @@ class LastSetupError(StripeObject): "debit_not_authorized", "email_invalid", "expired_card", + "expired_payment_method", "failed_tax_calculation", "financial_account_balance_does_not_support_currency", "financial_account_capability_not_enabled", @@ -169,6 +172,7 @@ class LastSetupError(StripeObject): "incorrect_address", "incorrect_cvc", "incorrect_number", + "incorrect_postal_code", "incorrect_zip", "india_recurring_payment_mandate_canceled", "instant_payouts_config_disabled", @@ -178,6 +182,7 @@ class LastSetupError(StripeObject): "insufficient_funds", "intent_invalid_state", "intent_verification_method_missing", + "invalid_canceled_subscription_fields", "invalid_card_type", "invalid_characters", "invalid_charge_amount", @@ -237,6 +242,7 @@ class LastSetupError(StripeObject): "payment_method_not_available", "payment_method_provider_decline", "payment_method_provider_timeout", + "payment_method_restricted", "payment_method_unactivated", "payment_method_unexpected_state", "payment_method_unsupported_type", @@ -609,6 +615,9 @@ class MandateOptions(StripeObject): """ mandate_options: Optional[MandateOptions] + verification_method: Optional[ + Literal["automatic", "payer_name_verification"] + ] _inner_class_types = {"mandate_options": MandateOptions} class Bizum(StripeObject): @@ -1123,6 +1132,7 @@ class FrMealVoucher(StripeObject): "swish", "tamara", "test_pay", + "touch_n_go", "truemoney", "twint", "upi", @@ -1241,6 +1251,7 @@ class FrMealVoucher(StripeObject): "satispay", "scalapay", "sepa_debit", + "sequra", "shopeepay", "sofort", "stripe_balance", diff --git a/stripe/_stripe_object.py b/stripe/_stripe_object.py index f29bbce42..b37075ab1 100644 --- a/stripe/_stripe_object.py +++ b/stripe/_stripe_object.py @@ -413,7 +413,9 @@ def _refresh_from( for k, v in values.items(): # Apply field encoding coercion (e.g. int64_string: str → int) v = self._coerce_field_value(k, v) - inner_class = self._get_inner_class_type(k) + inner_class = self._get_union_variant_class( + k, v + ) or self._get_inner_class_type(k) is_dict = self._get_inner_class_is_beneath_dict(k) if is_dict: obj = { @@ -682,11 +684,41 @@ def __deepcopy__(self, memo: Dict[int, Any]) -> "StripeObject": _inner_class_dicts: ClassVar[List[str]] = [] _field_encodings: ClassVar[Dict[str, str]] = {} + # Maps a discriminated-union field to (discriminator, {value: class}). Generated + # subclasses override this; every other object keeps the empty default so the + # lookup in _update_attributes stays cheap. + _inner_class_union_variant_types: ClassVar[ + Dict[str, Tuple[str, Dict[str, Type["StripeObject"]]]] + ] = {} + def _get_inner_class_type( self, field_name: str ) -> Optional[Type["StripeObject"]]: return self._inner_class_types.get(field_name) + def _get_union_variant_class( + self, field_name: str, value: Any + ) -> Optional[Type["StripeObject"]]: + """ + Returns the variant class that a discriminated union field's value should + become, based on the discriminator carried in the value itself. + + Returns None rather than raising when the discriminator is absent, is not a + string, or names a variant this version of the SDK does not know about. The + caller then converts without a class, so a variant the API adds after this + release still deserializes instead of blowing up. + """ + union = self._inner_class_union_variant_types.get(field_name) + if union is None or not isinstance(value, dict): + return None + + discriminator, variants = union + discriminator_value = cast(Dict[str, Any], value).get(discriminator) + if not isinstance(discriminator_value, str): + return None + + return variants.get(discriminator_value) + def _get_inner_class_is_beneath_dict(self, field_name: str): return field_name in self._inner_class_dicts diff --git a/stripe/_subscription.py b/stripe/_subscription.py index 4be4a66f9..78833d851 100644 --- a/stripe/_subscription.py +++ b/stripe/_subscription.py @@ -450,7 +450,7 @@ class MandateOptions(StripeObject): """ Amount to be charged for future payments. Required when `amount_type=fixed`. """ - amount_type: Optional[Literal["fixed"]] + amount_type: Optional[Union[Literal["fixed"], str]] """ Indicates the mandate amount type. """ @@ -871,6 +871,7 @@ class WechatPay(StripeObject): "sofort", "stripe_balance", "swish", + "truemoney", "twint", "upi", "us_bank_account", @@ -987,7 +988,7 @@ class Subscription(StripeObject): """ Unix timestamp in seconds of when the subscription status transitioned to `paused`. """ - type: Literal["subscription"] + type: Union[Literal["subscription"], str] """ The type of pause. """ diff --git a/stripe/_subscription_schedule.py b/stripe/_subscription_schedule.py index ec45143cc..f698f8f59 100644 --- a/stripe/_subscription_schedule.py +++ b/stripe/_subscription_schedule.py @@ -352,7 +352,7 @@ class UnusedTimeFrom(StripeObject): """ Determines how to handle debits and credits when pausing. """ - type: Literal["subscription"] + type: Union[Literal["subscription"], str] """ The type of pause settings. """ diff --git a/stripe/_util.py b/stripe/_util.py index 386894080..8b378c63c 100644 --- a/stripe/_util.py +++ b/stripe/_util.py @@ -7,7 +7,7 @@ from stripe._api_mode import ApiMode -from urllib.parse import quote_plus +from urllib.parse import quote_plus, urlsplit from typing_extensions import Type, TYPE_CHECKING from typing import ( @@ -260,8 +260,12 @@ def _convert_to_stripe_object( klass = get_object_class(api_mode, klass_name) # TODO: this is a horrible hack. The API needs # to return something for `object` here. - - elif "data" in resp and "next_page_url" in resp: + # + # Gated on V2: this runs recursively over every nested value, so without + # the mode check any nested map in a v1 payload carrying `data` and + # `next_page_url` becomes an auto-paginating v2 collection. A malicious webhook + # could potentially choose the host of a subsequent authenticated request. + elif api_mode == "V2" and "data" in resp and "next_page_url" in resp: klass = stripe.v2.ListObject elif klass_ is not None: klass = klass_ @@ -346,6 +350,34 @@ def sanitize_id(id): return quotedId +def validate_path(path: str) -> None: + """ + Assert that a request path is origin-relative: that it begins with a single + "/" and carries no scheme, authority or userinfo. + + The absolute URL is built by concatenating a base address onto this path, and + no base address ends in a slash. A path like "@evil.example/v1/x" or + ".evil.example/v1/x" would modify the resulting host and direct the request + (including the API key) to a non-Stripe host. + + Because some relative urls arrive from potentially untrusted sources (like + webhook bodies), we have to be a little defensive. + + So, we require that a path starts with a leading slash and that urlsplit + finds no scheme or authority in it. + """ + if not path.startswith("/") or path.startswith("//"): + raise ValueError( + f'Request path must be a string beginning with a single "/", got: {path!r}' + ) + + parts = urlsplit(path) + if parts.scheme or parts.netloc: + raise ValueError( + f"Request path may not contain a scheme or authority, got: {path!r}" + ) + + def get_api_mode(url: str) -> ApiMode: if url.startswith("/v2"): return "V2" diff --git a/stripe/billing/__init__.py b/stripe/billing/__init__.py index 2e5de879d..179549ea3 100644 --- a/stripe/billing/__init__.py +++ b/stripe/billing/__init__.py @@ -41,6 +41,9 @@ from stripe.billing._feedback_option import ( FeedbackOption as FeedbackOption, ) + from stripe.billing._feedback_option_service import ( + FeedbackOptionService as FeedbackOptionService, + ) from stripe.billing._meter import Meter as Meter from stripe.billing._meter_event import MeterEvent as MeterEvent from stripe.billing._meter_event_adjustment import ( @@ -89,6 +92,10 @@ "CreditGrant": ("stripe.billing._credit_grant", False), "CreditGrantService": ("stripe.billing._credit_grant_service", False), "FeedbackOption": ("stripe.billing._feedback_option", False), + "FeedbackOptionService": ( + "stripe.billing._feedback_option_service", + False, + ), "Meter": ("stripe.billing._meter", False), "MeterEvent": ("stripe.billing._meter_event", False), "MeterEventAdjustment": ("stripe.billing._meter_event_adjustment", False), diff --git a/stripe/billing/_alert.py b/stripe/billing/_alert.py index 231bd8cee..752ba98d1 100644 --- a/stripe/billing/_alert.py +++ b/stripe/billing/_alert.py @@ -216,7 +216,7 @@ class CustomPricingUnitDetails(StripeObject): "custom_pricing_unit": CustomPricingUnit, } - aggregation_period: Literal["billing"] + aggregation_period: Union[Literal["billing"], str] """ Defines the period over which spend is aggregated. """ diff --git a/stripe/billing/_feedback_option.py b/stripe/billing/_feedback_option.py index c656596c3..ebf098a85 100644 --- a/stripe/billing/_feedback_option.py +++ b/stripe/billing/_feedback_option.py @@ -1,13 +1,43 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec +from stripe._createable_api_resource import CreateableAPIResource +from stripe._list_object import ListObject +from stripe._listable_api_resource import ListableAPIResource from stripe._stripe_object import StripeObject -from typing import ClassVar, Optional -from typing_extensions import Literal +from stripe._updateable_api_resource import UpdateableAPIResource +from stripe._util import class_method_variant, sanitize_id +from typing import ClassVar, Optional, cast, overload +from typing_extensions import Literal, Unpack, TYPE_CHECKING + +if TYPE_CHECKING: + from stripe.params.billing._feedback_option_create_params import ( + FeedbackOptionCreateParams, + ) + from stripe.params.billing._feedback_option_deactivate_params import ( + FeedbackOptionDeactivateParams, + ) + from stripe.params.billing._feedback_option_list_params import ( + FeedbackOptionListParams, + ) + from stripe.params.billing._feedback_option_modify_params import ( + FeedbackOptionModifyParams, + ) + from stripe.params.billing._feedback_option_retrieve_params import ( + FeedbackOptionRetrieveParams, + ) -class FeedbackOption(StripeObject): +class FeedbackOption( + CreateableAPIResource["FeedbackOption"], + ListableAPIResource["FeedbackOption"], + UpdateableAPIResource["FeedbackOption"], +): """ - A resource for the feedback options model (for custom cancellation reasons) + A feedback option is a reason you can present to customers when they cancel a + subscription through the customer portal. Configure the set of options a customer + can choose from on a [portal configuration](https://docs.stripe.com/api/customer_portal/configuration). + + Related guide: [Customer management](https://docs.stripe.com/customer-management) """ OBJECT_NAME: ClassVar[Literal["billing.feedback_option"]] = ( @@ -41,4 +71,243 @@ class StatusTransitions(StripeObject): The feedback option's status. """ status_transitions: StatusTransitions + + @classmethod + def create( + cls, **params: Unpack["FeedbackOptionCreateParams"] + ) -> "FeedbackOption": + """ + Creates a new feedback option. + """ + return cast( + "FeedbackOption", + cls._static_request( + "post", + cls.class_url(), + params=params, + ), + ) + + @classmethod + async def create_async( + cls, **params: Unpack["FeedbackOptionCreateParams"] + ) -> "FeedbackOption": + """ + Creates a new feedback option. + """ + return cast( + "FeedbackOption", + await cls._static_request_async( + "post", + cls.class_url(), + params=params, + ), + ) + + @classmethod + def _cls_deactivate( + cls, id: str, **params: Unpack["FeedbackOptionDeactivateParams"] + ) -> "FeedbackOption": + """ + Deactivates a feedback option. Deactivated feedback options cannot be used in portal configurations. + """ + return cast( + "FeedbackOption", + cls._static_request( + "post", + "/v1/billing/feedback_options/{id}/deactivate".format( + id=sanitize_id(id) + ), + params=params, + ), + ) + + @overload + @staticmethod + def deactivate( + id: str, **params: Unpack["FeedbackOptionDeactivateParams"] + ) -> "FeedbackOption": + """ + Deactivates a feedback option. Deactivated feedback options cannot be used in portal configurations. + """ + ... + + @overload + def deactivate( + self, **params: Unpack["FeedbackOptionDeactivateParams"] + ) -> "FeedbackOption": + """ + Deactivates a feedback option. Deactivated feedback options cannot be used in portal configurations. + """ + ... + + @class_method_variant("_cls_deactivate") + def deactivate( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["FeedbackOptionDeactivateParams"] + ) -> "FeedbackOption": + """ + Deactivates a feedback option. Deactivated feedback options cannot be used in portal configurations. + """ + return cast( + "FeedbackOption", + self._request( + "post", + "/v1/billing/feedback_options/{id}/deactivate".format( + id=sanitize_id(self._data.get("id")) + ), + params=params, + ), + ) + + @classmethod + async def _cls_deactivate_async( + cls, id: str, **params: Unpack["FeedbackOptionDeactivateParams"] + ) -> "FeedbackOption": + """ + Deactivates a feedback option. Deactivated feedback options cannot be used in portal configurations. + """ + return cast( + "FeedbackOption", + await cls._static_request_async( + "post", + "/v1/billing/feedback_options/{id}/deactivate".format( + id=sanitize_id(id) + ), + params=params, + ), + ) + + @overload + @staticmethod + async def deactivate_async( + id: str, **params: Unpack["FeedbackOptionDeactivateParams"] + ) -> "FeedbackOption": + """ + Deactivates a feedback option. Deactivated feedback options cannot be used in portal configurations. + """ + ... + + @overload + async def deactivate_async( + self, **params: Unpack["FeedbackOptionDeactivateParams"] + ) -> "FeedbackOption": + """ + Deactivates a feedback option. Deactivated feedback options cannot be used in portal configurations. + """ + ... + + @class_method_variant("_cls_deactivate_async") + async def deactivate_async( # pyright: ignore[reportGeneralTypeIssues] + self, **params: Unpack["FeedbackOptionDeactivateParams"] + ) -> "FeedbackOption": + """ + Deactivates a feedback option. Deactivated feedback options cannot be used in portal configurations. + """ + return cast( + "FeedbackOption", + await self._request_async( + "post", + "/v1/billing/feedback_options/{id}/deactivate".format( + id=sanitize_id(self._data.get("id")) + ), + params=params, + ), + ) + + @classmethod + def list( + cls, **params: Unpack["FeedbackOptionListParams"] + ) -> ListObject["FeedbackOption"]: + """ + Returns a list of your feedback options. + """ + result = cls._static_request( + "get", + cls.class_url(), + params=params, + ) + if not isinstance(result, ListObject): + raise TypeError( + "Expected list object from API, got %s" + % (type(result).__name__) + ) + + return result + + @classmethod + async def list_async( + cls, **params: Unpack["FeedbackOptionListParams"] + ) -> ListObject["FeedbackOption"]: + """ + Returns a list of your feedback options. + """ + result = await cls._static_request_async( + "get", + cls.class_url(), + params=params, + ) + if not isinstance(result, ListObject): + raise TypeError( + "Expected list object from API, got %s" + % (type(result).__name__) + ) + + return result + + @classmethod + def modify( + cls, id: str, **params: Unpack["FeedbackOptionModifyParams"] + ) -> "FeedbackOption": + """ + Updates the description of an existing feedback option. + """ + url = "%s/%s" % (cls.class_url(), sanitize_id(id)) + return cast( + "FeedbackOption", + cls._static_request( + "post", + url, + params=params, + ), + ) + + @classmethod + async def modify_async( + cls, id: str, **params: Unpack["FeedbackOptionModifyParams"] + ) -> "FeedbackOption": + """ + Updates the description of an existing feedback option. + """ + url = "%s/%s" % (cls.class_url(), sanitize_id(id)) + return cast( + "FeedbackOption", + await cls._static_request_async( + "post", + url, + params=params, + ), + ) + + @classmethod + def retrieve( + cls, id: str, **params: Unpack["FeedbackOptionRetrieveParams"] + ) -> "FeedbackOption": + """ + Retrieves a feedback option object given an ID. + """ + instance = cls(id, **params) + instance.refresh() + return instance + + @classmethod + async def retrieve_async( + cls, id: str, **params: Unpack["FeedbackOptionRetrieveParams"] + ) -> "FeedbackOption": + """ + Retrieves a feedback option object given an ID. + """ + instance = cls(id, **params) + await instance.refresh_async() + return instance + _inner_class_types = {"status_transitions": StatusTransitions} diff --git a/stripe/billing/_feedback_option_service.py b/stripe/billing/_feedback_option_service.py new file mode 100644 index 000000000..535ddd813 --- /dev/null +++ b/stripe/billing/_feedback_option_service.py @@ -0,0 +1,228 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_service import StripeService +from stripe._util import sanitize_id +from typing import Optional, cast +from typing_extensions import TYPE_CHECKING + +if TYPE_CHECKING: + from stripe._list_object import ListObject + from stripe._request_options import RequestOptions + from stripe.billing._feedback_option import FeedbackOption + from stripe.params.billing._feedback_option_create_params import ( + FeedbackOptionCreateParams, + ) + from stripe.params.billing._feedback_option_deactivate_params import ( + FeedbackOptionDeactivateParams, + ) + from stripe.params.billing._feedback_option_list_params import ( + FeedbackOptionListParams, + ) + from stripe.params.billing._feedback_option_retrieve_params import ( + FeedbackOptionRetrieveParams, + ) + from stripe.params.billing._feedback_option_update_params import ( + FeedbackOptionUpdateParams, + ) + + +class FeedbackOptionService(StripeService): + def list( + self, + params: Optional["FeedbackOptionListParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "ListObject[FeedbackOption]": + """ + Returns a list of your feedback options. + """ + return cast( + "ListObject[FeedbackOption]", + self._request( + "get", + "/v1/billing/feedback_options", + base_address="api", + params=params, + options=options, + ), + ) + + async def list_async( + self, + params: Optional["FeedbackOptionListParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "ListObject[FeedbackOption]": + """ + Returns a list of your feedback options. + """ + return cast( + "ListObject[FeedbackOption]", + await self._request_async( + "get", + "/v1/billing/feedback_options", + base_address="api", + params=params, + options=options, + ), + ) + + def create( + self, + params: "FeedbackOptionCreateParams", + options: Optional["RequestOptions"] = None, + ) -> "FeedbackOption": + """ + Creates a new feedback option. + """ + return cast( + "FeedbackOption", + self._request( + "post", + "/v1/billing/feedback_options", + base_address="api", + params=params, + options=options, + ), + ) + + async def create_async( + self, + params: "FeedbackOptionCreateParams", + options: Optional["RequestOptions"] = None, + ) -> "FeedbackOption": + """ + Creates a new feedback option. + """ + return cast( + "FeedbackOption", + await self._request_async( + "post", + "/v1/billing/feedback_options", + base_address="api", + params=params, + options=options, + ), + ) + + def retrieve( + self, + id: str, + params: Optional["FeedbackOptionRetrieveParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "FeedbackOption": + """ + Retrieves a feedback option object given an ID. + """ + return cast( + "FeedbackOption", + self._request( + "get", + "/v1/billing/feedback_options/{id}".format(id=sanitize_id(id)), + base_address="api", + params=params, + options=options, + ), + ) + + async def retrieve_async( + self, + id: str, + params: Optional["FeedbackOptionRetrieveParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "FeedbackOption": + """ + Retrieves a feedback option object given an ID. + """ + return cast( + "FeedbackOption", + await self._request_async( + "get", + "/v1/billing/feedback_options/{id}".format(id=sanitize_id(id)), + base_address="api", + params=params, + options=options, + ), + ) + + def update( + self, + id: str, + params: Optional["FeedbackOptionUpdateParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "FeedbackOption": + """ + Updates the description of an existing feedback option. + """ + return cast( + "FeedbackOption", + self._request( + "post", + "/v1/billing/feedback_options/{id}".format(id=sanitize_id(id)), + base_address="api", + params=params, + options=options, + ), + ) + + async def update_async( + self, + id: str, + params: Optional["FeedbackOptionUpdateParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "FeedbackOption": + """ + Updates the description of an existing feedback option. + """ + return cast( + "FeedbackOption", + await self._request_async( + "post", + "/v1/billing/feedback_options/{id}".format(id=sanitize_id(id)), + base_address="api", + params=params, + options=options, + ), + ) + + def deactivate( + self, + id: str, + params: Optional["FeedbackOptionDeactivateParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "FeedbackOption": + """ + Deactivates a feedback option. Deactivated feedback options cannot be used in portal configurations. + """ + return cast( + "FeedbackOption", + self._request( + "post", + "/v1/billing/feedback_options/{id}/deactivate".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def deactivate_async( + self, + id: str, + params: Optional["FeedbackOptionDeactivateParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "FeedbackOption": + """ + Deactivates a feedback option. Deactivated feedback options cannot be used in portal configurations. + """ + return cast( + "FeedbackOption", + await self._request_async( + "post", + "/v1/billing/feedback_options/{id}/deactivate".format( + id=sanitize_id(id), + ), + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/capital/_financing_summary.py b/stripe/capital/_financing_summary.py index b653bc214..ca463dbf4 100644 --- a/stripe/capital/_financing_summary.py +++ b/stripe/capital/_financing_summary.py @@ -59,6 +59,7 @@ class CurrentRepaymentInterval(StripeObject): Literal[ "celtic_us_loan", "fundbox_au_financing", + "fundbox_ca_financing", "youlend_de_financing", "youlend_fr_financing", "youlend_uk_mca", diff --git a/stripe/checkout/_session.py b/stripe/checkout/_session.py index 103003589..fd2a46c9b 100644 --- a/stripe/checkout/_session.py +++ b/stripe/checkout/_session.py @@ -1298,7 +1298,7 @@ class EndBehavior(StripeObject): """ Details on the subscription for this item. """ - type: Literal["subscription"] + type: Union[Literal["subscription"], str] """ The type of the item. """ @@ -1457,7 +1457,7 @@ class AfterpayClearpay(StripeObject): """ class Alipay(StripeObject): - setup_future_usage: Optional[Literal["none"]] + setup_future_usage: Optional[Union[Literal["none"], str]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -1535,7 +1535,9 @@ class MandateOptions(StripeObject): _inner_class_types = {"mandate_options": MandateOptions} class Bancontact(StripeObject): - setup_future_usage: Optional[Literal["none"]] + setup_future_usage: Optional[ + Union[Literal["none", "off_session"], str] + ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -2257,6 +2259,12 @@ class MandateOptions(StripeObject): """ _inner_class_types = {"mandate_options": MandateOptions} + class Sequra(StripeObject): + capture_method: Optional[Literal["manual"]] + """ + Controls when the funds will be captured from the customer's account. + """ + class Sofort(StripeObject): setup_future_usage: Optional[Literal["none"]] """ @@ -2438,7 +2446,7 @@ class WechatPay(StripeObject): """ The client type that the end customer will pay from """ - setup_future_usage: Optional[Literal["none"]] + setup_future_usage: Optional[Union[Literal["none"], str]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -2489,6 +2497,7 @@ class WechatPay(StripeObject): satispay: Optional[Satispay] scalapay: Optional[Scalapay] sepa_debit: Optional[SepaDebit] + sequra: Optional[Sequra] sofort: Optional[Sofort] sunbit: Optional[Sunbit] swish: Optional[Swish] @@ -2537,6 +2546,7 @@ class WechatPay(StripeObject): "satispay": Satispay, "scalapay": Scalapay, "sepa_debit": SepaDebit, + "sequra": Sequra, "sofort": Sofort, "sunbit": Sunbit, "swish": Swish, diff --git a/stripe/delegated_checkout/_requested_session.py b/stripe/delegated_checkout/_requested_session.py index d1f94619a..19fcbfc64 100644 --- a/stripe/delegated_checkout/_requested_session.py +++ b/stripe/delegated_checkout/_requested_session.py @@ -423,7 +423,7 @@ class Disclosure(StripeObject): """ The content type of the disclosure. """ - type: Literal["disclaimer"] + type: Union[Literal["disclaimer"], str] """ The type of disclosure. """ @@ -834,7 +834,7 @@ class Discount(StripeObject): The risk details of the requested session. """ seller_details: SellerDetails - setup_future_usage: Optional[Literal["on_session"]] + setup_future_usage: Optional[Union[Literal["on_session"], str]] """ Whether or not the payment method should be saved for future use. """ diff --git a/stripe/events/_v2_core_account_including_configuration_customer_capability_status_updated_event.py b/stripe/events/_v2_core_account_including_configuration_customer_capability_status_updated_event.py index e15b8704b..ebb479694 100644 --- a/stripe/events/_v2_core_account_including_configuration_customer_capability_status_updated_event.py +++ b/stripe/events/_v2_core_account_including_configuration_customer_capability_status_updated_event.py @@ -5,7 +5,7 @@ from stripe._stripe_response import StripeResponse from stripe._util import get_api_mode from stripe.v2.core._event import Event, EventNotification, RelatedObject -from typing import Any, Dict, Optional, cast +from typing import Any, Dict, Optional, Union, cast from typing_extensions import Literal, TYPE_CHECKING, override if TYPE_CHECKING: @@ -98,7 +98,7 @@ class V2CoreAccountIncludingConfigurationCustomerCapabilityStatusUpdatedEvent( class V2CoreAccountIncludingConfigurationCustomerCapabilityStatusUpdatedEventData( StripeObject, ): - updated_capability: Literal["automatic_indirect_tax"] + updated_capability: Union[Literal["automatic_indirect_tax"], str] """ Open Enum. The capability which had its status updated. """ diff --git a/stripe/events/_v2_core_health_meter_event_summaries_delayed_firing_event.py b/stripe/events/_v2_core_health_meter_event_summaries_delayed_firing_event.py index 3f7d0f20d..c7ac505c7 100644 --- a/stripe/events/_v2_core_health_meter_event_summaries_delayed_firing_event.py +++ b/stripe/events/_v2_core_health_meter_event_summaries_delayed_firing_event.py @@ -4,7 +4,7 @@ from stripe._stripe_object import StripeObject from stripe._stripe_response import StripeResponse from stripe.v2.core._event import Event, EventNotification -from typing import Any, Dict, Optional, cast +from typing import Any, Dict, Optional, Union, cast from typing_extensions import Literal, TYPE_CHECKING, override if TYPE_CHECKING: @@ -42,7 +42,7 @@ class V2CoreHealthMeterEventSummariesDelayedFiringEvent(Event): class V2CoreHealthMeterEventSummariesDelayedFiringEventData(StripeObject): class Impact(StripeObject): - ingestion_method: Optional[Literal["import_sets"]] + ingestion_method: Optional[Union[Literal["import_sets"], str]] """ The ingestion method. """ diff --git a/stripe/events/_v2_core_health_meter_event_summaries_delayed_resolved_event.py b/stripe/events/_v2_core_health_meter_event_summaries_delayed_resolved_event.py index 79c0b5ae4..df6b7dce0 100644 --- a/stripe/events/_v2_core_health_meter_event_summaries_delayed_resolved_event.py +++ b/stripe/events/_v2_core_health_meter_event_summaries_delayed_resolved_event.py @@ -4,7 +4,7 @@ from stripe._stripe_object import StripeObject from stripe._stripe_response import StripeResponse from stripe.v2.core._event import Event, EventNotification -from typing import Any, Dict, Optional, cast +from typing import Any, Dict, Optional, Union, cast from typing_extensions import Literal, TYPE_CHECKING, override if TYPE_CHECKING: @@ -44,7 +44,7 @@ class V2CoreHealthMeterEventSummariesDelayedResolvedEventData( StripeObject ): class Impact(StripeObject): - ingestion_method: Optional[Literal["import_sets"]] + ingestion_method: Optional[Union[Literal["import_sets"], str]] """ The ingestion method. """ diff --git a/stripe/events/_v2_payments_settlement_allocation_intent_errored_event.py b/stripe/events/_v2_payments_settlement_allocation_intent_errored_event.py index 7e7b5dfc2..fe0d10622 100644 --- a/stripe/events/_v2_payments_settlement_allocation_intent_errored_event.py +++ b/stripe/events/_v2_payments_settlement_allocation_intent_errored_event.py @@ -5,7 +5,7 @@ from stripe._stripe_response import StripeResponse from stripe._util import get_api_mode from stripe.v2.core._event import Event, EventNotification, RelatedObject -from typing import Any, Dict, Optional, cast +from typing import Any, Dict, Optional, Union, cast from typing_extensions import Literal, TYPE_CHECKING, override if TYPE_CHECKING: @@ -96,7 +96,7 @@ class V2PaymentsSettlementAllocationIntentErroredEventData(StripeObject): """ User Message detailing the reason code and possible resolution . """ - reason_code: Literal["amount_mismatch"] + reason_code: Union[Literal["amount_mismatch"], str] """ Open Enum. The `errored` status reason. """ diff --git a/stripe/events/_v2_signals_account_signal_fraudulent_merchant_ready_event.py b/stripe/events/_v2_signals_account_signal_fraudulent_merchant_ready_event.py index dc0bbc943..d8b1eb486 100644 --- a/stripe/events/_v2_signals_account_signal_fraudulent_merchant_ready_event.py +++ b/stripe/events/_v2_signals_account_signal_fraudulent_merchant_ready_event.py @@ -161,7 +161,7 @@ class Indicator(StripeObject): """ Fraudulent merchant signal data. Present when type is fraudulent_merchant. """ - type: Literal["fraudulent_merchant"] + type: Union[Literal["fraudulent_merchant"], str] """ The type of account signal. Currently only fraudulent_merchant is supported. """ diff --git a/stripe/identity/_verification_report.py b/stripe/identity/_verification_report.py index 34afba3da..71a6c5d1e 100644 --- a/stripe/identity/_verification_report.py +++ b/stripe/identity/_verification_report.py @@ -219,7 +219,13 @@ class Error(StripeObject): code: Optional[ Union[ Literal[ - "email_unverified_other", "email_verification_declined" + "email_address_mismatch", + "email_name_mismatch", + "email_ownership_unverified", + "email_phone_mismatch", + "email_short_tenure", + "email_unverified_other", + "email_verification_declined", ], str, ] @@ -232,18 +238,54 @@ class Error(StripeObject): A human-readable message giving the reason for the failure. These messages can be shown to your users. """ + address_match_confidence: Optional[ + Union[Literal["highest", "low", "normal", "unknown"], str] + ] + """ + Confidence that the provided address matches the email records. + """ details: Optional[Details] """ Additional email verification details """ + domain_country: Optional[str] + """ + Two-letter country code of the email domain's country. + """ email: Optional[str] """ Email to be verified. """ + email_exists_confidence: Optional[ + Union[Literal["highest", "low", "normal", "unknown"], str] + ] + """ + Confidence that the email address exists. + """ error: Optional[Error] """ Details on the verification error. Present when status is `unverified`. """ + name_match_confidence: Optional[ + Union[Literal["highest", "low", "normal", "unknown"], str] + ] + """ + Confidence that the provided name matches the email records. + """ + observed_domain_tenure_days: Optional[float] + """ + The observed number of days the email domain has existed. + """ + observed_email_tenure_days: Optional[float] + """ + The observed number of days the email address has existed. + """ + phone_match_confidence: Optional[ + Union[Literal["highest", "low", "normal", "unknown"], str] + ] + """ + Confidence that the provided phone matches the email records. + """ status: Union[Literal["unverified", "verified"], str] """ Status of this `email` check. @@ -353,7 +395,15 @@ class Error(StripeObject): code: Optional[ Union[ Literal[ - "phone_unverified_other", "phone_verification_declined" + "phone_address_mismatch", + "phone_invalid", + "phone_invalid_line_type", + "phone_name_mismatch", + "phone_ownership_unverified", + "phone_short_tenure", + "phone_unsupported_country", + "phone_unverified_other", + "phone_verification_declined", ], str, ] @@ -366,10 +416,34 @@ class Error(StripeObject): A human-readable message giving the reason for the failure. These messages can be shown to your users. """ + address_match_confidence: Optional[ + Union[Literal["highest", "low", "normal", "unknown"], str] + ] + """ + Confidence that the provided address matches the phone records. + """ + carrier: Optional[str] + """ + The phone carrier. + """ error: Optional[Error] """ Details on the verification error. Present when status is `unverified`. """ + line_type: Optional[Union[Literal["landline", "mobile", "voip"], str]] + """ + The type of phone line. + """ + name_match_confidence: Optional[ + Union[Literal["highest", "low", "normal", "unknown"], str] + ] + """ + Confidence that the provided name matches the phone records. + """ + observed_phone_tenure_days: Optional[float] + """ + The observed number of days the person has owned the phone number. + """ phone: Optional[str] """ Phone to be verified. diff --git a/stripe/identity/_verification_session.py b/stripe/identity/_verification_session.py index cb3b2870a..30716e2f0 100644 --- a/stripe/identity/_verification_session.py +++ b/stripe/identity/_verification_session.py @@ -66,11 +66,23 @@ class LastError(StripeObject): "document_expired", "document_type_not_supported", "document_unverified_other", + "email_address_mismatch", + "email_name_mismatch", + "email_ownership_unverified", + "email_phone_mismatch", + "email_short_tenure", "email_unverified_other", "email_verification_declined", "id_number_insufficient_document_data", "id_number_mismatch", "id_number_unverified_other", + "phone_address_mismatch", + "phone_invalid", + "phone_invalid_line_type", + "phone_name_mismatch", + "phone_ownership_unverified", + "phone_short_tenure", + "phone_unsupported_country", "phone_unverified_other", "phone_verification_declined", "selfie_document_missing_photo", diff --git a/stripe/params/__init__.py b/stripe/params/__init__.py index 07ab1581c..0515bfc87 100644 --- a/stripe/params/__init__.py +++ b/stripe/params/__init__.py @@ -1363,7 +1363,9 @@ from stripe.params._customer_session_create_params import ( CustomerSessionCreateParams as CustomerSessionCreateParams, CustomerSessionCreateParamsComponents as CustomerSessionCreateParamsComponents, + CustomerSessionCreateParamsComponentsActiveEntitlements as CustomerSessionCreateParamsComponentsActiveEntitlements, CustomerSessionCreateParamsComponentsBuyButton as CustomerSessionCreateParamsComponentsBuyButton, + CustomerSessionCreateParamsComponentsCustomerPortal as CustomerSessionCreateParamsComponentsCustomerPortal, CustomerSessionCreateParamsComponentsCustomerSheet as CustomerSessionCreateParamsComponentsCustomerSheet, CustomerSessionCreateParamsComponentsCustomerSheetFeatures as CustomerSessionCreateParamsComponentsCustomerSheetFeatures, CustomerSessionCreateParamsComponentsMobilePaymentElement as CustomerSessionCreateParamsComponentsMobilePaymentElement, @@ -3951,6 +3953,7 @@ PaymentLinkModifyParamsSubscriptionDataTrialSettings as PaymentLinkModifyParamsSubscriptionDataTrialSettings, PaymentLinkModifyParamsSubscriptionDataTrialSettingsEndBehavior as PaymentLinkModifyParamsSubscriptionDataTrialSettingsEndBehavior, PaymentLinkModifyParamsTaxIdCollection as PaymentLinkModifyParamsTaxIdCollection, + PaymentLinkModifyParamsTransferData as PaymentLinkModifyParamsTransferData, ) from stripe.params._payment_link_retrieve_params import ( PaymentLinkRetrieveParams as PaymentLinkRetrieveParams, @@ -4002,6 +4005,7 @@ PaymentLinkUpdateParamsSubscriptionDataTrialSettings as PaymentLinkUpdateParamsSubscriptionDataTrialSettings, PaymentLinkUpdateParamsSubscriptionDataTrialSettingsEndBehavior as PaymentLinkUpdateParamsSubscriptionDataTrialSettingsEndBehavior, PaymentLinkUpdateParamsTaxIdCollection as PaymentLinkUpdateParamsTaxIdCollection, + PaymentLinkUpdateParamsTransferData as PaymentLinkUpdateParamsTransferData, ) from stripe.params._payment_location_capability_list_params import ( PaymentLocationCapabilityListParams as PaymentLocationCapabilityListParams, @@ -4653,6 +4657,7 @@ ) from stripe.params._payment_record_report_payment_attempt_params import ( PaymentRecordReportPaymentAttemptParams as PaymentRecordReportPaymentAttemptParams, + PaymentRecordReportPaymentAttemptParamsCanceled as PaymentRecordReportPaymentAttemptParamsCanceled, PaymentRecordReportPaymentAttemptParamsFailed as PaymentRecordReportPaymentAttemptParamsFailed, PaymentRecordReportPaymentAttemptParamsFailedProcessorDetails as PaymentRecordReportPaymentAttemptParamsFailedProcessorDetails, PaymentRecordReportPaymentAttemptParamsFailedProcessorDetailsCustom as PaymentRecordReportPaymentAttemptParamsFailedProcessorDetailsCustom, @@ -4671,6 +4676,7 @@ from stripe.params._payment_record_report_payment_params import ( PaymentRecordReportPaymentParams as PaymentRecordReportPaymentParams, PaymentRecordReportPaymentParamsAmountRequested as PaymentRecordReportPaymentParamsAmountRequested, + PaymentRecordReportPaymentParamsCanceled as PaymentRecordReportPaymentParamsCanceled, PaymentRecordReportPaymentParamsCustomerDetails as PaymentRecordReportPaymentParamsCustomerDetails, PaymentRecordReportPaymentParamsFailed as PaymentRecordReportPaymentParamsFailed, PaymentRecordReportPaymentParamsFailedProcessorDetails as PaymentRecordReportPaymentParamsFailedProcessorDetails, @@ -10615,10 +10621,18 @@ "stripe.params._customer_session_create_params", False, ), + "CustomerSessionCreateParamsComponentsActiveEntitlements": ( + "stripe.params._customer_session_create_params", + False, + ), "CustomerSessionCreateParamsComponentsBuyButton": ( "stripe.params._customer_session_create_params", False, ), + "CustomerSessionCreateParamsComponentsCustomerPortal": ( + "stripe.params._customer_session_create_params", + False, + ), "CustomerSessionCreateParamsComponentsCustomerSheet": ( "stripe.params._customer_session_create_params", False, @@ -19813,6 +19827,10 @@ "stripe.params._payment_link_modify_params", False, ), + "PaymentLinkModifyParamsTransferData": ( + "stripe.params._payment_link_modify_params", + False, + ), "PaymentLinkRetrieveParams": ( "stripe.params._payment_link_retrieve_params", False, @@ -20001,6 +20019,10 @@ "stripe.params._payment_link_update_params", False, ), + "PaymentLinkUpdateParamsTransferData": ( + "stripe.params._payment_link_update_params", + False, + ), "PaymentLocationCapabilityListParams": ( "stripe.params._payment_location_capability_list_params", False, @@ -22277,6 +22299,10 @@ "stripe.params._payment_record_report_payment_attempt_params", False, ), + "PaymentRecordReportPaymentAttemptParamsCanceled": ( + "stripe.params._payment_record_report_payment_attempt_params", + False, + ), "PaymentRecordReportPaymentAttemptParamsFailed": ( "stripe.params._payment_record_report_payment_attempt_params", False, @@ -22341,6 +22367,10 @@ "stripe.params._payment_record_report_payment_params", False, ), + "PaymentRecordReportPaymentParamsCanceled": ( + "stripe.params._payment_record_report_payment_params", + False, + ), "PaymentRecordReportPaymentParamsCustomerDetails": ( "stripe.params._payment_record_report_payment_params", False, diff --git a/stripe/params/_account_session_create_params.py b/stripe/params/_account_session_create_params.py index 9bc1bbb7e..935867523 100644 --- a/stripe/params/_account_session_create_params.py +++ b/stripe/params/_account_session_create_params.py @@ -820,7 +820,10 @@ class AccountSessionCreateParamsComponentsPaymentMethodSettings(TypedDict): class AccountSessionCreateParamsComponentsPaymentMethodSettingsFeatures( TypedDict, ): - pass + disable_stripe_user_authentication: NotRequired[bool] + """ + Whether Stripe user authentication is disabled. This value can only be `true` for accounts where `controller.requirement_collection` is `application` for the account. This is `false` by default. + """ class AccountSessionCreateParamsComponentsPayments(TypedDict): diff --git a/stripe/params/_confirmation_token_create_params.py b/stripe/params/_confirmation_token_create_params.py index df8c78f8d..d281929f9 100644 --- a/stripe/params/_confirmation_token_create_params.py +++ b/stripe/params/_confirmation_token_create_params.py @@ -419,6 +419,7 @@ class ConfirmationTokenCreateParamsPaymentMethodData(TypedDict): "satispay", "scalapay", "sepa_debit", + "sequra", "shopeepay", "sofort", "stripe_balance", diff --git a/stripe/params/_customer_list_payment_methods_params.py b/stripe/params/_customer_list_payment_methods_params.py index f4ab10b8f..c9c017593 100644 --- a/stripe/params/_customer_list_payment_methods_params.py +++ b/stripe/params/_customer_list_payment_methods_params.py @@ -29,7 +29,7 @@ class CustomerListPaymentMethodsParams(RequestOptions): A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ type: NotRequired[ - "Literal['acss_debit', 'affirm', 'afterpay_clearpay', 'alipay', 'alma', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'billie', 'bizum', 'blik', 'boleto', 'card', 'cashapp', 'crypto', 'custom', 'customer_balance', 'eps', 'fpx', 'gift_card', 'giropay', 'gopay', 'grabpay', 'id_bank_transfer', 'ideal', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'mb_way', 'mobilepay', 'multibanco', 'naver_pay', 'nz_bank_account', 'oxxo', 'p24', 'pay_by_bank', 'payco', 'paynow', 'paypal', 'paypay', 'payto', 'pix', 'promptpay', 'qris', 'rechnung', 'revolut_pay', 'samsung_pay', 'satispay', 'scalapay', 'sepa_debit', 'shopeepay', 'sofort', 'stripe_balance', 'sunbit', 'swish', 'tamara', 'twint', 'upi', 'us_bank_account', 'vipps', 'wechat_pay', 'zip']|str" + "Literal['acss_debit', 'affirm', 'afterpay_clearpay', 'alipay', 'alma', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'billie', 'bizum', 'blik', 'boleto', 'card', 'cashapp', 'crypto', 'custom', 'customer_balance', 'eps', 'fpx', 'gift_card', 'giropay', 'gopay', 'grabpay', 'id_bank_transfer', 'ideal', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'mb_way', 'mobilepay', 'multibanco', 'naver_pay', 'nz_bank_account', 'oxxo', 'p24', 'pay_by_bank', 'payco', 'paynow', 'paypal', 'paypay', 'payto', 'pix', 'promptpay', 'qris', 'rechnung', 'revolut_pay', 'samsung_pay', 'satispay', 'scalapay', 'sepa_debit', 'sequra', 'shopeepay', 'sofort', 'stripe_balance', 'sunbit', 'swish', 'tamara', 'twint', 'upi', 'us_bank_account', 'vipps', 'wechat_pay', 'zip']|str" ] """ An optional filter on the list, based on the object `type` field. Without the filter, the list includes all current and future payment method types. If your integration expects only one type of payment method in the response, make sure to provide a type value in the request. diff --git a/stripe/params/_customer_payment_method_list_params.py b/stripe/params/_customer_payment_method_list_params.py index ce95b1089..f8140a3e0 100644 --- a/stripe/params/_customer_payment_method_list_params.py +++ b/stripe/params/_customer_payment_method_list_params.py @@ -28,7 +28,7 @@ class CustomerPaymentMethodListParams(TypedDict): A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ type: NotRequired[ - "Literal['acss_debit', 'affirm', 'afterpay_clearpay', 'alipay', 'alma', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'billie', 'bizum', 'blik', 'boleto', 'card', 'cashapp', 'crypto', 'custom', 'customer_balance', 'eps', 'fpx', 'gift_card', 'giropay', 'gopay', 'grabpay', 'id_bank_transfer', 'ideal', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'mb_way', 'mobilepay', 'multibanco', 'naver_pay', 'nz_bank_account', 'oxxo', 'p24', 'pay_by_bank', 'payco', 'paynow', 'paypal', 'paypay', 'payto', 'pix', 'promptpay', 'qris', 'rechnung', 'revolut_pay', 'samsung_pay', 'satispay', 'scalapay', 'sepa_debit', 'shopeepay', 'sofort', 'stripe_balance', 'sunbit', 'swish', 'tamara', 'twint', 'upi', 'us_bank_account', 'vipps', 'wechat_pay', 'zip']|str" + "Literal['acss_debit', 'affirm', 'afterpay_clearpay', 'alipay', 'alma', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'billie', 'bizum', 'blik', 'boleto', 'card', 'cashapp', 'crypto', 'custom', 'customer_balance', 'eps', 'fpx', 'gift_card', 'giropay', 'gopay', 'grabpay', 'id_bank_transfer', 'ideal', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'mb_way', 'mobilepay', 'multibanco', 'naver_pay', 'nz_bank_account', 'oxxo', 'p24', 'pay_by_bank', 'payco', 'paynow', 'paypal', 'paypay', 'payto', 'pix', 'promptpay', 'qris', 'rechnung', 'revolut_pay', 'samsung_pay', 'satispay', 'scalapay', 'sepa_debit', 'sequra', 'shopeepay', 'sofort', 'stripe_balance', 'sunbit', 'swish', 'tamara', 'twint', 'upi', 'us_bank_account', 'vipps', 'wechat_pay', 'zip']|str" ] """ An optional filter on the list, based on the object `type` field. Without the filter, the list includes all current and future payment method types. If your integration expects only one type of payment method in the response, make sure to provide a type value in the request. diff --git a/stripe/params/_customer_session_create_params.py b/stripe/params/_customer_session_create_params.py index 7ef261f5c..8ecdfe551 100644 --- a/stripe/params/_customer_session_create_params.py +++ b/stripe/params/_customer_session_create_params.py @@ -25,10 +25,22 @@ class CustomerSessionCreateParams(RequestOptions): class CustomerSessionCreateParamsComponents(TypedDict): + active_entitlements: NotRequired[ + "CustomerSessionCreateParamsComponentsActiveEntitlements" + ] + """ + Configuration for active entitlements. + """ buy_button: NotRequired["CustomerSessionCreateParamsComponentsBuyButton"] """ Configuration for buy button. """ + customer_portal: NotRequired[ + "CustomerSessionCreateParamsComponentsCustomerPortal" + ] + """ + Configuration for customer portal. + """ customer_sheet: NotRequired[ "CustomerSessionCreateParamsComponentsCustomerSheet" ] @@ -61,6 +73,13 @@ class CustomerSessionCreateParamsComponents(TypedDict): """ +class CustomerSessionCreateParamsComponentsActiveEntitlements(TypedDict): + enabled: bool + """ + Whether the active entitlements is enabled. + """ + + class CustomerSessionCreateParamsComponentsBuyButton(TypedDict): enabled: bool """ @@ -68,6 +87,13 @@ class CustomerSessionCreateParamsComponentsBuyButton(TypedDict): """ +class CustomerSessionCreateParamsComponentsCustomerPortal(TypedDict): + enabled: bool + """ + Whether the customer portal is enabled. + """ + + class CustomerSessionCreateParamsComponentsCustomerSheet(TypedDict): enabled: bool """ diff --git a/stripe/params/_gift_card_create_params.py b/stripe/params/_gift_card_create_params.py index 67559a586..7878849b5 100644 --- a/stripe/params/_gift_card_create_params.py +++ b/stripe/params/_gift_card_create_params.py @@ -1,12 +1,12 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._request_options import RequestOptions -from typing import List +from typing import List, Union from typing_extensions import Literal, NotRequired class GiftCardCreateParams(RequestOptions): - brand: Literal["svs"] + brand: Union[Literal["svs"], str] """ The brand of the gift card. """ diff --git a/stripe/params/_invoice_create_params.py b/stripe/params/_invoice_create_params.py index 06c08b129..9c1e8fcf6 100644 --- a/stripe/params/_invoice_create_params.py +++ b/stripe/params/_invoice_create_params.py @@ -299,7 +299,7 @@ class InvoiceCreateParamsPaymentSettings(TypedDict): Payment-method-specific configuration to provide to the invoice's PaymentIntent. """ payment_method_types: NotRequired[ - "Literal['']|List[Union[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'affirm', 'alipay', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'billie', 'bizum', 'blik', 'boleto', 'card', 'cashapp', 'check_scan', 'crypto', 'custom', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'id_bank_transfer', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'mb_way', 'momo', 'multibanco', 'naver_pay', 'nz_bank_account', 'p24', 'pay_by_bank', 'payco', 'paynow', 'paypal', 'paypay', 'payto', 'pix', 'promptpay', 'revolut_pay', 'satispay', 'sepa_credit_transfer', 'sepa_debit', 'sequra', 'sofort', 'stripe_balance', 'swish', 'twint', 'upi', 'us_bank_account', 'vipps', 'wechat_pay'], str]]" + "Literal['']|List[Union[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'affirm', 'alipay', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'billie', 'bizum', 'blik', 'boleto', 'card', 'cashapp', 'check_scan', 'crypto', 'custom', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'id_bank_transfer', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'mb_way', 'momo', 'multibanco', 'naver_pay', 'nz_bank_account', 'p24', 'pay_by_bank', 'payco', 'paynow', 'paypal', 'paypay', 'payto', 'pix', 'promptpay', 'revolut_pay', 'satispay', 'sepa_credit_transfer', 'sepa_debit', 'sequra', 'sofort', 'stripe_balance', 'swish', 'truemoney', 'twint', 'upi', 'us_bank_account', 'vipps', 'wechat_pay'], str]]" ] """ The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). diff --git a/stripe/params/_invoice_create_preview_params.py b/stripe/params/_invoice_create_preview_params.py index 9a0c4492c..89d1de889 100644 --- a/stripe/params/_invoice_create_preview_params.py +++ b/stripe/params/_invoice_create_preview_params.py @@ -2913,7 +2913,7 @@ class InvoiceCreatePreviewParamsSubscriptionDetailsPause(TypedDict): """ Determines how to handle debits and credits when pausing. Defaults to `pending_invoice_item`. """ - type: NotRequired[Literal["subscription"]] + type: NotRequired["Literal['subscription']|str"] """ The type of pause to apply. Defaults to `subscription`. """ diff --git a/stripe/params/_invoice_modify_params.py b/stripe/params/_invoice_modify_params.py index 75b95bbbf..06189d2aa 100644 --- a/stripe/params/_invoice_modify_params.py +++ b/stripe/params/_invoice_modify_params.py @@ -253,7 +253,7 @@ class InvoiceModifyParamsPaymentSettings(TypedDict): Payment-method-specific configuration to provide to the invoice's PaymentIntent. """ payment_method_types: NotRequired[ - "Literal['']|List[Union[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'affirm', 'alipay', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'billie', 'bizum', 'blik', 'boleto', 'card', 'cashapp', 'check_scan', 'crypto', 'custom', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'id_bank_transfer', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'mb_way', 'momo', 'multibanco', 'naver_pay', 'nz_bank_account', 'p24', 'pay_by_bank', 'payco', 'paynow', 'paypal', 'paypay', 'payto', 'pix', 'promptpay', 'revolut_pay', 'satispay', 'sepa_credit_transfer', 'sepa_debit', 'sequra', 'sofort', 'stripe_balance', 'swish', 'twint', 'upi', 'us_bank_account', 'vipps', 'wechat_pay'], str]]" + "Literal['']|List[Union[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'affirm', 'alipay', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'billie', 'bizum', 'blik', 'boleto', 'card', 'cashapp', 'check_scan', 'crypto', 'custom', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'id_bank_transfer', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'mb_way', 'momo', 'multibanco', 'naver_pay', 'nz_bank_account', 'p24', 'pay_by_bank', 'payco', 'paynow', 'paypal', 'paypay', 'payto', 'pix', 'promptpay', 'revolut_pay', 'satispay', 'sepa_credit_transfer', 'sepa_debit', 'sequra', 'sofort', 'stripe_balance', 'swish', 'truemoney', 'twint', 'upi', 'us_bank_account', 'vipps', 'wechat_pay'], str]]" ] """ The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). diff --git a/stripe/params/_invoice_update_params.py b/stripe/params/_invoice_update_params.py index dad5d805a..3c256ac78 100644 --- a/stripe/params/_invoice_update_params.py +++ b/stripe/params/_invoice_update_params.py @@ -252,7 +252,7 @@ class InvoiceUpdateParamsPaymentSettings(TypedDict): Payment-method-specific configuration to provide to the invoice's PaymentIntent. """ payment_method_types: NotRequired[ - "Literal['']|List[Union[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'affirm', 'alipay', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'billie', 'bizum', 'blik', 'boleto', 'card', 'cashapp', 'check_scan', 'crypto', 'custom', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'id_bank_transfer', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'mb_way', 'momo', 'multibanco', 'naver_pay', 'nz_bank_account', 'p24', 'pay_by_bank', 'payco', 'paynow', 'paypal', 'paypay', 'payto', 'pix', 'promptpay', 'revolut_pay', 'satispay', 'sepa_credit_transfer', 'sepa_debit', 'sequra', 'sofort', 'stripe_balance', 'swish', 'twint', 'upi', 'us_bank_account', 'vipps', 'wechat_pay'], str]]" + "Literal['']|List[Union[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'affirm', 'alipay', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'billie', 'bizum', 'blik', 'boleto', 'card', 'cashapp', 'check_scan', 'crypto', 'custom', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'id_bank_transfer', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'mb_way', 'momo', 'multibanco', 'naver_pay', 'nz_bank_account', 'p24', 'pay_by_bank', 'payco', 'paynow', 'paypal', 'paypay', 'payto', 'pix', 'promptpay', 'revolut_pay', 'satispay', 'sepa_credit_transfer', 'sepa_debit', 'sequra', 'sofort', 'stripe_balance', 'swish', 'truemoney', 'twint', 'upi', 'us_bank_account', 'vipps', 'wechat_pay'], str]]" ] """ The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). diff --git a/stripe/params/_order_create_params.py b/stripe/params/_order_create_params.py index 589434d01..4c87a1c73 100644 --- a/stripe/params/_order_create_params.py +++ b/stripe/params/_order_create_params.py @@ -2120,7 +2120,7 @@ class OrderCreateParamsPaymentSettingsPaymentMethodOptionsWechatPay(TypedDict): """ The client type that the end customer will pay from """ - setup_future_usage: NotRequired[Literal["none"]] + setup_future_usage: NotRequired["Literal['none']|str"] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. diff --git a/stripe/params/_order_modify_params.py b/stripe/params/_order_modify_params.py index c10cb506e..4ec3b3749 100644 --- a/stripe/params/_order_modify_params.py +++ b/stripe/params/_order_modify_params.py @@ -2130,7 +2130,7 @@ class OrderModifyParamsPaymentSettingsPaymentMethodOptionsWechatPay(TypedDict): """ The client type that the end customer will pay from """ - setup_future_usage: NotRequired[Literal["none"]] + setup_future_usage: NotRequired["Literal['none']|str"] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. diff --git a/stripe/params/_order_update_params.py b/stripe/params/_order_update_params.py index 02432d379..4bdb8c320 100644 --- a/stripe/params/_order_update_params.py +++ b/stripe/params/_order_update_params.py @@ -2129,7 +2129,7 @@ class OrderUpdateParamsPaymentSettingsPaymentMethodOptionsWechatPay(TypedDict): """ The client type that the end customer will pay from """ - setup_future_usage: NotRequired[Literal["none"]] + setup_future_usage: NotRequired["Literal['none']|str"] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. diff --git a/stripe/params/_payment_attempt_record_report_canceled_params.py b/stripe/params/_payment_attempt_record_report_canceled_params.py index 2e96d353d..06aced371 100644 --- a/stripe/params/_payment_attempt_record_report_canceled_params.py +++ b/stripe/params/_payment_attempt_record_report_canceled_params.py @@ -25,7 +25,9 @@ class PaymentAttemptRecordReportCanceledParams(RequestOptions): """ Payment evaluations associated with this reported payment. """ - reason: NotRequired[Literal["blocked_for_fraud"]] + reason: NotRequired[ + "Literal['blocked_for_fraud', 'merchant_canceled']|str" + ] """ The reason the payment attempt was canceled. """ diff --git a/stripe/params/_payment_intent_confirm_params.py b/stripe/params/_payment_intent_confirm_params.py index 9511bcc2c..770186a03 100644 --- a/stripe/params/_payment_intent_confirm_params.py +++ b/stripe/params/_payment_intent_confirm_params.py @@ -102,6 +102,7 @@ class PaymentIntentConfirmParams(RequestOptions): "swish", "tamara", "test_pay", + "touch_n_go", "truemoney", "twint", "upi", @@ -150,7 +151,7 @@ class PaymentIntentConfirmParams(RequestOptions): Set to `true` to fail the payment attempt if the PaymentIntent transitions into `requires_action`. This parameter is intended for simpler integrations that do not handle customer actions, like [saving cards without authentication](https://docs.stripe.com/payments/save-card-without-authentication). """ excluded_payment_method_types: NotRequired[ - "Literal['']|List[Union[Literal['acss_debit', 'affirm', 'afterpay_clearpay', 'alipay', 'alma', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'billie', 'bizum', 'blik', 'boleto', 'card', 'cashapp', 'crypto', 'customer_balance', 'eps', 'fpx', 'gift_card', 'giropay', 'gopay', 'grabpay', 'id_bank_transfer', 'ideal', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'mb_way', 'mobilepay', 'multibanco', 'naver_pay', 'nz_bank_account', 'oxxo', 'p24', 'pay_by_bank', 'payco', 'paynow', 'paypal', 'paypay', 'payto', 'pix', 'promptpay', 'qris', 'rechnung', 'revolut_pay', 'samsung_pay', 'satispay', 'scalapay', 'sepa_debit', 'shopeepay', 'sofort', 'stripe_balance', 'sunbit', 'swish', 'tamara', 'twint', 'upi', 'us_bank_account', 'vipps', 'wechat_pay', 'zip'], str]]" + "Literal['']|List[Union[Literal['acss_debit', 'affirm', 'afterpay_clearpay', 'alipay', 'alma', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'billie', 'bizum', 'blik', 'boleto', 'card', 'cashapp', 'crypto', 'customer_balance', 'eps', 'fpx', 'gift_card', 'giropay', 'gopay', 'grabpay', 'id_bank_transfer', 'ideal', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'mb_way', 'mobilepay', 'multibanco', 'naver_pay', 'nz_bank_account', 'oxxo', 'p24', 'pay_by_bank', 'payco', 'paynow', 'paypal', 'paypay', 'payto', 'pix', 'promptpay', 'qris', 'rechnung', 'revolut_pay', 'samsung_pay', 'satispay', 'scalapay', 'sepa_debit', 'sequra', 'shopeepay', 'sofort', 'stripe_balance', 'sunbit', 'swish', 'tamara', 'twint', 'upi', 'us_bank_account', 'vipps', 'wechat_pay', 'zip'], str]]" ] """ The list of payment method types to exclude from use with this payment. @@ -203,10 +204,6 @@ class PaymentIntentConfirmParams(RequestOptions): """ Payment method-specific configuration for this PaymentIntent. """ - payment_method_types: NotRequired[List[str]] - """ - The list of payment method types (for example, a card) that this PaymentIntent can use. If you don't provide this, Stripe will dynamically show relevant payment methods from your [payment method settings](https://dashboard.stripe.com/settings/payment_methods). A list of valid payment method types can be found [here](https://docs.stripe.com/api/payment_methods/object#payment_method_object-type). - """ radar_options: NotRequired["PaymentIntentConfirmParamsRadarOptions"] """ Options to configure Radar. Learn more about [Radar Sessions](https://docs.stripe.com/radar/radar-session). @@ -3164,6 +3161,7 @@ class PaymentIntentConfirmParamsPaymentMethodData(TypedDict): "satispay", "scalapay", "sepa_debit", + "sequra", "shopeepay", "sofort", "stripe_balance", @@ -4337,6 +4335,9 @@ class PaymentIntentConfirmParamsPaymentMethodOptionsBacsDebit(TypedDict): """ Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. """ + verification_method: NotRequired[ + Literal["automatic", "payer_name_verification"] + ] class PaymentIntentConfirmParamsPaymentMethodOptionsBacsDebitMandateOptions( @@ -7548,7 +7549,7 @@ class PaymentIntentConfirmParamsPaymentMethodOptionsWechatPay(TypedDict): """ The client type that the end customer will pay from """ - setup_future_usage: NotRequired[Literal["none"]] + setup_future_usage: NotRequired["Literal['none']|str"] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. diff --git a/stripe/params/_payment_intent_create_params.py b/stripe/params/_payment_intent_create_params.py index 4ec62e352..9c763cd7c 100644 --- a/stripe/params/_payment_intent_create_params.py +++ b/stripe/params/_payment_intent_create_params.py @@ -102,6 +102,7 @@ class PaymentIntentCreateParams(RequestOptions): "swish", "tamara", "test_pay", + "touch_n_go", "truemoney", "twint", "upi", @@ -240,6 +241,7 @@ class PaymentIntentCreateParams(RequestOptions): "satispay", "scalapay", "sepa_debit", + "sequra", "shopeepay", "sofort", "stripe_balance", @@ -324,10 +326,6 @@ class PaymentIntentCreateParams(RequestOptions): """ Payment method-specific configuration for this PaymentIntent. """ - payment_method_types: NotRequired[List[str]] - """ - The list of payment method types (for example, a card) that this PaymentIntent can use. If you don't provide this, Stripe will dynamically show relevant payment methods from your [payment method settings](https://dashboard.stripe.com/settings/payment_methods). A list of valid payment method types can be found [here](https://docs.stripe.com/api/payment_methods/object#payment_method_object-type). - """ payments_orchestration: NotRequired[ "PaymentIntentCreateParamsPaymentsOrchestration" ] @@ -3299,6 +3297,7 @@ class PaymentIntentCreateParamsPaymentMethodData(TypedDict): "satispay", "scalapay", "sepa_debit", + "sequra", "shopeepay", "sofort", "stripe_balance", @@ -4470,6 +4469,9 @@ class PaymentIntentCreateParamsPaymentMethodOptionsBacsDebit(TypedDict): """ Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. """ + verification_method: NotRequired[ + Literal["automatic", "payer_name_verification"] + ] class PaymentIntentCreateParamsPaymentMethodOptionsBacsDebitMandateOptions( @@ -7675,7 +7677,7 @@ class PaymentIntentCreateParamsPaymentMethodOptionsWechatPay(TypedDict): """ The client type that the end customer will pay from """ - setup_future_usage: NotRequired[Literal["none"]] + setup_future_usage: NotRequired["Literal['none']|str"] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. diff --git a/stripe/params/_payment_intent_modify_params.py b/stripe/params/_payment_intent_modify_params.py index dcbd0d75c..54eda5025 100644 --- a/stripe/params/_payment_intent_modify_params.py +++ b/stripe/params/_payment_intent_modify_params.py @@ -102,6 +102,7 @@ class PaymentIntentModifyParams(RequestOptions): "swish", "tamara", "test_pay", + "touch_n_go", "truemoney", "twint", "upi", @@ -164,7 +165,7 @@ class PaymentIntentModifyParams(RequestOptions): An arbitrary string attached to the object. Often useful for displaying to users. """ excluded_payment_method_types: NotRequired[ - "Literal['']|List[Union[Literal['acss_debit', 'affirm', 'afterpay_clearpay', 'alipay', 'alma', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'billie', 'bizum', 'blik', 'boleto', 'card', 'cashapp', 'crypto', 'customer_balance', 'eps', 'fpx', 'gift_card', 'giropay', 'gopay', 'grabpay', 'id_bank_transfer', 'ideal', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'mb_way', 'mobilepay', 'multibanco', 'naver_pay', 'nz_bank_account', 'oxxo', 'p24', 'pay_by_bank', 'payco', 'paynow', 'paypal', 'paypay', 'payto', 'pix', 'promptpay', 'qris', 'rechnung', 'revolut_pay', 'samsung_pay', 'satispay', 'scalapay', 'sepa_debit', 'shopeepay', 'sofort', 'stripe_balance', 'sunbit', 'swish', 'tamara', 'twint', 'upi', 'us_bank_account', 'vipps', 'wechat_pay', 'zip'], str]]" + "Literal['']|List[Union[Literal['acss_debit', 'affirm', 'afterpay_clearpay', 'alipay', 'alma', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'billie', 'bizum', 'blik', 'boleto', 'card', 'cashapp', 'crypto', 'customer_balance', 'eps', 'fpx', 'gift_card', 'giropay', 'gopay', 'grabpay', 'id_bank_transfer', 'ideal', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'mb_way', 'mobilepay', 'multibanco', 'naver_pay', 'nz_bank_account', 'oxxo', 'p24', 'pay_by_bank', 'payco', 'paynow', 'paypal', 'paypay', 'payto', 'pix', 'promptpay', 'qris', 'rechnung', 'revolut_pay', 'samsung_pay', 'satispay', 'scalapay', 'sepa_debit', 'sequra', 'shopeepay', 'sofort', 'stripe_balance', 'sunbit', 'swish', 'tamara', 'twint', 'upi', 'us_bank_account', 'vipps', 'wechat_pay', 'zip'], str]]" ] """ The list of payment method types to exclude from use with this payment. @@ -216,10 +217,6 @@ class PaymentIntentModifyParams(RequestOptions): """ Payment-method-specific configuration for this PaymentIntent. """ - payment_method_types: NotRequired[List[str]] - """ - The list of payment method types (for example, card) that this PaymentIntent can use. Use `automatic_payment_methods` to manage payment methods from the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods). A list of valid payment method types can be found [here](https://docs.stripe.com/api/payment_methods/object#payment_method_object-type). - """ receipt_email: NotRequired["Literal['']|str"] """ Email address that the receipt for the resulting payment will be sent to. If `receipt_email` is specified for a payment in live mode, a receipt will be sent regardless of your [email settings](https://dashboard.stripe.com/account/emails). @@ -3143,6 +3140,7 @@ class PaymentIntentModifyParamsPaymentMethodData(TypedDict): "satispay", "scalapay", "sepa_debit", + "sequra", "shopeepay", "sofort", "stripe_balance", @@ -4314,6 +4312,9 @@ class PaymentIntentModifyParamsPaymentMethodOptionsBacsDebit(TypedDict): """ Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. """ + verification_method: NotRequired[ + Literal["automatic", "payer_name_verification"] + ] class PaymentIntentModifyParamsPaymentMethodOptionsBacsDebitMandateOptions( @@ -7519,7 +7520,7 @@ class PaymentIntentModifyParamsPaymentMethodOptionsWechatPay(TypedDict): """ The client type that the end customer will pay from """ - setup_future_usage: NotRequired[Literal["none"]] + setup_future_usage: NotRequired["Literal['none']|str"] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. diff --git a/stripe/params/_payment_intent_update_params.py b/stripe/params/_payment_intent_update_params.py index 1370f0fff..edfe4a7c7 100644 --- a/stripe/params/_payment_intent_update_params.py +++ b/stripe/params/_payment_intent_update_params.py @@ -101,6 +101,7 @@ class PaymentIntentUpdateParams(TypedDict): "swish", "tamara", "test_pay", + "touch_n_go", "truemoney", "twint", "upi", @@ -163,7 +164,7 @@ class PaymentIntentUpdateParams(TypedDict): An arbitrary string attached to the object. Often useful for displaying to users. """ excluded_payment_method_types: NotRequired[ - "Literal['']|List[Union[Literal['acss_debit', 'affirm', 'afterpay_clearpay', 'alipay', 'alma', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'billie', 'bizum', 'blik', 'boleto', 'card', 'cashapp', 'crypto', 'customer_balance', 'eps', 'fpx', 'gift_card', 'giropay', 'gopay', 'grabpay', 'id_bank_transfer', 'ideal', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'mb_way', 'mobilepay', 'multibanco', 'naver_pay', 'nz_bank_account', 'oxxo', 'p24', 'pay_by_bank', 'payco', 'paynow', 'paypal', 'paypay', 'payto', 'pix', 'promptpay', 'qris', 'rechnung', 'revolut_pay', 'samsung_pay', 'satispay', 'scalapay', 'sepa_debit', 'shopeepay', 'sofort', 'stripe_balance', 'sunbit', 'swish', 'tamara', 'twint', 'upi', 'us_bank_account', 'vipps', 'wechat_pay', 'zip'], str]]" + "Literal['']|List[Union[Literal['acss_debit', 'affirm', 'afterpay_clearpay', 'alipay', 'alma', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'billie', 'bizum', 'blik', 'boleto', 'card', 'cashapp', 'crypto', 'customer_balance', 'eps', 'fpx', 'gift_card', 'giropay', 'gopay', 'grabpay', 'id_bank_transfer', 'ideal', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'mb_way', 'mobilepay', 'multibanco', 'naver_pay', 'nz_bank_account', 'oxxo', 'p24', 'pay_by_bank', 'payco', 'paynow', 'paypal', 'paypay', 'payto', 'pix', 'promptpay', 'qris', 'rechnung', 'revolut_pay', 'samsung_pay', 'satispay', 'scalapay', 'sepa_debit', 'sequra', 'shopeepay', 'sofort', 'stripe_balance', 'sunbit', 'swish', 'tamara', 'twint', 'upi', 'us_bank_account', 'vipps', 'wechat_pay', 'zip'], str]]" ] """ The list of payment method types to exclude from use with this payment. @@ -215,10 +216,6 @@ class PaymentIntentUpdateParams(TypedDict): """ Payment-method-specific configuration for this PaymentIntent. """ - payment_method_types: NotRequired[List[str]] - """ - The list of payment method types (for example, card) that this PaymentIntent can use. Use `automatic_payment_methods` to manage payment methods from the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods). A list of valid payment method types can be found [here](https://docs.stripe.com/api/payment_methods/object#payment_method_object-type). - """ receipt_email: NotRequired["Literal['']|str"] """ Email address that the receipt for the resulting payment will be sent to. If `receipt_email` is specified for a payment in live mode, a receipt will be sent regardless of your [email settings](https://dashboard.stripe.com/account/emails). @@ -3142,6 +3139,7 @@ class PaymentIntentUpdateParamsPaymentMethodData(TypedDict): "satispay", "scalapay", "sepa_debit", + "sequra", "shopeepay", "sofort", "stripe_balance", @@ -4313,6 +4311,9 @@ class PaymentIntentUpdateParamsPaymentMethodOptionsBacsDebit(TypedDict): """ Controls when Stripe will attempt to debit the funds from the customer's account. The date must be a string in YYYY-MM-DD format. The date must be in the future and between 3 and 15 calendar days from now. """ + verification_method: NotRequired[ + Literal["automatic", "payer_name_verification"] + ] class PaymentIntentUpdateParamsPaymentMethodOptionsBacsDebitMandateOptions( @@ -7518,7 +7519,7 @@ class PaymentIntentUpdateParamsPaymentMethodOptionsWechatPay(TypedDict): """ The client type that the end customer will pay from """ - setup_future_usage: NotRequired[Literal["none"]] + setup_future_usage: NotRequired["Literal['none']|str"] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. diff --git a/stripe/params/_payment_link_modify_params.py b/stripe/params/_payment_link_modify_params.py index 88212cd57..a13a678f3 100644 --- a/stripe/params/_payment_link_modify_params.py +++ b/stripe/params/_payment_link_modify_params.py @@ -19,6 +19,14 @@ class PaymentLinkModifyParams(RequestOptions): """ Enables user redeemable promotion codes. """ + application_fee_amount: NotRequired["Literal['']|int"] + """ + The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. Can only be applied when there are no line items with recurring prices. + """ + application_fee_percent: NotRequired["Literal['']|float"] + """ + A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. There must be at least 1 line item with a recurring price to use this field. + """ automatic_tax: NotRequired["PaymentLinkModifyParamsAutomaticTax"] """ Configuration for automatic tax collection. @@ -71,6 +79,10 @@ class PaymentLinkModifyParams(RequestOptions): """ Controls settings applied for collecting the customer's name. """ + on_behalf_of: NotRequired["Literal['']|str"] + """ + The account on behalf of which to charge. + """ optional_items: NotRequired[ "Literal['']|List[PaymentLinkModifyParamsOptionalItem]" ] @@ -147,6 +159,12 @@ class PaymentLinkModifyParams(RequestOptions): """ Controls tax ID collection during checkout. """ + transfer_data: NotRequired[ + "Literal['']|PaymentLinkModifyParamsTransferData" + ] + """ + The account (if any) the payments will be attributed to for tax reporting, and where funds from each payment will be transferred to. + """ class PaymentLinkModifyParamsAfterCompletion(TypedDict): @@ -991,3 +1009,17 @@ class PaymentLinkModifyParamsTaxIdCollection(TypedDict): """ Describes whether a tax ID is required during checkout. Defaults to `never`. You can't set this parameter if `ui_mode` is `custom`. """ + + +class PaymentLinkModifyParamsTransferData(TypedDict): + amount: NotRequired["Literal['']|int"] + """ + The amount that will be transferred automatically when a charge succeeds. + """ + destination: str + """ + If specified, successful charges will be attributed to the destination + account for tax reporting, and the funds from charges will be transferred + to the destination account. The ID of the resulting transfer will be + returned on the successful charge's `transfer` field. + """ diff --git a/stripe/params/_payment_link_update_params.py b/stripe/params/_payment_link_update_params.py index 6e9a85e56..b893876c7 100644 --- a/stripe/params/_payment_link_update_params.py +++ b/stripe/params/_payment_link_update_params.py @@ -18,6 +18,14 @@ class PaymentLinkUpdateParams(TypedDict): """ Enables user redeemable promotion codes. """ + application_fee_amount: NotRequired["Literal['']|int"] + """ + The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. Can only be applied when there are no line items with recurring prices. + """ + application_fee_percent: NotRequired["Literal['']|float"] + """ + A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. There must be at least 1 line item with a recurring price to use this field. + """ automatic_tax: NotRequired["PaymentLinkUpdateParamsAutomaticTax"] """ Configuration for automatic tax collection. @@ -70,6 +78,10 @@ class PaymentLinkUpdateParams(TypedDict): """ Controls settings applied for collecting the customer's name. """ + on_behalf_of: NotRequired["Literal['']|str"] + """ + The account on behalf of which to charge. + """ optional_items: NotRequired[ "Literal['']|List[PaymentLinkUpdateParamsOptionalItem]" ] @@ -146,6 +158,12 @@ class PaymentLinkUpdateParams(TypedDict): """ Controls tax ID collection during checkout. """ + transfer_data: NotRequired[ + "Literal['']|PaymentLinkUpdateParamsTransferData" + ] + """ + The account (if any) the payments will be attributed to for tax reporting, and where funds from each payment will be transferred to. + """ class PaymentLinkUpdateParamsAfterCompletion(TypedDict): @@ -990,3 +1008,17 @@ class PaymentLinkUpdateParamsTaxIdCollection(TypedDict): """ Describes whether a tax ID is required during checkout. Defaults to `never`. You can't set this parameter if `ui_mode` is `custom`. """ + + +class PaymentLinkUpdateParamsTransferData(TypedDict): + amount: NotRequired["Literal['']|int"] + """ + The amount that will be transferred automatically when a charge succeeds. + """ + destination: str + """ + If specified, successful charges will be attributed to the destination + account for tax reporting, and the funds from charges will be transferred + to the destination account. The ID of the resulting transfer will be + returned on the successful charge's `transfer` field. + """ diff --git a/stripe/params/_payment_method_create_params.py b/stripe/params/_payment_method_create_params.py index b6d741d4e..58a622ae8 100644 --- a/stripe/params/_payment_method_create_params.py +++ b/stripe/params/_payment_method_create_params.py @@ -282,7 +282,7 @@ class PaymentMethodCreateParams(RequestOptions): If this is a TWINT PaymentMethod, this hash contains details about the TWINT payment method. """ type: NotRequired[ - "Literal['acss_debit', 'affirm', 'afterpay_clearpay', 'alipay', 'alma', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'billie', 'bizum', 'blik', 'boleto', 'card', 'cashapp', 'crypto', 'custom', 'customer_balance', 'eps', 'fpx', 'gift_card', 'giropay', 'gopay', 'grabpay', 'id_bank_transfer', 'ideal', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'mb_way', 'mobilepay', 'multibanco', 'naver_pay', 'nz_bank_account', 'oxxo', 'p24', 'pay_by_bank', 'payco', 'paynow', 'paypal', 'paypay', 'payto', 'pix', 'promptpay', 'qris', 'rechnung', 'revolut_pay', 'samsung_pay', 'satispay', 'scalapay', 'sepa_debit', 'shopeepay', 'sofort', 'stripe_balance', 'sunbit', 'swish', 'tamara', 'twint', 'upi', 'us_bank_account', 'vipps', 'wechat_pay', 'zip']|str" + "Literal['acss_debit', 'affirm', 'afterpay_clearpay', 'alipay', 'alma', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'billie', 'bizum', 'blik', 'boleto', 'card', 'cashapp', 'crypto', 'custom', 'customer_balance', 'eps', 'fpx', 'gift_card', 'giropay', 'gopay', 'grabpay', 'id_bank_transfer', 'ideal', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'mb_way', 'mobilepay', 'multibanco', 'naver_pay', 'nz_bank_account', 'oxxo', 'p24', 'pay_by_bank', 'payco', 'paynow', 'paypal', 'paypay', 'payto', 'pix', 'promptpay', 'qris', 'rechnung', 'revolut_pay', 'samsung_pay', 'satispay', 'scalapay', 'sepa_debit', 'sequra', 'shopeepay', 'sofort', 'stripe_balance', 'sunbit', 'swish', 'tamara', 'twint', 'upi', 'us_bank_account', 'vipps', 'wechat_pay', 'zip']|str" ] """ The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type. diff --git a/stripe/params/_payment_method_list_params.py b/stripe/params/_payment_method_list_params.py index ad6d0cb70..718e073ac 100644 --- a/stripe/params/_payment_method_list_params.py +++ b/stripe/params/_payment_method_list_params.py @@ -37,7 +37,7 @@ class PaymentMethodListParams(RequestOptions): A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ type: NotRequired[ - "Literal['acss_debit', 'affirm', 'afterpay_clearpay', 'alipay', 'alma', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'billie', 'bizum', 'blik', 'boleto', 'card', 'cashapp', 'crypto', 'custom', 'customer_balance', 'eps', 'fpx', 'gift_card', 'giropay', 'gopay', 'grabpay', 'id_bank_transfer', 'ideal', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'mb_way', 'mobilepay', 'multibanco', 'naver_pay', 'nz_bank_account', 'oxxo', 'p24', 'pay_by_bank', 'payco', 'paynow', 'paypal', 'paypay', 'payto', 'pix', 'promptpay', 'qris', 'rechnung', 'revolut_pay', 'samsung_pay', 'satispay', 'scalapay', 'sepa_debit', 'shopeepay', 'sofort', 'stripe_balance', 'sunbit', 'swish', 'tamara', 'twint', 'upi', 'us_bank_account', 'vipps', 'wechat_pay', 'zip']|str" + "Literal['acss_debit', 'affirm', 'afterpay_clearpay', 'alipay', 'alma', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'billie', 'bizum', 'blik', 'boleto', 'card', 'cashapp', 'crypto', 'custom', 'customer_balance', 'eps', 'fpx', 'gift_card', 'giropay', 'gopay', 'grabpay', 'id_bank_transfer', 'ideal', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'mb_way', 'mobilepay', 'multibanco', 'naver_pay', 'nz_bank_account', 'oxxo', 'p24', 'pay_by_bank', 'payco', 'paynow', 'paypal', 'paypay', 'payto', 'pix', 'promptpay', 'qris', 'rechnung', 'revolut_pay', 'samsung_pay', 'satispay', 'scalapay', 'sepa_debit', 'sequra', 'shopeepay', 'sofort', 'stripe_balance', 'sunbit', 'swish', 'tamara', 'twint', 'upi', 'us_bank_account', 'vipps', 'wechat_pay', 'zip']|str" ] """ Filters the list by the object `type` field. Unfiltered, the list returns all payment method types except `custom`. If your integration expects only one type of payment method in the response, specify that type value in the request to reduce your payload. diff --git a/stripe/params/_payment_record_report_payment_attempt_canceled_params.py b/stripe/params/_payment_record_report_payment_attempt_canceled_params.py index 677b6cfda..1d2da1a80 100644 --- a/stripe/params/_payment_record_report_payment_attempt_canceled_params.py +++ b/stripe/params/_payment_record_report_payment_attempt_canceled_params.py @@ -25,7 +25,9 @@ class PaymentRecordReportPaymentAttemptCanceledParams(RequestOptions): """ Payment evaluations associated with this reported payment. """ - reason: NotRequired[Literal["blocked_for_fraud"]] + reason: NotRequired[ + "Literal['blocked_for_fraud', 'merchant_canceled']|str" + ] """ The reason the payment attempt was canceled. """ diff --git a/stripe/params/_payment_record_report_payment_attempt_params.py b/stripe/params/_payment_record_report_payment_attempt_params.py index f3989fc14..c90b686d3 100644 --- a/stripe/params/_payment_record_report_payment_attempt_params.py +++ b/stripe/params/_payment_record_report_payment_attempt_params.py @@ -7,6 +7,10 @@ class PaymentRecordReportPaymentAttemptParams(RequestOptions): + canceled: NotRequired["PaymentRecordReportPaymentAttemptParamsCanceled"] + """ + Information about the payment attempt cancelation. + """ description: NotRequired[str] """ An arbitrary string attached to the object. Often useful for displaying to users. @@ -53,6 +57,23 @@ class PaymentRecordReportPaymentAttemptParams(RequestOptions): """ +class PaymentRecordReportPaymentAttemptParamsCanceled(TypedDict): + canceled_at: int + """ + When the reported payment was canceled. Measured in seconds since the Unix epoch. + """ + payment_evaluations: NotRequired[List[str]] + """ + Payment evaluations associated with this reported payment. + """ + reason: NotRequired[ + "Literal['blocked_for_fraud', 'merchant_canceled']|str" + ] + """ + The reason the payment attempt was canceled. + """ + + class PaymentRecordReportPaymentAttemptParamsFailed(TypedDict): failed_at: int """ diff --git a/stripe/params/_payment_record_report_payment_params.py b/stripe/params/_payment_record_report_payment_params.py index f398228c5..c75c69972 100644 --- a/stripe/params/_payment_record_report_payment_params.py +++ b/stripe/params/_payment_record_report_payment_params.py @@ -11,6 +11,10 @@ class PaymentRecordReportPaymentParams(RequestOptions): """ The amount you initially requested for this payment. """ + canceled: NotRequired["PaymentRecordReportPaymentParamsCanceled"] + """ + Information about the payment attempt cancelation. + """ customer_details: NotRequired[ "PaymentRecordReportPaymentParamsCustomerDetails" ] @@ -82,6 +86,23 @@ class PaymentRecordReportPaymentParamsAmountRequested(TypedDict): """ +class PaymentRecordReportPaymentParamsCanceled(TypedDict): + canceled_at: int + """ + When the reported payment was canceled. Measured in seconds since the Unix epoch. + """ + payment_evaluations: NotRequired[List[str]] + """ + Payment evaluations associated with this reported payment. + """ + reason: NotRequired[ + "Literal['blocked_for_fraud', 'merchant_canceled']|str" + ] + """ + The reason the payment attempt was canceled. + """ + + class PaymentRecordReportPaymentParamsCustomerDetails(TypedDict): customer: NotRequired[str] """ diff --git a/stripe/params/_setup_intent_confirm_params.py b/stripe/params/_setup_intent_confirm_params.py index 62ad4a6d7..5f4cced14 100644 --- a/stripe/params/_setup_intent_confirm_params.py +++ b/stripe/params/_setup_intent_confirm_params.py @@ -98,6 +98,7 @@ class SetupIntentConfirmParams(RequestOptions): "swish", "tamara", "test_pay", + "touch_n_go", "truemoney", "twint", "upi", @@ -562,6 +563,7 @@ class SetupIntentConfirmParamsPaymentMethodData(TypedDict): "satispay", "scalapay", "sepa_debit", + "sequra", "shopeepay", "sofort", "stripe_balance", @@ -1268,6 +1270,9 @@ class SetupIntentConfirmParamsPaymentMethodOptionsBacsDebit(TypedDict): """ Additional fields for Mandate creation """ + verification_method: NotRequired[ + Literal["automatic", "payer_name_verification"] + ] class SetupIntentConfirmParamsPaymentMethodOptionsBacsDebitMandateOptions( diff --git a/stripe/params/_setup_intent_create_params.py b/stripe/params/_setup_intent_create_params.py index 424200bf4..e37ee93e5 100644 --- a/stripe/params/_setup_intent_create_params.py +++ b/stripe/params/_setup_intent_create_params.py @@ -98,6 +98,7 @@ class SetupIntentCreateParams(RequestOptions): "swish", "tamara", "test_pay", + "touch_n_go", "truemoney", "twint", "upi", @@ -208,6 +209,7 @@ class SetupIntentCreateParams(RequestOptions): "satispay", "scalapay", "sepa_debit", + "sequra", "shopeepay", "sofort", "stripe_balance", @@ -273,10 +275,6 @@ class SetupIntentCreateParams(RequestOptions): """ Payment method-specific configuration for this SetupIntent. """ - payment_method_types: NotRequired[List[str]] - """ - The list of payment method types (for example, card) that this SetupIntent can use. If you don't provide this, Stripe will dynamically show relevant payment methods from your [payment method settings](https://dashboard.stripe.com/settings/payment_methods). A list of valid payment method types can be found [here](https://docs.stripe.com/api/payment_methods/object#payment_method_object-type). - """ return_url: NotRequired[str] """ The URL to redirect your customer back to after they authenticate or cancel their payment on the payment method's app or site. To redirect to a mobile application, you can alternatively supply an application URI scheme. This parameter can only be used with [`confirm=true`](https://docs.stripe.com/api/setup_intents/create#create_setup_intent-confirm). @@ -707,6 +705,7 @@ class SetupIntentCreateParamsPaymentMethodData(TypedDict): "satispay", "scalapay", "sepa_debit", + "sequra", "shopeepay", "sofort", "stripe_balance", @@ -1411,6 +1410,9 @@ class SetupIntentCreateParamsPaymentMethodOptionsBacsDebit(TypedDict): """ Additional fields for Mandate creation """ + verification_method: NotRequired[ + Literal["automatic", "payer_name_verification"] + ] class SetupIntentCreateParamsPaymentMethodOptionsBacsDebitMandateOptions( diff --git a/stripe/params/_setup_intent_modify_params.py b/stripe/params/_setup_intent_modify_params.py index 38c2eb91a..bd55b2dcf 100644 --- a/stripe/params/_setup_intent_modify_params.py +++ b/stripe/params/_setup_intent_modify_params.py @@ -8,7 +8,7 @@ class SetupIntentModifyParams(RequestOptions): allowed_payment_method_types: NotRequired[ - "Literal['']|List[Union[Literal['acss_debit', 'affirm', 'afterpay_clearpay', 'alipay', 'alma', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'billie', 'bizum', 'blik', 'boku_promptpay', 'boleto', 'capchase_pay', 'card', 'cashapp', 'check_scan', 'click_to_pay', 'crypto', 'customer_balance', 'demo_pay', 'duitnow', 'dummy_auth_push', 'dummy_passthrough_card', 'edenred', 'eps', 'fpx', 'gcash', 'getbalance', 'gift_card', 'giropay', 'gopay', 'grabpay', 'id_bank_transfer', 'ideal', 'kakao_pay', 'klarna', 'knet', 'konbini', 'kr_card', 'kr_market', 'kriya', 'link', 'mb_way', 'mobilepay', 'momo', 'mondu', 'multibanco', 'naver_pay', 'netbanking', 'ng_bank', 'ng_bank_transfer', 'ng_card', 'ng_market', 'ng_ussd', 'ng_wallet', 'nz_bank_account', 'octopus', 'oxxo', 'p24', 'paper_check', 'pay_by_bank', 'payco', 'paynow', 'paypal', 'paypay', 'payto', 'pix', 'promptpay', 'qris', 'rechnung', 'revolut_pay', 'samsung_pay', 'satispay', 'scalapay', 'sepa_debit', 'sequra', 'shop_pay', 'shopeepay', 'sofort', 'south_korea_market', 'stripe_balance', 'sunbit', 'swish', 'tamara', 'test_pay', 'truemoney', 'twint', 'upi', 'us_bank_account', 'us_cash_voucher', 'vipps', 'wechat_pay', 'wero', 'zip'], str]]" + "Literal['']|List[Union[Literal['acss_debit', 'affirm', 'afterpay_clearpay', 'alipay', 'alma', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'billie', 'bizum', 'blik', 'boku_promptpay', 'boleto', 'capchase_pay', 'card', 'cashapp', 'check_scan', 'click_to_pay', 'crypto', 'customer_balance', 'demo_pay', 'duitnow', 'dummy_auth_push', 'dummy_passthrough_card', 'edenred', 'eps', 'fpx', 'gcash', 'getbalance', 'gift_card', 'giropay', 'gopay', 'grabpay', 'id_bank_transfer', 'ideal', 'kakao_pay', 'klarna', 'knet', 'konbini', 'kr_card', 'kr_market', 'kriya', 'link', 'mb_way', 'mobilepay', 'momo', 'mondu', 'multibanco', 'naver_pay', 'netbanking', 'ng_bank', 'ng_bank_transfer', 'ng_card', 'ng_market', 'ng_ussd', 'ng_wallet', 'nz_bank_account', 'octopus', 'oxxo', 'p24', 'paper_check', 'pay_by_bank', 'payco', 'paynow', 'paypal', 'paypay', 'payto', 'pix', 'promptpay', 'qris', 'rechnung', 'revolut_pay', 'samsung_pay', 'satispay', 'scalapay', 'sepa_debit', 'sequra', 'shop_pay', 'shopeepay', 'sofort', 'south_korea_market', 'stripe_balance', 'sunbit', 'swish', 'tamara', 'test_pay', 'touch_n_go', 'truemoney', 'twint', 'upi', 'us_bank_account', 'us_cash_voucher', 'vipps', 'wechat_pay', 'wero', 'zip'], str]]" ] """ The list of payment method types to allow for this SetupIntent. Stripe will only use methods in this list when determining the payment methods to offer. A list of valid payment method types can be found [here](https://docs.stripe.com/api/payment_methods/object#payment_method_object-type). @@ -36,7 +36,7 @@ class SetupIntentModifyParams(RequestOptions): An arbitrary string attached to the object. Often useful for displaying to users. """ excluded_payment_method_types: NotRequired[ - "Literal['']|List[Union[Literal['acss_debit', 'affirm', 'afterpay_clearpay', 'alipay', 'alma', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'billie', 'bizum', 'blik', 'boleto', 'card', 'cashapp', 'crypto', 'customer_balance', 'eps', 'fpx', 'gift_card', 'giropay', 'gopay', 'grabpay', 'id_bank_transfer', 'ideal', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'mb_way', 'mobilepay', 'multibanco', 'naver_pay', 'nz_bank_account', 'oxxo', 'p24', 'pay_by_bank', 'payco', 'paynow', 'paypal', 'paypay', 'payto', 'pix', 'promptpay', 'qris', 'rechnung', 'revolut_pay', 'samsung_pay', 'satispay', 'scalapay', 'sepa_debit', 'shopeepay', 'sofort', 'stripe_balance', 'sunbit', 'swish', 'tamara', 'twint', 'upi', 'us_bank_account', 'vipps', 'wechat_pay', 'zip'], str]]" + "Literal['']|List[Union[Literal['acss_debit', 'affirm', 'afterpay_clearpay', 'alipay', 'alma', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'billie', 'bizum', 'blik', 'boleto', 'card', 'cashapp', 'crypto', 'customer_balance', 'eps', 'fpx', 'gift_card', 'giropay', 'gopay', 'grabpay', 'id_bank_transfer', 'ideal', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'mb_way', 'mobilepay', 'multibanco', 'naver_pay', 'nz_bank_account', 'oxxo', 'p24', 'pay_by_bank', 'payco', 'paynow', 'paypal', 'paypay', 'payto', 'pix', 'promptpay', 'qris', 'rechnung', 'revolut_pay', 'samsung_pay', 'satispay', 'scalapay', 'sepa_debit', 'sequra', 'shopeepay', 'sofort', 'stripe_balance', 'sunbit', 'swish', 'tamara', 'twint', 'upi', 'us_bank_account', 'vipps', 'wechat_pay', 'zip'], str]]" ] """ The list of payment method types to exclude from use with this SetupIntent. @@ -80,10 +80,6 @@ class SetupIntentModifyParams(RequestOptions): """ Payment method-specific configuration for this SetupIntent. """ - payment_method_types: NotRequired[List[str]] - """ - The list of payment method types (for example, card) that this SetupIntent can set up. If you don't provide this, Stripe will dynamically show relevant payment methods from your [payment method settings](https://dashboard.stripe.com/settings/payment_methods). A list of valid payment method types can be found [here](https://docs.stripe.com/api/payment_methods/object#payment_method_object-type). - """ setup_details: NotRequired["SetupIntentModifyParamsSetupDetails"] """ Provides industry-specific information about the SetupIntent. @@ -438,6 +434,7 @@ class SetupIntentModifyParamsPaymentMethodData(TypedDict): "satispay", "scalapay", "sepa_debit", + "sequra", "shopeepay", "sofort", "stripe_balance", @@ -1142,6 +1139,9 @@ class SetupIntentModifyParamsPaymentMethodOptionsBacsDebit(TypedDict): """ Additional fields for Mandate creation """ + verification_method: NotRequired[ + Literal["automatic", "payer_name_verification"] + ] class SetupIntentModifyParamsPaymentMethodOptionsBacsDebitMandateOptions( diff --git a/stripe/params/_setup_intent_update_params.py b/stripe/params/_setup_intent_update_params.py index f359c3f96..4c3176676 100644 --- a/stripe/params/_setup_intent_update_params.py +++ b/stripe/params/_setup_intent_update_params.py @@ -7,7 +7,7 @@ class SetupIntentUpdateParams(TypedDict): allowed_payment_method_types: NotRequired[ - "Literal['']|List[Union[Literal['acss_debit', 'affirm', 'afterpay_clearpay', 'alipay', 'alma', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'billie', 'bizum', 'blik', 'boku_promptpay', 'boleto', 'capchase_pay', 'card', 'cashapp', 'check_scan', 'click_to_pay', 'crypto', 'customer_balance', 'demo_pay', 'duitnow', 'dummy_auth_push', 'dummy_passthrough_card', 'edenred', 'eps', 'fpx', 'gcash', 'getbalance', 'gift_card', 'giropay', 'gopay', 'grabpay', 'id_bank_transfer', 'ideal', 'kakao_pay', 'klarna', 'knet', 'konbini', 'kr_card', 'kr_market', 'kriya', 'link', 'mb_way', 'mobilepay', 'momo', 'mondu', 'multibanco', 'naver_pay', 'netbanking', 'ng_bank', 'ng_bank_transfer', 'ng_card', 'ng_market', 'ng_ussd', 'ng_wallet', 'nz_bank_account', 'octopus', 'oxxo', 'p24', 'paper_check', 'pay_by_bank', 'payco', 'paynow', 'paypal', 'paypay', 'payto', 'pix', 'promptpay', 'qris', 'rechnung', 'revolut_pay', 'samsung_pay', 'satispay', 'scalapay', 'sepa_debit', 'sequra', 'shop_pay', 'shopeepay', 'sofort', 'south_korea_market', 'stripe_balance', 'sunbit', 'swish', 'tamara', 'test_pay', 'truemoney', 'twint', 'upi', 'us_bank_account', 'us_cash_voucher', 'vipps', 'wechat_pay', 'wero', 'zip'], str]]" + "Literal['']|List[Union[Literal['acss_debit', 'affirm', 'afterpay_clearpay', 'alipay', 'alma', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'billie', 'bizum', 'blik', 'boku_promptpay', 'boleto', 'capchase_pay', 'card', 'cashapp', 'check_scan', 'click_to_pay', 'crypto', 'customer_balance', 'demo_pay', 'duitnow', 'dummy_auth_push', 'dummy_passthrough_card', 'edenred', 'eps', 'fpx', 'gcash', 'getbalance', 'gift_card', 'giropay', 'gopay', 'grabpay', 'id_bank_transfer', 'ideal', 'kakao_pay', 'klarna', 'knet', 'konbini', 'kr_card', 'kr_market', 'kriya', 'link', 'mb_way', 'mobilepay', 'momo', 'mondu', 'multibanco', 'naver_pay', 'netbanking', 'ng_bank', 'ng_bank_transfer', 'ng_card', 'ng_market', 'ng_ussd', 'ng_wallet', 'nz_bank_account', 'octopus', 'oxxo', 'p24', 'paper_check', 'pay_by_bank', 'payco', 'paynow', 'paypal', 'paypay', 'payto', 'pix', 'promptpay', 'qris', 'rechnung', 'revolut_pay', 'samsung_pay', 'satispay', 'scalapay', 'sepa_debit', 'sequra', 'shop_pay', 'shopeepay', 'sofort', 'south_korea_market', 'stripe_balance', 'sunbit', 'swish', 'tamara', 'test_pay', 'touch_n_go', 'truemoney', 'twint', 'upi', 'us_bank_account', 'us_cash_voucher', 'vipps', 'wechat_pay', 'wero', 'zip'], str]]" ] """ The list of payment method types to allow for this SetupIntent. Stripe will only use methods in this list when determining the payment methods to offer. A list of valid payment method types can be found [here](https://docs.stripe.com/api/payment_methods/object#payment_method_object-type). @@ -35,7 +35,7 @@ class SetupIntentUpdateParams(TypedDict): An arbitrary string attached to the object. Often useful for displaying to users. """ excluded_payment_method_types: NotRequired[ - "Literal['']|List[Union[Literal['acss_debit', 'affirm', 'afterpay_clearpay', 'alipay', 'alma', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'billie', 'bizum', 'blik', 'boleto', 'card', 'cashapp', 'crypto', 'customer_balance', 'eps', 'fpx', 'gift_card', 'giropay', 'gopay', 'grabpay', 'id_bank_transfer', 'ideal', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'mb_way', 'mobilepay', 'multibanco', 'naver_pay', 'nz_bank_account', 'oxxo', 'p24', 'pay_by_bank', 'payco', 'paynow', 'paypal', 'paypay', 'payto', 'pix', 'promptpay', 'qris', 'rechnung', 'revolut_pay', 'samsung_pay', 'satispay', 'scalapay', 'sepa_debit', 'shopeepay', 'sofort', 'stripe_balance', 'sunbit', 'swish', 'tamara', 'twint', 'upi', 'us_bank_account', 'vipps', 'wechat_pay', 'zip'], str]]" + "Literal['']|List[Union[Literal['acss_debit', 'affirm', 'afterpay_clearpay', 'alipay', 'alma', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'billie', 'bizum', 'blik', 'boleto', 'card', 'cashapp', 'crypto', 'customer_balance', 'eps', 'fpx', 'gift_card', 'giropay', 'gopay', 'grabpay', 'id_bank_transfer', 'ideal', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'mb_way', 'mobilepay', 'multibanco', 'naver_pay', 'nz_bank_account', 'oxxo', 'p24', 'pay_by_bank', 'payco', 'paynow', 'paypal', 'paypay', 'payto', 'pix', 'promptpay', 'qris', 'rechnung', 'revolut_pay', 'samsung_pay', 'satispay', 'scalapay', 'sepa_debit', 'sequra', 'shopeepay', 'sofort', 'stripe_balance', 'sunbit', 'swish', 'tamara', 'twint', 'upi', 'us_bank_account', 'vipps', 'wechat_pay', 'zip'], str]]" ] """ The list of payment method types to exclude from use with this SetupIntent. @@ -79,10 +79,6 @@ class SetupIntentUpdateParams(TypedDict): """ Payment method-specific configuration for this SetupIntent. """ - payment_method_types: NotRequired[List[str]] - """ - The list of payment method types (for example, card) that this SetupIntent can set up. If you don't provide this, Stripe will dynamically show relevant payment methods from your [payment method settings](https://dashboard.stripe.com/settings/payment_methods). A list of valid payment method types can be found [here](https://docs.stripe.com/api/payment_methods/object#payment_method_object-type). - """ setup_details: NotRequired["SetupIntentUpdateParamsSetupDetails"] """ Provides industry-specific information about the SetupIntent. @@ -437,6 +433,7 @@ class SetupIntentUpdateParamsPaymentMethodData(TypedDict): "satispay", "scalapay", "sepa_debit", + "sequra", "shopeepay", "sofort", "stripe_balance", @@ -1141,6 +1138,9 @@ class SetupIntentUpdateParamsPaymentMethodOptionsBacsDebit(TypedDict): """ Additional fields for Mandate creation """ + verification_method: NotRequired[ + Literal["automatic", "payer_name_verification"] + ] class SetupIntentUpdateParamsPaymentMethodOptionsBacsDebitMandateOptions( diff --git a/stripe/params/_subscription_cancel_params.py b/stripe/params/_subscription_cancel_params.py index 0acc4dbe5..fb68cc76d 100644 --- a/stripe/params/_subscription_cancel_params.py +++ b/stripe/params/_subscription_cancel_params.py @@ -37,3 +37,7 @@ class SubscriptionCancelParamsCancellationDetails(TypedDict): """ The customer submitted reason for why they canceled, if the subscription was canceled explicitly by the user. """ + feedback_option: NotRequired[str] + """ + Customized feedback options that provide deeper insight into why the subscription was canceled, if the subscription was canceled explicitly by the user. + """ diff --git a/stripe/params/_subscription_create_params.py b/stripe/params/_subscription_create_params.py index 53ac6dc27..25e6a075c 100644 --- a/stripe/params/_subscription_create_params.py +++ b/stripe/params/_subscription_create_params.py @@ -849,7 +849,7 @@ class SubscriptionCreateParamsPaymentSettings(TypedDict): Payment-method-specific configuration to provide to invoices created by the subscription. """ payment_method_types: NotRequired[ - "Literal['']|List[Union[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'affirm', 'alipay', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'billie', 'bizum', 'blik', 'boleto', 'card', 'cashapp', 'check_scan', 'crypto', 'custom', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'id_bank_transfer', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'mb_way', 'momo', 'multibanco', 'naver_pay', 'nz_bank_account', 'p24', 'pay_by_bank', 'payco', 'paynow', 'paypal', 'paypay', 'payto', 'pix', 'promptpay', 'revolut_pay', 'satispay', 'sepa_credit_transfer', 'sepa_debit', 'sequra', 'sofort', 'stripe_balance', 'swish', 'twint', 'upi', 'us_bank_account', 'vipps', 'wechat_pay'], str]]" + "Literal['']|List[Union[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'affirm', 'alipay', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'billie', 'bizum', 'blik', 'boleto', 'card', 'cashapp', 'check_scan', 'crypto', 'custom', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'id_bank_transfer', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'mb_way', 'momo', 'multibanco', 'naver_pay', 'nz_bank_account', 'p24', 'pay_by_bank', 'payco', 'paynow', 'paypal', 'paypay', 'payto', 'pix', 'promptpay', 'revolut_pay', 'satispay', 'sepa_credit_transfer', 'sepa_debit', 'sequra', 'sofort', 'stripe_balance', 'swish', 'truemoney', 'twint', 'upi', 'us_bank_account', 'vipps', 'wechat_pay'], str]]" ] """ The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). Should not be specified with payment_method_configuration @@ -1083,7 +1083,7 @@ class SubscriptionCreateParamsPaymentSettingsPaymentMethodOptionsBizumMandateOpt """ Amount to be charged for future payments. Required when `amount_type=fixed`. """ - amount_type: Literal["fixed"] + amount_type: Union[Literal["fixed"], str] """ Indicates the mandate amount type. """ diff --git a/stripe/params/_subscription_modify_params.py b/stripe/params/_subscription_modify_params.py index cffdf2b45..ea3d5613d 100644 --- a/stripe/params/_subscription_modify_params.py +++ b/stripe/params/_subscription_modify_params.py @@ -142,6 +142,10 @@ class SubscriptionModifyParams(RequestOptions): """ If specified, the invoicing for the given billing cycle iterations will be processed now. """ + pricing_token: NotRequired[str] + """ + Token used to resolve the presentment currency and FX rate applied to this subscription's adaptive pricing. + """ proration_behavior: NotRequired[ "Literal['always_invoice', 'create_prorations', 'none']|str" ] @@ -418,6 +422,10 @@ class SubscriptionModifyParamsCancellationDetails(TypedDict): """ The customer submitted reason for why they canceled, if the subscription was canceled explicitly by the user. """ + feedback_option: NotRequired[str] + """ + Customized feedback options that provide deeper insight into why the subscription was canceled, if the subscription was canceled explicitly by the user. + """ class SubscriptionModifyParamsDiscount(TypedDict): @@ -821,7 +829,7 @@ class SubscriptionModifyParamsPaymentSettings(TypedDict): Payment-method-specific configuration to provide to invoices created by the subscription. """ payment_method_types: NotRequired[ - "Literal['']|List[Union[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'affirm', 'alipay', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'billie', 'bizum', 'blik', 'boleto', 'card', 'cashapp', 'check_scan', 'crypto', 'custom', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'id_bank_transfer', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'mb_way', 'momo', 'multibanco', 'naver_pay', 'nz_bank_account', 'p24', 'pay_by_bank', 'payco', 'paynow', 'paypal', 'paypay', 'payto', 'pix', 'promptpay', 'revolut_pay', 'satispay', 'sepa_credit_transfer', 'sepa_debit', 'sequra', 'sofort', 'stripe_balance', 'swish', 'twint', 'upi', 'us_bank_account', 'vipps', 'wechat_pay'], str]]" + "Literal['']|List[Union[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'affirm', 'alipay', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'billie', 'bizum', 'blik', 'boleto', 'card', 'cashapp', 'check_scan', 'crypto', 'custom', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'id_bank_transfer', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'mb_way', 'momo', 'multibanco', 'naver_pay', 'nz_bank_account', 'p24', 'pay_by_bank', 'payco', 'paynow', 'paypal', 'paypay', 'payto', 'pix', 'promptpay', 'revolut_pay', 'satispay', 'sepa_credit_transfer', 'sepa_debit', 'sequra', 'sofort', 'stripe_balance', 'swish', 'truemoney', 'twint', 'upi', 'us_bank_account', 'vipps', 'wechat_pay'], str]]" ] """ The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). Should not be specified with payment_method_configuration @@ -1055,7 +1063,7 @@ class SubscriptionModifyParamsPaymentSettingsPaymentMethodOptionsBizumMandateOpt """ Amount to be charged for future payments. Required when `amount_type=fixed`. """ - amount_type: Literal["fixed"] + amount_type: Union[Literal["fixed"], str] """ Indicates the mandate amount type. """ diff --git a/stripe/params/_subscription_pause_params.py b/stripe/params/_subscription_pause_params.py index 8bd4a447e..41e9e5257 100644 --- a/stripe/params/_subscription_pause_params.py +++ b/stripe/params/_subscription_pause_params.py @@ -20,7 +20,7 @@ class SubscriptionPauseParams(RequestOptions): """ Determines how to handle debits and credits when pausing. Defaults to `pending_invoice_item`. """ - type: NotRequired[Literal["subscription"]] + type: NotRequired["Literal['subscription']|str"] """ The type of pause to apply. Defaults to `subscription`. """ diff --git a/stripe/params/_subscription_schedule_create_params.py b/stripe/params/_subscription_schedule_create_params.py index ca234f333..e00245d2e 100644 --- a/stripe/params/_subscription_schedule_create_params.py +++ b/stripe/params/_subscription_schedule_create_params.py @@ -369,7 +369,7 @@ class SubscriptionScheduleCreateParamsPauseSchedulePauseSettings(TypedDict): """ Determines whether to generate an invoice for outstanding amounts when pausing. """ - type: NotRequired[Literal["subscription"]] + type: NotRequired["Literal['subscription']|str"] """ The pause type. Currently only `subscription` is supported. """ diff --git a/stripe/params/_subscription_schedule_modify_params.py b/stripe/params/_subscription_schedule_modify_params.py index 60ef3e566..83c822fe7 100644 --- a/stripe/params/_subscription_schedule_modify_params.py +++ b/stripe/params/_subscription_schedule_modify_params.py @@ -341,7 +341,7 @@ class SubscriptionScheduleModifyParamsPauseSchedulePauseSettings(TypedDict): """ Determines whether to generate an invoice for outstanding amounts when pausing. """ - type: NotRequired[Literal["subscription"]] + type: NotRequired["Literal['subscription']|str"] """ The pause type. Currently only `subscription` is supported. """ diff --git a/stripe/params/_subscription_schedule_update_params.py b/stripe/params/_subscription_schedule_update_params.py index 62b266ac2..cd6149a66 100644 --- a/stripe/params/_subscription_schedule_update_params.py +++ b/stripe/params/_subscription_schedule_update_params.py @@ -340,7 +340,7 @@ class SubscriptionScheduleUpdateParamsPauseSchedulePauseSettings(TypedDict): """ Determines whether to generate an invoice for outstanding amounts when pausing. """ - type: NotRequired[Literal["subscription"]] + type: NotRequired["Literal['subscription']|str"] """ The pause type. Currently only `subscription` is supported. """ diff --git a/stripe/params/_subscription_update_params.py b/stripe/params/_subscription_update_params.py index 378574821..182b2c6dc 100644 --- a/stripe/params/_subscription_update_params.py +++ b/stripe/params/_subscription_update_params.py @@ -141,6 +141,10 @@ class SubscriptionUpdateParams(TypedDict): """ If specified, the invoicing for the given billing cycle iterations will be processed now. """ + pricing_token: NotRequired[str] + """ + Token used to resolve the presentment currency and FX rate applied to this subscription's adaptive pricing. + """ proration_behavior: NotRequired[ "Literal['always_invoice', 'create_prorations', 'none']|str" ] @@ -417,6 +421,10 @@ class SubscriptionUpdateParamsCancellationDetails(TypedDict): """ The customer submitted reason for why they canceled, if the subscription was canceled explicitly by the user. """ + feedback_option: NotRequired[str] + """ + Customized feedback options that provide deeper insight into why the subscription was canceled, if the subscription was canceled explicitly by the user. + """ class SubscriptionUpdateParamsDiscount(TypedDict): @@ -820,7 +828,7 @@ class SubscriptionUpdateParamsPaymentSettings(TypedDict): Payment-method-specific configuration to provide to invoices created by the subscription. """ payment_method_types: NotRequired[ - "Literal['']|List[Union[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'affirm', 'alipay', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'billie', 'bizum', 'blik', 'boleto', 'card', 'cashapp', 'check_scan', 'crypto', 'custom', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'id_bank_transfer', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'mb_way', 'momo', 'multibanco', 'naver_pay', 'nz_bank_account', 'p24', 'pay_by_bank', 'payco', 'paynow', 'paypal', 'paypay', 'payto', 'pix', 'promptpay', 'revolut_pay', 'satispay', 'sepa_credit_transfer', 'sepa_debit', 'sequra', 'sofort', 'stripe_balance', 'swish', 'twint', 'upi', 'us_bank_account', 'vipps', 'wechat_pay'], str]]" + "Literal['']|List[Union[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'affirm', 'alipay', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'billie', 'bizum', 'blik', 'boleto', 'card', 'cashapp', 'check_scan', 'crypto', 'custom', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'id_bank_transfer', 'ideal', 'jp_credit_transfer', 'kakao_pay', 'klarna', 'konbini', 'kr_card', 'link', 'mb_way', 'momo', 'multibanco', 'naver_pay', 'nz_bank_account', 'p24', 'pay_by_bank', 'payco', 'paynow', 'paypal', 'paypay', 'payto', 'pix', 'promptpay', 'revolut_pay', 'satispay', 'sepa_credit_transfer', 'sepa_debit', 'sequra', 'sofort', 'stripe_balance', 'swish', 'truemoney', 'twint', 'upi', 'us_bank_account', 'vipps', 'wechat_pay'], str]]" ] """ The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). Should not be specified with payment_method_configuration @@ -1054,7 +1062,7 @@ class SubscriptionUpdateParamsPaymentSettingsPaymentMethodOptionsBizumMandateOpt """ Amount to be charged for future payments. Required when `amount_type=fixed`. """ - amount_type: Literal["fixed"] + amount_type: Union[Literal["fixed"], str] """ Indicates the mandate amount type. """ diff --git a/stripe/params/_webhook_endpoint_create_params.py b/stripe/params/_webhook_endpoint_create_params.py index 19356f3d2..439acc8cb 100644 --- a/stripe/params/_webhook_endpoint_create_params.py +++ b/stripe/params/_webhook_endpoint_create_params.py @@ -135,6 +135,7 @@ class WebhookEndpointCreateParams(RequestOptions): "2026-05-27.dahlia", "2026-06-24.dahlia", "2026-07-29.dahlia", + "2026-08-26.dahlia", ] ] """ diff --git a/stripe/params/billing/__init__.py b/stripe/params/billing/__init__.py index f07f676fc..ca25ffb34 100644 --- a/stripe/params/billing/__init__.py +++ b/stripe/params/billing/__init__.py @@ -91,6 +91,24 @@ from stripe.params.billing._credit_grant_void_grant_params import ( CreditGrantVoidGrantParams as CreditGrantVoidGrantParams, ) + from stripe.params.billing._feedback_option_create_params import ( + FeedbackOptionCreateParams as FeedbackOptionCreateParams, + ) + from stripe.params.billing._feedback_option_deactivate_params import ( + FeedbackOptionDeactivateParams as FeedbackOptionDeactivateParams, + ) + from stripe.params.billing._feedback_option_list_params import ( + FeedbackOptionListParams as FeedbackOptionListParams, + ) + from stripe.params.billing._feedback_option_modify_params import ( + FeedbackOptionModifyParams as FeedbackOptionModifyParams, + ) + from stripe.params.billing._feedback_option_retrieve_params import ( + FeedbackOptionRetrieveParams as FeedbackOptionRetrieveParams, + ) + from stripe.params.billing._feedback_option_update_params import ( + FeedbackOptionUpdateParams as FeedbackOptionUpdateParams, + ) from stripe.params.billing._meter_create_params import ( MeterCreateParams as MeterCreateParams, MeterCreateParamsCustomerMapping as MeterCreateParamsCustomerMapping, @@ -326,6 +344,30 @@ "stripe.params.billing._credit_grant_void_grant_params", False, ), + "FeedbackOptionCreateParams": ( + "stripe.params.billing._feedback_option_create_params", + False, + ), + "FeedbackOptionDeactivateParams": ( + "stripe.params.billing._feedback_option_deactivate_params", + False, + ), + "FeedbackOptionListParams": ( + "stripe.params.billing._feedback_option_list_params", + False, + ), + "FeedbackOptionModifyParams": ( + "stripe.params.billing._feedback_option_modify_params", + False, + ), + "FeedbackOptionRetrieveParams": ( + "stripe.params.billing._feedback_option_retrieve_params", + False, + ), + "FeedbackOptionUpdateParams": ( + "stripe.params.billing._feedback_option_update_params", + False, + ), "MeterCreateParams": ("stripe.params.billing._meter_create_params", False), "MeterCreateParamsCustomerMapping": ( "stripe.params.billing._meter_create_params", diff --git a/stripe/params/billing/_alert_create_params.py b/stripe/params/billing/_alert_create_params.py index 632590161..fc384ee3b 100644 --- a/stripe/params/billing/_alert_create_params.py +++ b/stripe/params/billing/_alert_create_params.py @@ -167,7 +167,7 @@ class AlertCreateParamsCreditBalanceThresholdLteMonetary(TypedDict): class AlertCreateParamsSpendThreshold(TypedDict): - aggregation_period: Literal["billing"] + aggregation_period: Union[Literal["billing"], str] """ Defines the period over which spend is aggregated. """ diff --git a/stripe/params/billing/_feedback_option_create_params.py b/stripe/params/billing/_feedback_option_create_params.py new file mode 100644 index 000000000..dab92123a --- /dev/null +++ b/stripe/params/billing/_feedback_option_create_params.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._request_options import RequestOptions +from typing import List +from typing_extensions import NotRequired + + +class FeedbackOptionCreateParams(RequestOptions): + description: str + """ + The text of the feedback option, which customers see when canceling. Maximum 100 characters. + """ + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ diff --git a/stripe/params/billing/_feedback_option_deactivate_params.py b/stripe/params/billing/_feedback_option_deactivate_params.py new file mode 100644 index 000000000..6dad454c8 --- /dev/null +++ b/stripe/params/billing/_feedback_option_deactivate_params.py @@ -0,0 +1,12 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._request_options import RequestOptions +from typing import List +from typing_extensions import NotRequired + + +class FeedbackOptionDeactivateParams(RequestOptions): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ diff --git a/stripe/params/billing/_feedback_option_list_params.py b/stripe/params/billing/_feedback_option_list_params.py new file mode 100644 index 000000000..9031f58d0 --- /dev/null +++ b/stripe/params/billing/_feedback_option_list_params.py @@ -0,0 +1,28 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._request_options import RequestOptions +from typing import List +from typing_extensions import Literal, NotRequired + + +class FeedbackOptionListParams(RequestOptions): + ending_before: NotRequired[str] + """ + A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + """ + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + limit: NotRequired[int] + """ + A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. + """ + starting_after: NotRequired[str] + """ + A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + """ + status: NotRequired[Literal["active", "inactive"]] + """ + Filter results to only include feedback options with the given status. + """ diff --git a/stripe/params/billing/_feedback_option_modify_params.py b/stripe/params/billing/_feedback_option_modify_params.py new file mode 100644 index 000000000..6a55d21b2 --- /dev/null +++ b/stripe/params/billing/_feedback_option_modify_params.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._request_options import RequestOptions +from typing import List +from typing_extensions import NotRequired + + +class FeedbackOptionModifyParams(RequestOptions): + description: NotRequired[str] + """ + The text of the feedback option, which customers see when canceling. Maximum 100 characters. + """ + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ diff --git a/stripe/params/billing/_feedback_option_retrieve_params.py b/stripe/params/billing/_feedback_option_retrieve_params.py new file mode 100644 index 000000000..36bc95531 --- /dev/null +++ b/stripe/params/billing/_feedback_option_retrieve_params.py @@ -0,0 +1,12 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._request_options import RequestOptions +from typing import List +from typing_extensions import NotRequired + + +class FeedbackOptionRetrieveParams(RequestOptions): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ diff --git a/stripe/params/billing/_feedback_option_update_params.py b/stripe/params/billing/_feedback_option_update_params.py new file mode 100644 index 000000000..36a6bdee1 --- /dev/null +++ b/stripe/params/billing/_feedback_option_update_params.py @@ -0,0 +1,15 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from typing import List +from typing_extensions import NotRequired, TypedDict + + +class FeedbackOptionUpdateParams(TypedDict): + description: NotRequired[str] + """ + The text of the feedback option, which customers see when canceling. Maximum 100 characters. + """ + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ diff --git a/stripe/params/billing_portal/_configuration_create_params.py b/stripe/params/billing_portal/_configuration_create_params.py index 2f83b4e14..305b11dc0 100644 --- a/stripe/params/billing_portal/_configuration_create_params.py +++ b/stripe/params/billing_portal/_configuration_create_params.py @@ -146,6 +146,10 @@ class ConfigurationCreateParamsFeaturesSubscriptionCancelCancellationReason( """ Whether the feature is enabled. """ + feedback_options: NotRequired["Literal['']|List[str]"] + """ + The IDs of custom feedback options to use for this cancellation reason. + """ options: Union[ Literal[""], List[ diff --git a/stripe/params/billing_portal/_configuration_modify_params.py b/stripe/params/billing_portal/_configuration_modify_params.py index 83dedb8c9..36fed1907 100644 --- a/stripe/params/billing_portal/_configuration_modify_params.py +++ b/stripe/params/billing_portal/_configuration_modify_params.py @@ -152,6 +152,10 @@ class ConfigurationModifyParamsFeaturesSubscriptionCancelCancellationReason( """ Whether the feature is enabled. """ + feedback_options: NotRequired["Literal['']|List[str]"] + """ + The IDs of custom feedback options to use for this cancellation reason. + """ options: NotRequired[ "Literal['']|List[Union[Literal['customer_service', 'low_quality', 'missing_features', 'other', 'switched_service', 'too_complex', 'too_expensive', 'unused'], str]]" ] diff --git a/stripe/params/billing_portal/_configuration_update_params.py b/stripe/params/billing_portal/_configuration_update_params.py index d248f1d66..a0baba565 100644 --- a/stripe/params/billing_portal/_configuration_update_params.py +++ b/stripe/params/billing_portal/_configuration_update_params.py @@ -151,6 +151,10 @@ class ConfigurationUpdateParamsFeaturesSubscriptionCancelCancellationReason( """ Whether the feature is enabled. """ + feedback_options: NotRequired["Literal['']|List[str]"] + """ + The IDs of custom feedback options to use for this cancellation reason. + """ options: NotRequired[ "Literal['']|List[Union[Literal['customer_service', 'low_quality', 'missing_features', 'other', 'switched_service', 'too_complex', 'too_expensive', 'unused'], str]]" ] diff --git a/stripe/params/checkout/__init__.py b/stripe/params/checkout/__init__.py index 123c27c94..82853f6f4 100644 --- a/stripe/params/checkout/__init__.py +++ b/stripe/params/checkout/__init__.py @@ -202,6 +202,7 @@ SessionModifyParamsLineItemPriceDataProductData as SessionModifyParamsLineItemPriceDataProductData, SessionModifyParamsLineItemPriceDataProductDataTaxDetails as SessionModifyParamsLineItemPriceDataProductDataTaxDetails, SessionModifyParamsLineItemPriceDataRecurring as SessionModifyParamsLineItemPriceDataRecurring, + SessionModifyParamsPaymentIntentData as SessionModifyParamsPaymentIntentData, SessionModifyParamsShippingOption as SessionModifyParamsShippingOption, SessionModifyParamsShippingOptionShippingRateData as SessionModifyParamsShippingOptionShippingRateData, SessionModifyParamsShippingOptionShippingRateDataDeliveryEstimate as SessionModifyParamsShippingOptionShippingRateDataDeliveryEstimate, @@ -235,6 +236,7 @@ SessionUpdateParamsLineItemPriceDataProductData as SessionUpdateParamsLineItemPriceDataProductData, SessionUpdateParamsLineItemPriceDataProductDataTaxDetails as SessionUpdateParamsLineItemPriceDataProductDataTaxDetails, SessionUpdateParamsLineItemPriceDataRecurring as SessionUpdateParamsLineItemPriceDataRecurring, + SessionUpdateParamsPaymentIntentData as SessionUpdateParamsPaymentIntentData, SessionUpdateParamsShippingOption as SessionUpdateParamsShippingOption, SessionUpdateParamsShippingOptionShippingRateData as SessionUpdateParamsShippingOptionShippingRateData, SessionUpdateParamsShippingOptionShippingRateDataDeliveryEstimate as SessionUpdateParamsShippingOptionShippingRateDataDeliveryEstimate, @@ -990,6 +992,10 @@ "stripe.params.checkout._session_modify_params", False, ), + "SessionModifyParamsPaymentIntentData": ( + "stripe.params.checkout._session_modify_params", + False, + ), "SessionModifyParamsShippingOption": ( "stripe.params.checkout._session_modify_params", False, @@ -1106,6 +1112,10 @@ "stripe.params.checkout._session_update_params", False, ), + "SessionUpdateParamsPaymentIntentData": ( + "stripe.params.checkout._session_update_params", + False, + ), "SessionUpdateParamsShippingOption": ( "stripe.params.checkout._session_update_params", False, diff --git a/stripe/params/checkout/_session_create_params.py b/stripe/params/checkout/_session_create_params.py index 88dcabafb..c2e30f829 100644 --- a/stripe/params/checkout/_session_create_params.py +++ b/stripe/params/checkout/_session_create_params.py @@ -929,7 +929,7 @@ class SessionCreateParamsItem(TypedDict): """ Configuration for the subscription item. """ - type: Literal["subscription"] + type: Union[Literal["subscription"], str] """ The type of item. """ @@ -1838,7 +1838,7 @@ class SessionCreateParamsPaymentMethodOptionsAfterpayClearpay(TypedDict): class SessionCreateParamsPaymentMethodOptionsAlipay(TypedDict): - setup_future_usage: NotRequired[Literal["none"]] + setup_future_usage: NotRequired["Literal['none']|str"] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. @@ -2090,6 +2090,12 @@ class SessionCreateParamsPaymentMethodOptionsCardRestrictions(TypedDict): """ The card brands to block. If a customer enters or selects a card belonging to a blocked brand, they can't complete the payment. """ + funding_types_blocked: NotRequired[ + List[Union[Literal["credit", "debit", "prepaid"], str]] + ] + """ + Card funding types to block for this Checkout Session. Supported values are `credit`, `debit`, and `prepaid`. + """ class SessionCreateParamsPaymentMethodOptionsCashapp(TypedDict): @@ -2919,7 +2925,7 @@ class SessionCreateParamsPaymentMethodOptionsWechatPay(TypedDict): """ The client type that the end customer will pay from """ - setup_future_usage: NotRequired[Literal["none"]] + setup_future_usage: NotRequired["Literal['none']|str"] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. diff --git a/stripe/params/checkout/_session_modify_params.py b/stripe/params/checkout/_session_modify_params.py index f2bdbba1f..adcbc38af 100644 --- a/stripe/params/checkout/_session_modify_params.py +++ b/stripe/params/checkout/_session_modify_params.py @@ -52,6 +52,12 @@ class SessionModifyParams(RequestOptions): """ Set of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ + payment_intent_data: NotRequired["SessionModifyParamsPaymentIntentData"] + """ + A subset of parameters to be passed to PaymentIntent creation for Checkout Sessions in `payment` mode. + + You can only update these parameters when `ui_mode` is `elements` and while the session is active. + """ shipping_options: NotRequired[ "Literal['']|List[SessionModifyParamsShippingOption]" ] @@ -336,6 +342,53 @@ class SessionModifyParamsLineItemPriceDataRecurring(TypedDict): """ +class SessionModifyParamsPaymentIntentData(TypedDict): + description: NotRequired["Literal['']|str"] + """ + An arbitrary string attached to the object. Often useful for displaying to users. Pass an empty string to clear a previously configured value. + """ + metadata: NotRequired[ + "Literal['']|Dict[str, str]|UntypedStripeObject[str]" + ] + """ + Set of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. + """ + receipt_email: NotRequired["Literal['']|str"] + """ + Email address that the receipt for the resulting payment will be sent to. If `receipt_email` is specified for a payment in live mode, a receipt will be sent regardless of your [email settings](https://dashboard.stripe.com/account/emails). Pass an empty string to clear a previously configured recipient. + """ + setup_future_usage: NotRequired[ + "Literal['']|Literal['off_session', 'on_session']|str" + ] + """ + Indicates that you intend to [make future payments](https://docs.stripe.com/payments/payment-intents#future-usage) with the payment method collected by this Checkout Session. + + When setting this to `on_session`, Checkout will show a notice to the customer that their payment details will be saved. + + When setting this to `off_session`, Checkout will show a notice to the customer that their payment details will be saved and used for future payments. + + If a Customer has been provided or Checkout creates a new Customer, Checkout will attach the payment method to the Customer. + + If Checkout does not create a Customer, the payment method is not attached to a Customer. To reuse the payment method, you can retrieve it from the Checkout Session's PaymentIntent. + + When processing card payments, Checkout also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as SCA. + + Pass an empty string to remove a previously supplied configuration. + """ + statement_descriptor: NotRequired["Literal['']|str"] + """ + Text that appears on the customer's statement as the statement descriptor for a non-card charge. This value overrides the account's default statement descriptor. For information about requirements, including the 22-character limit, see [the Statement Descriptor docs](https://docs.stripe.com/get-started/account/statement-descriptors). + + Setting this value for a card charge returns an error. For card charges, set the [statement_descriptor_suffix](https://docs.stripe.com/get-started/account/statement-descriptors#dynamic) instead. + Pass an empty string to clear a previously configured value. + """ + statement_descriptor_suffix: NotRequired["Literal['']|str"] + """ + Provides information about a card charge. Concatenated to the account's [statement descriptor prefix](https://docs.stripe.com/get-started/account/statement-descriptors#static) to form the complete statement descriptor that appears on the customer's statement. + Pass an empty string to clear a previously configured value. + """ + + class SessionModifyParamsShippingOption(TypedDict): shipping_rate: NotRequired[str] """ diff --git a/stripe/params/checkout/_session_update_params.py b/stripe/params/checkout/_session_update_params.py index c75b99272..721b6a514 100644 --- a/stripe/params/checkout/_session_update_params.py +++ b/stripe/params/checkout/_session_update_params.py @@ -51,6 +51,12 @@ class SessionUpdateParams(TypedDict): """ Set of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ + payment_intent_data: NotRequired["SessionUpdateParamsPaymentIntentData"] + """ + A subset of parameters to be passed to PaymentIntent creation for Checkout Sessions in `payment` mode. + + You can only update these parameters when `ui_mode` is `elements` and while the session is active. + """ shipping_options: NotRequired[ "Literal['']|List[SessionUpdateParamsShippingOption]" ] @@ -335,6 +341,53 @@ class SessionUpdateParamsLineItemPriceDataRecurring(TypedDict): """ +class SessionUpdateParamsPaymentIntentData(TypedDict): + description: NotRequired["Literal['']|str"] + """ + An arbitrary string attached to the object. Often useful for displaying to users. Pass an empty string to clear a previously configured value. + """ + metadata: NotRequired[ + "Literal['']|Dict[str, str]|UntypedStripeObject[str]" + ] + """ + Set of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. + """ + receipt_email: NotRequired["Literal['']|str"] + """ + Email address that the receipt for the resulting payment will be sent to. If `receipt_email` is specified for a payment in live mode, a receipt will be sent regardless of your [email settings](https://dashboard.stripe.com/account/emails). Pass an empty string to clear a previously configured recipient. + """ + setup_future_usage: NotRequired[ + "Literal['']|Literal['off_session', 'on_session']|str" + ] + """ + Indicates that you intend to [make future payments](https://docs.stripe.com/payments/payment-intents#future-usage) with the payment method collected by this Checkout Session. + + When setting this to `on_session`, Checkout will show a notice to the customer that their payment details will be saved. + + When setting this to `off_session`, Checkout will show a notice to the customer that their payment details will be saved and used for future payments. + + If a Customer has been provided or Checkout creates a new Customer, Checkout will attach the payment method to the Customer. + + If Checkout does not create a Customer, the payment method is not attached to a Customer. To reuse the payment method, you can retrieve it from the Checkout Session's PaymentIntent. + + When processing card payments, Checkout also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as SCA. + + Pass an empty string to remove a previously supplied configuration. + """ + statement_descriptor: NotRequired["Literal['']|str"] + """ + Text that appears on the customer's statement as the statement descriptor for a non-card charge. This value overrides the account's default statement descriptor. For information about requirements, including the 22-character limit, see [the Statement Descriptor docs](https://docs.stripe.com/get-started/account/statement-descriptors). + + Setting this value for a card charge returns an error. For card charges, set the [statement_descriptor_suffix](https://docs.stripe.com/get-started/account/statement-descriptors#dynamic) instead. + Pass an empty string to clear a previously configured value. + """ + statement_descriptor_suffix: NotRequired["Literal['']|str"] + """ + Provides information about a card charge. Concatenated to the account's [statement descriptor prefix](https://docs.stripe.com/get-started/account/statement-descriptors#static) to form the complete statement descriptor that appears on the customer's statement. + Pass an empty string to clear a previously configured value. + """ + + class SessionUpdateParamsShippingOption(TypedDict): shipping_rate: NotRequired[str] """ diff --git a/stripe/params/delegated_checkout/_requested_session_create_params.py b/stripe/params/delegated_checkout/_requested_session_create_params.py index 6a13a3d04..ca9f5410e 100644 --- a/stripe/params/delegated_checkout/_requested_session_create_params.py +++ b/stripe/params/delegated_checkout/_requested_session_create_params.py @@ -57,7 +57,7 @@ class RequestedSessionCreateParams(RequestOptions): """ The details of the seller. """ - setup_future_usage: NotRequired[Literal["on_session"]] + setup_future_usage: NotRequired["Literal['on_session']|str"] """ The setup future usage for this requested session. """ diff --git a/stripe/params/radar/__init__.py b/stripe/params/radar/__init__.py index e7f5342f7..3176dca23 100644 --- a/stripe/params/radar/__init__.py +++ b/stripe/params/radar/__init__.py @@ -31,6 +31,20 @@ AccountEvaluationUpdateParamsRegistrationFailed as AccountEvaluationUpdateParamsRegistrationFailed, AccountEvaluationUpdateParamsRegistrationSucceeded as AccountEvaluationUpdateParamsRegistrationSucceeded, ) + from stripe.params.radar._billing_evaluation_create_params import ( + BillingEvaluationCreateParams as BillingEvaluationCreateParams, + BillingEvaluationCreateParamsClientDeviceMetadataDetails as BillingEvaluationCreateParamsClientDeviceMetadataDetails, + BillingEvaluationCreateParamsCustomerDetails as BillingEvaluationCreateParamsCustomerDetails, + BillingEvaluationCreateParamsCustomerDetailsData as BillingEvaluationCreateParamsCustomerDetailsData, + BillingEvaluationCreateParamsPaymentDetails as BillingEvaluationCreateParamsPaymentDetails, + BillingEvaluationCreateParamsPaymentDetailsMoneyMovementDetails as BillingEvaluationCreateParamsPaymentDetailsMoneyMovementDetails, + BillingEvaluationCreateParamsPaymentDetailsMoneyMovementDetailsCard as BillingEvaluationCreateParamsPaymentDetailsMoneyMovementDetailsCard, + BillingEvaluationCreateParamsPaymentDetailsPaymentMethodDetails as BillingEvaluationCreateParamsPaymentDetailsPaymentMethodDetails, + BillingEvaluationCreateParamsPaymentDetailsPaymentMethodDetailsBillingDetails as BillingEvaluationCreateParamsPaymentDetailsPaymentMethodDetailsBillingDetails, + BillingEvaluationCreateParamsPaymentDetailsPaymentMethodDetailsBillingDetailsAddress as BillingEvaluationCreateParamsPaymentDetailsPaymentMethodDetailsBillingDetailsAddress, + BillingEvaluationCreateParamsPaymentDetailsShippingDetails as BillingEvaluationCreateParamsPaymentDetailsShippingDetails, + BillingEvaluationCreateParamsPaymentDetailsShippingDetailsAddress as BillingEvaluationCreateParamsPaymentDetailsShippingDetailsAddress, + ) from stripe.params.radar._customer_evaluation_create_params import ( CustomerEvaluationCreateParams as CustomerEvaluationCreateParams, CustomerEvaluationCreateParamsEvaluationContext as CustomerEvaluationCreateParamsEvaluationContext, @@ -191,6 +205,54 @@ "stripe.params.radar._account_evaluation_update_params", False, ), + "BillingEvaluationCreateParams": ( + "stripe.params.radar._billing_evaluation_create_params", + False, + ), + "BillingEvaluationCreateParamsClientDeviceMetadataDetails": ( + "stripe.params.radar._billing_evaluation_create_params", + False, + ), + "BillingEvaluationCreateParamsCustomerDetails": ( + "stripe.params.radar._billing_evaluation_create_params", + False, + ), + "BillingEvaluationCreateParamsCustomerDetailsData": ( + "stripe.params.radar._billing_evaluation_create_params", + False, + ), + "BillingEvaluationCreateParamsPaymentDetails": ( + "stripe.params.radar._billing_evaluation_create_params", + False, + ), + "BillingEvaluationCreateParamsPaymentDetailsMoneyMovementDetails": ( + "stripe.params.radar._billing_evaluation_create_params", + False, + ), + "BillingEvaluationCreateParamsPaymentDetailsMoneyMovementDetailsCard": ( + "stripe.params.radar._billing_evaluation_create_params", + False, + ), + "BillingEvaluationCreateParamsPaymentDetailsPaymentMethodDetails": ( + "stripe.params.radar._billing_evaluation_create_params", + False, + ), + "BillingEvaluationCreateParamsPaymentDetailsPaymentMethodDetailsBillingDetails": ( + "stripe.params.radar._billing_evaluation_create_params", + False, + ), + "BillingEvaluationCreateParamsPaymentDetailsPaymentMethodDetailsBillingDetailsAddress": ( + "stripe.params.radar._billing_evaluation_create_params", + False, + ), + "BillingEvaluationCreateParamsPaymentDetailsShippingDetails": ( + "stripe.params.radar._billing_evaluation_create_params", + False, + ), + "BillingEvaluationCreateParamsPaymentDetailsShippingDetailsAddress": ( + "stripe.params.radar._billing_evaluation_create_params", + False, + ), "CustomerEvaluationCreateParams": ( "stripe.params.radar._customer_evaluation_create_params", False, diff --git a/stripe/params/radar/_billing_evaluation_create_params.py b/stripe/params/radar/_billing_evaluation_create_params.py new file mode 100644 index 000000000..b33f2d4cc --- /dev/null +++ b/stripe/params/radar/_billing_evaluation_create_params.py @@ -0,0 +1,248 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._request_options import RequestOptions +from stripe._stripe_object import UntypedStripeObject +from typing import Dict, List +from typing_extensions import Literal, NotRequired, TypedDict + + +class BillingEvaluationCreateParams(RequestOptions): + client_device_metadata_details: NotRequired[ + "BillingEvaluationCreateParamsClientDeviceMetadataDetails" + ] + """ + Details about the client device to associate with the billing evaluation. + """ + customer_details: "BillingEvaluationCreateParamsCustomerDetails" + """ + Details about the customer whose upcoming payment is being evaluated. + """ + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + metadata: NotRequired["Dict[str, str]|UntypedStripeObject[str]"] + """ + Set of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. + """ + payment_details: "BillingEvaluationCreateParamsPaymentDetails" + """ + Details about the upcoming payment being evaluated. + """ + + +class BillingEvaluationCreateParamsClientDeviceMetadataDetails(TypedDict): + radar_session: str + """ + ID for the Radar Session to associate with the billing evaluation. A [Radar Session](https://docs.stripe.com/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions about the customer behind the upcoming payment. + """ + + +class BillingEvaluationCreateParamsCustomerDetails(TypedDict): + customer: NotRequired[str] + """ + The ID of the customer whose upcoming payment is being evaluated. + """ + customer_account: NotRequired[str] + """ + The ID of the Account representing the customer whose upcoming payment is being evaluated. + """ + data: NotRequired["BillingEvaluationCreateParamsCustomerDetailsData"] + """ + Attributes of the customer being evaluated. Supply these when the customer isn't represented by a Customer or an Account. If `customer` or `customer_account` is also supplied, the attributes on that object are used and these are ignored. + """ + + +class BillingEvaluationCreateParamsCustomerDetailsData(TypedDict): + email: NotRequired[str] + """ + The email address of the customer being evaluated. + """ + name: NotRequired[str] + """ + The full name or business name of the customer being evaluated. + """ + phone: NotRequired[str] + """ + The phone number of the customer being evaluated. + """ + + +class BillingEvaluationCreateParamsPaymentDetails(TypedDict): + amount: int + """ + The amount that the upcoming payment collects. A positive integer representing how much is charged in the [smallest currency unit](https://docs.stripe.com/currencies#zero-decimal) (for example, 100 cents to charge 1.00 USD or 100 to charge 100 Yen, a zero-decimal currency). + """ + currency: str + """ + Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). + """ + description: NotRequired[str] + """ + An arbitrary description of the upcoming payment. + """ + money_movement_details: NotRequired[ + "BillingEvaluationCreateParamsPaymentDetailsMoneyMovementDetails" + ] + """ + Details about how the money for the upcoming payment moves. + """ + payment_method_details: ( + "BillingEvaluationCreateParamsPaymentDetailsPaymentMethodDetails" + ) + """ + Details about the payment method that the upcoming payment is charged to. + """ + shipping_details: NotRequired[ + "BillingEvaluationCreateParamsPaymentDetailsShippingDetails" + ] + """ + Shipping details for the goods or services covered by the upcoming payment. + """ + statement_descriptor: NotRequired[str] + """ + The statement descriptor that appears on the customer's statement for the upcoming payment. + """ + + +class BillingEvaluationCreateParamsPaymentDetailsMoneyMovementDetails( + TypedDict, +): + card: NotRequired[ + "BillingEvaluationCreateParamsPaymentDetailsMoneyMovementDetailsCard" + ] + """ + Describes card money movement details. + """ + money_movement_type: Literal["card"] + """ + Describes the type of money movement. Currently only `card` is supported. + """ + + +class BillingEvaluationCreateParamsPaymentDetailsMoneyMovementDetailsCard( + TypedDict, +): + customer_presence: NotRequired["Literal['off_session', 'on_session']|str"] + """ + Describes the presence of the customer during the payment. + """ + payment_type: NotRequired[ + "Literal['one_off', 'recurring', 'setup_one_off', 'setup_recurring']|str" + ] + """ + Describes the type of payment. + """ + + +class BillingEvaluationCreateParamsPaymentDetailsPaymentMethodDetails( + TypedDict, +): + billing_details: NotRequired[ + "BillingEvaluationCreateParamsPaymentDetailsPaymentMethodDetailsBillingDetails" + ] + """ + Billing information associated with the payment method used for the upcoming payment. + """ + payment_method: str + """ + ID of the payment method that the upcoming payment is charged to. + """ + + +class BillingEvaluationCreateParamsPaymentDetailsPaymentMethodDetailsBillingDetails( + TypedDict, +): + address: NotRequired[ + "BillingEvaluationCreateParamsPaymentDetailsPaymentMethodDetailsBillingDetailsAddress" + ] + """ + Billing address. + """ + email: NotRequired[str] + """ + Email address. + """ + name: NotRequired[str] + """ + Full name. + """ + phone: NotRequired[str] + """ + Billing phone number (including extension). + """ + + +class BillingEvaluationCreateParamsPaymentDetailsPaymentMethodDetailsBillingDetailsAddress( + TypedDict, +): + city: NotRequired[str] + """ + City, district, suburb, town, or village. + """ + country: NotRequired[str] + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: NotRequired[str] + """ + Address line 1, such as the street, PO Box, or company name. + """ + line2: NotRequired[str] + """ + Address line 2, such as the apartment, suite, unit, or building. + """ + postal_code: NotRequired[str] + """ + ZIP or postal code. + """ + state: NotRequired[str] + """ + State, county, province, or region ([ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2)). + """ + + +class BillingEvaluationCreateParamsPaymentDetailsShippingDetails(TypedDict): + address: NotRequired[ + "BillingEvaluationCreateParamsPaymentDetailsShippingDetailsAddress" + ] + """ + Shipping address. + """ + name: NotRequired[str] + """ + Shipping name. + """ + phone: NotRequired[str] + """ + Shipping phone number. + """ + + +class BillingEvaluationCreateParamsPaymentDetailsShippingDetailsAddress( + TypedDict, +): + city: NotRequired[str] + """ + City, district, suburb, town, or village. + """ + country: NotRequired[str] + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: NotRequired[str] + """ + Address line 1, such as the street, PO Box, or company name. + """ + line2: NotRequired[str] + """ + Address line 2, such as the apartment, suite, unit, or building. + """ + postal_code: NotRequired[str] + """ + ZIP or postal code. + """ + state: NotRequired[str] + """ + State, county, province, or region ([ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2)). + """ diff --git a/stripe/params/radar/_payment_evaluation_create_params.py b/stripe/params/radar/_payment_evaluation_create_params.py index 186a30852..8e44d621d 100644 --- a/stripe/params/radar/_payment_evaluation_create_params.py +++ b/stripe/params/radar/_payment_evaluation_create_params.py @@ -134,7 +134,7 @@ class PaymentEvaluationCreateParamsPaymentDetailsMoneyMovementDetails( "PaymentEvaluationCreateParamsPaymentDetailsMoneyMovementDetailsCard" ] """ - Describes card money movement details for the payment evaluation. + Describes card money movement details. """ money_movement_type: Literal["card"] """ diff --git a/stripe/params/shared_payment/__init__.py b/stripe/params/shared_payment/__init__.py index 6da5ed91c..ec8fc0913 100644 --- a/stripe/params/shared_payment/__init__.py +++ b/stripe/params/shared_payment/__init__.py @@ -7,6 +7,7 @@ from stripe.params.shared_payment._granted_token_create_params import ( GrantedTokenCreateParams as GrantedTokenCreateParams, GrantedTokenCreateParamsUsageLimits as GrantedTokenCreateParamsUsageLimits, + GrantedTokenCreateParamsUsageLimitsRecurring as GrantedTokenCreateParamsUsageLimitsRecurring, ) from stripe.params.shared_payment._granted_token_retrieve_params import ( GrantedTokenRetrieveParams as GrantedTokenRetrieveParams, @@ -18,6 +19,7 @@ IssuedTokenCreateParams as IssuedTokenCreateParams, IssuedTokenCreateParamsSellerDetails as IssuedTokenCreateParamsSellerDetails, IssuedTokenCreateParamsUsageLimits as IssuedTokenCreateParamsUsageLimits, + IssuedTokenCreateParamsUsageLimitsRecurring as IssuedTokenCreateParamsUsageLimitsRecurring, ) from stripe.params.shared_payment._issued_token_retrieve_params import ( IssuedTokenRetrieveParams as IssuedTokenRetrieveParams, @@ -36,6 +38,10 @@ "stripe.params.shared_payment._granted_token_create_params", False, ), + "GrantedTokenCreateParamsUsageLimitsRecurring": ( + "stripe.params.shared_payment._granted_token_create_params", + False, + ), "GrantedTokenRetrieveParams": ( "stripe.params.shared_payment._granted_token_retrieve_params", False, @@ -56,6 +62,10 @@ "stripe.params.shared_payment._issued_token_create_params", False, ), + "IssuedTokenCreateParamsUsageLimitsRecurring": ( + "stripe.params.shared_payment._issued_token_create_params", + False, + ), "IssuedTokenRetrieveParams": ( "stripe.params.shared_payment._issued_token_retrieve_params", False, diff --git a/stripe/params/shared_payment/_granted_token_create_params.py b/stripe/params/shared_payment/_granted_token_create_params.py index ac2067ac8..e83758ce8 100644 --- a/stripe/params/shared_payment/_granted_token_create_params.py +++ b/stripe/params/shared_payment/_granted_token_create_params.py @@ -2,7 +2,7 @@ # File generated from our OpenAPI spec from stripe._request_options import RequestOptions from stripe._stripe_object import UntypedStripeObject -from typing import Dict, List +from typing import Dict, List, Union from typing_extensions import Literal, NotRequired, TypedDict @@ -44,7 +44,22 @@ class GrantedTokenCreateParamsUsageLimits(TypedDict): """ Max amount that can be captured using this SharedPaymentToken """ + recurring: NotRequired["GrantedTokenCreateParamsUsageLimitsRecurring"] + """ + The recurring schedule for the shared payment token's amount usage restrictions. + """ recurring_interval: NotRequired["Literal['month', 'week', 'year']|str"] """ The recurring interval at which the shared payment token's amount usage restrictions reset. """ + + +class GrantedTokenCreateParamsUsageLimitsRecurring(TypedDict): + interval: Union[Literal["day", "month", "week", "year"], str] + """ + The interval at which the shared payment token's amount usage restrictions reset. + """ + interval_count: NotRequired[int] + """ + The number of intervals between each reset. Defaults to 1. + """ diff --git a/stripe/params/shared_payment/_issued_token_create_params.py b/stripe/params/shared_payment/_issued_token_create_params.py index 3d13d18f4..fcb2694f5 100644 --- a/stripe/params/shared_payment/_issued_token_create_params.py +++ b/stripe/params/shared_payment/_issued_token_create_params.py @@ -2,7 +2,7 @@ # File generated from our OpenAPI spec from stripe._request_options import RequestOptions from stripe._stripe_object import UntypedStripeObject -from typing import Dict, List +from typing import Dict, List, Union from typing_extensions import Literal, NotRequired, TypedDict @@ -65,7 +65,22 @@ class IssuedTokenCreateParamsUsageLimits(TypedDict): """ Max amount that can be captured using this SharedPaymentToken """ + recurring: NotRequired["IssuedTokenCreateParamsUsageLimitsRecurring"] + """ + The recurring schedule for the shared payment token's amount usage restrictions. + """ recurring_interval: NotRequired["Literal['month', 'week', 'year']|str"] """ The recurring interval at which the shared payment token's amount usage restrictions reset. """ + + +class IssuedTokenCreateParamsUsageLimitsRecurring(TypedDict): + interval: Union[Literal["day", "month", "week", "year"], str] + """ + The interval at which the shared payment token's amount usage restrictions reset. + """ + interval_count: NotRequired[int] + """ + The number of intervals between each reset. Defaults to 1. + """ diff --git a/stripe/params/tax/__init__.py b/stripe/params/tax/__init__.py index dd4d5c35e..f6f1c4619 100644 --- a/stripe/params/tax/__init__.py +++ b/stripe/params/tax/__init__.py @@ -59,6 +59,7 @@ RegistrationCreateParamsCountryOptionsAo as RegistrationCreateParamsCountryOptionsAo, RegistrationCreateParamsCountryOptionsAoStandard as RegistrationCreateParamsCountryOptionsAoStandard, RegistrationCreateParamsCountryOptionsAt as RegistrationCreateParamsCountryOptionsAt, + RegistrationCreateParamsCountryOptionsAtIgic as RegistrationCreateParamsCountryOptionsAtIgic, RegistrationCreateParamsCountryOptionsAtStandard as RegistrationCreateParamsCountryOptionsAtStandard, RegistrationCreateParamsCountryOptionsAu as RegistrationCreateParamsCountryOptionsAu, RegistrationCreateParamsCountryOptionsAuStandard as RegistrationCreateParamsCountryOptionsAuStandard, @@ -72,10 +73,12 @@ RegistrationCreateParamsCountryOptionsBd as RegistrationCreateParamsCountryOptionsBd, RegistrationCreateParamsCountryOptionsBdStandard as RegistrationCreateParamsCountryOptionsBdStandard, RegistrationCreateParamsCountryOptionsBe as RegistrationCreateParamsCountryOptionsBe, + RegistrationCreateParamsCountryOptionsBeIgic as RegistrationCreateParamsCountryOptionsBeIgic, RegistrationCreateParamsCountryOptionsBeStandard as RegistrationCreateParamsCountryOptionsBeStandard, RegistrationCreateParamsCountryOptionsBf as RegistrationCreateParamsCountryOptionsBf, RegistrationCreateParamsCountryOptionsBfStandard as RegistrationCreateParamsCountryOptionsBfStandard, RegistrationCreateParamsCountryOptionsBg as RegistrationCreateParamsCountryOptionsBg, + RegistrationCreateParamsCountryOptionsBgIgic as RegistrationCreateParamsCountryOptionsBgIgic, RegistrationCreateParamsCountryOptionsBgStandard as RegistrationCreateParamsCountryOptionsBgStandard, RegistrationCreateParamsCountryOptionsBh as RegistrationCreateParamsCountryOptionsBh, RegistrationCreateParamsCountryOptionsBhStandard as RegistrationCreateParamsCountryOptionsBhStandard, @@ -95,24 +98,32 @@ RegistrationCreateParamsCountryOptionsCr as RegistrationCreateParamsCountryOptionsCr, RegistrationCreateParamsCountryOptionsCv as RegistrationCreateParamsCountryOptionsCv, RegistrationCreateParamsCountryOptionsCy as RegistrationCreateParamsCountryOptionsCy, + RegistrationCreateParamsCountryOptionsCyIgic as RegistrationCreateParamsCountryOptionsCyIgic, RegistrationCreateParamsCountryOptionsCyStandard as RegistrationCreateParamsCountryOptionsCyStandard, RegistrationCreateParamsCountryOptionsCz as RegistrationCreateParamsCountryOptionsCz, + RegistrationCreateParamsCountryOptionsCzIgic as RegistrationCreateParamsCountryOptionsCzIgic, RegistrationCreateParamsCountryOptionsCzStandard as RegistrationCreateParamsCountryOptionsCzStandard, RegistrationCreateParamsCountryOptionsDe as RegistrationCreateParamsCountryOptionsDe, + RegistrationCreateParamsCountryOptionsDeIgic as RegistrationCreateParamsCountryOptionsDeIgic, RegistrationCreateParamsCountryOptionsDeStandard as RegistrationCreateParamsCountryOptionsDeStandard, RegistrationCreateParamsCountryOptionsDk as RegistrationCreateParamsCountryOptionsDk, + RegistrationCreateParamsCountryOptionsDkIgic as RegistrationCreateParamsCountryOptionsDkIgic, RegistrationCreateParamsCountryOptionsDkStandard as RegistrationCreateParamsCountryOptionsDkStandard, RegistrationCreateParamsCountryOptionsEc as RegistrationCreateParamsCountryOptionsEc, RegistrationCreateParamsCountryOptionsEe as RegistrationCreateParamsCountryOptionsEe, + RegistrationCreateParamsCountryOptionsEeIgic as RegistrationCreateParamsCountryOptionsEeIgic, RegistrationCreateParamsCountryOptionsEeStandard as RegistrationCreateParamsCountryOptionsEeStandard, RegistrationCreateParamsCountryOptionsEg as RegistrationCreateParamsCountryOptionsEg, RegistrationCreateParamsCountryOptionsEs as RegistrationCreateParamsCountryOptionsEs, + RegistrationCreateParamsCountryOptionsEsIgic as RegistrationCreateParamsCountryOptionsEsIgic, RegistrationCreateParamsCountryOptionsEsStandard as RegistrationCreateParamsCountryOptionsEsStandard, RegistrationCreateParamsCountryOptionsEt as RegistrationCreateParamsCountryOptionsEt, RegistrationCreateParamsCountryOptionsEtStandard as RegistrationCreateParamsCountryOptionsEtStandard, RegistrationCreateParamsCountryOptionsFi as RegistrationCreateParamsCountryOptionsFi, + RegistrationCreateParamsCountryOptionsFiIgic as RegistrationCreateParamsCountryOptionsFiIgic, RegistrationCreateParamsCountryOptionsFiStandard as RegistrationCreateParamsCountryOptionsFiStandard, RegistrationCreateParamsCountryOptionsFr as RegistrationCreateParamsCountryOptionsFr, + RegistrationCreateParamsCountryOptionsFrIgic as RegistrationCreateParamsCountryOptionsFrIgic, RegistrationCreateParamsCountryOptionsFrStandard as RegistrationCreateParamsCountryOptionsFrStandard, RegistrationCreateParamsCountryOptionsGb as RegistrationCreateParamsCountryOptionsGb, RegistrationCreateParamsCountryOptionsGbStandard as RegistrationCreateParamsCountryOptionsGbStandard, @@ -120,18 +131,23 @@ RegistrationCreateParamsCountryOptionsGn as RegistrationCreateParamsCountryOptionsGn, RegistrationCreateParamsCountryOptionsGnStandard as RegistrationCreateParamsCountryOptionsGnStandard, RegistrationCreateParamsCountryOptionsGr as RegistrationCreateParamsCountryOptionsGr, + RegistrationCreateParamsCountryOptionsGrIgic as RegistrationCreateParamsCountryOptionsGrIgic, RegistrationCreateParamsCountryOptionsGrStandard as RegistrationCreateParamsCountryOptionsGrStandard, RegistrationCreateParamsCountryOptionsHr as RegistrationCreateParamsCountryOptionsHr, + RegistrationCreateParamsCountryOptionsHrIgic as RegistrationCreateParamsCountryOptionsHrIgic, RegistrationCreateParamsCountryOptionsHrStandard as RegistrationCreateParamsCountryOptionsHrStandard, RegistrationCreateParamsCountryOptionsHu as RegistrationCreateParamsCountryOptionsHu, + RegistrationCreateParamsCountryOptionsHuIgic as RegistrationCreateParamsCountryOptionsHuIgic, RegistrationCreateParamsCountryOptionsHuStandard as RegistrationCreateParamsCountryOptionsHuStandard, RegistrationCreateParamsCountryOptionsId as RegistrationCreateParamsCountryOptionsId, RegistrationCreateParamsCountryOptionsIe as RegistrationCreateParamsCountryOptionsIe, + RegistrationCreateParamsCountryOptionsIeIgic as RegistrationCreateParamsCountryOptionsIeIgic, RegistrationCreateParamsCountryOptionsIeStandard as RegistrationCreateParamsCountryOptionsIeStandard, RegistrationCreateParamsCountryOptionsIn as RegistrationCreateParamsCountryOptionsIn, RegistrationCreateParamsCountryOptionsIs as RegistrationCreateParamsCountryOptionsIs, RegistrationCreateParamsCountryOptionsIsStandard as RegistrationCreateParamsCountryOptionsIsStandard, RegistrationCreateParamsCountryOptionsIt as RegistrationCreateParamsCountryOptionsIt, + RegistrationCreateParamsCountryOptionsItIgic as RegistrationCreateParamsCountryOptionsItIgic, RegistrationCreateParamsCountryOptionsItStandard as RegistrationCreateParamsCountryOptionsItStandard, RegistrationCreateParamsCountryOptionsJp as RegistrationCreateParamsCountryOptionsJp, RegistrationCreateParamsCountryOptionsJpStandard as RegistrationCreateParamsCountryOptionsJpStandard, @@ -143,10 +159,13 @@ RegistrationCreateParamsCountryOptionsLa as RegistrationCreateParamsCountryOptionsLa, RegistrationCreateParamsCountryOptionsLk as RegistrationCreateParamsCountryOptionsLk, RegistrationCreateParamsCountryOptionsLt as RegistrationCreateParamsCountryOptionsLt, + RegistrationCreateParamsCountryOptionsLtIgic as RegistrationCreateParamsCountryOptionsLtIgic, RegistrationCreateParamsCountryOptionsLtStandard as RegistrationCreateParamsCountryOptionsLtStandard, RegistrationCreateParamsCountryOptionsLu as RegistrationCreateParamsCountryOptionsLu, + RegistrationCreateParamsCountryOptionsLuIgic as RegistrationCreateParamsCountryOptionsLuIgic, RegistrationCreateParamsCountryOptionsLuStandard as RegistrationCreateParamsCountryOptionsLuStandard, RegistrationCreateParamsCountryOptionsLv as RegistrationCreateParamsCountryOptionsLv, + RegistrationCreateParamsCountryOptionsLvIgic as RegistrationCreateParamsCountryOptionsLvIgic, RegistrationCreateParamsCountryOptionsLvStandard as RegistrationCreateParamsCountryOptionsLvStandard, RegistrationCreateParamsCountryOptionsMa as RegistrationCreateParamsCountryOptionsMa, RegistrationCreateParamsCountryOptionsMd as RegistrationCreateParamsCountryOptionsMd, @@ -157,11 +176,13 @@ RegistrationCreateParamsCountryOptionsMr as RegistrationCreateParamsCountryOptionsMr, RegistrationCreateParamsCountryOptionsMrStandard as RegistrationCreateParamsCountryOptionsMrStandard, RegistrationCreateParamsCountryOptionsMt as RegistrationCreateParamsCountryOptionsMt, + RegistrationCreateParamsCountryOptionsMtIgic as RegistrationCreateParamsCountryOptionsMtIgic, RegistrationCreateParamsCountryOptionsMtStandard as RegistrationCreateParamsCountryOptionsMtStandard, RegistrationCreateParamsCountryOptionsMx as RegistrationCreateParamsCountryOptionsMx, RegistrationCreateParamsCountryOptionsMy as RegistrationCreateParamsCountryOptionsMy, RegistrationCreateParamsCountryOptionsNg as RegistrationCreateParamsCountryOptionsNg, RegistrationCreateParamsCountryOptionsNl as RegistrationCreateParamsCountryOptionsNl, + RegistrationCreateParamsCountryOptionsNlIgic as RegistrationCreateParamsCountryOptionsNlIgic, RegistrationCreateParamsCountryOptionsNlStandard as RegistrationCreateParamsCountryOptionsNlStandard, RegistrationCreateParamsCountryOptionsNo as RegistrationCreateParamsCountryOptionsNo, RegistrationCreateParamsCountryOptionsNoStandard as RegistrationCreateParamsCountryOptionsNoStandard, @@ -173,22 +194,28 @@ RegistrationCreateParamsCountryOptionsPe as RegistrationCreateParamsCountryOptionsPe, RegistrationCreateParamsCountryOptionsPh as RegistrationCreateParamsCountryOptionsPh, RegistrationCreateParamsCountryOptionsPl as RegistrationCreateParamsCountryOptionsPl, + RegistrationCreateParamsCountryOptionsPlIgic as RegistrationCreateParamsCountryOptionsPlIgic, RegistrationCreateParamsCountryOptionsPlStandard as RegistrationCreateParamsCountryOptionsPlStandard, RegistrationCreateParamsCountryOptionsPt as RegistrationCreateParamsCountryOptionsPt, + RegistrationCreateParamsCountryOptionsPtIgic as RegistrationCreateParamsCountryOptionsPtIgic, RegistrationCreateParamsCountryOptionsPtStandard as RegistrationCreateParamsCountryOptionsPtStandard, RegistrationCreateParamsCountryOptionsRo as RegistrationCreateParamsCountryOptionsRo, + RegistrationCreateParamsCountryOptionsRoIgic as RegistrationCreateParamsCountryOptionsRoIgic, RegistrationCreateParamsCountryOptionsRoStandard as RegistrationCreateParamsCountryOptionsRoStandard, RegistrationCreateParamsCountryOptionsRs as RegistrationCreateParamsCountryOptionsRs, RegistrationCreateParamsCountryOptionsRsStandard as RegistrationCreateParamsCountryOptionsRsStandard, RegistrationCreateParamsCountryOptionsRu as RegistrationCreateParamsCountryOptionsRu, RegistrationCreateParamsCountryOptionsSa as RegistrationCreateParamsCountryOptionsSa, RegistrationCreateParamsCountryOptionsSe as RegistrationCreateParamsCountryOptionsSe, + RegistrationCreateParamsCountryOptionsSeIgic as RegistrationCreateParamsCountryOptionsSeIgic, RegistrationCreateParamsCountryOptionsSeStandard as RegistrationCreateParamsCountryOptionsSeStandard, RegistrationCreateParamsCountryOptionsSg as RegistrationCreateParamsCountryOptionsSg, RegistrationCreateParamsCountryOptionsSgStandard as RegistrationCreateParamsCountryOptionsSgStandard, RegistrationCreateParamsCountryOptionsSi as RegistrationCreateParamsCountryOptionsSi, + RegistrationCreateParamsCountryOptionsSiIgic as RegistrationCreateParamsCountryOptionsSiIgic, RegistrationCreateParamsCountryOptionsSiStandard as RegistrationCreateParamsCountryOptionsSiStandard, RegistrationCreateParamsCountryOptionsSk as RegistrationCreateParamsCountryOptionsSk, + RegistrationCreateParamsCountryOptionsSkIgic as RegistrationCreateParamsCountryOptionsSkIgic, RegistrationCreateParamsCountryOptionsSkStandard as RegistrationCreateParamsCountryOptionsSkStandard, RegistrationCreateParamsCountryOptionsSn as RegistrationCreateParamsCountryOptionsSn, RegistrationCreateParamsCountryOptionsSr as RegistrationCreateParamsCountryOptionsSr, @@ -386,6 +413,10 @@ "stripe.params.tax._registration_create_params", False, ), + "RegistrationCreateParamsCountryOptionsAtIgic": ( + "stripe.params.tax._registration_create_params", + False, + ), "RegistrationCreateParamsCountryOptionsAtStandard": ( "stripe.params.tax._registration_create_params", False, @@ -438,6 +469,10 @@ "stripe.params.tax._registration_create_params", False, ), + "RegistrationCreateParamsCountryOptionsBeIgic": ( + "stripe.params.tax._registration_create_params", + False, + ), "RegistrationCreateParamsCountryOptionsBeStandard": ( "stripe.params.tax._registration_create_params", False, @@ -454,6 +489,10 @@ "stripe.params.tax._registration_create_params", False, ), + "RegistrationCreateParamsCountryOptionsBgIgic": ( + "stripe.params.tax._registration_create_params", + False, + ), "RegistrationCreateParamsCountryOptionsBgStandard": ( "stripe.params.tax._registration_create_params", False, @@ -530,6 +569,10 @@ "stripe.params.tax._registration_create_params", False, ), + "RegistrationCreateParamsCountryOptionsCyIgic": ( + "stripe.params.tax._registration_create_params", + False, + ), "RegistrationCreateParamsCountryOptionsCyStandard": ( "stripe.params.tax._registration_create_params", False, @@ -538,6 +581,10 @@ "stripe.params.tax._registration_create_params", False, ), + "RegistrationCreateParamsCountryOptionsCzIgic": ( + "stripe.params.tax._registration_create_params", + False, + ), "RegistrationCreateParamsCountryOptionsCzStandard": ( "stripe.params.tax._registration_create_params", False, @@ -546,6 +593,10 @@ "stripe.params.tax._registration_create_params", False, ), + "RegistrationCreateParamsCountryOptionsDeIgic": ( + "stripe.params.tax._registration_create_params", + False, + ), "RegistrationCreateParamsCountryOptionsDeStandard": ( "stripe.params.tax._registration_create_params", False, @@ -554,6 +605,10 @@ "stripe.params.tax._registration_create_params", False, ), + "RegistrationCreateParamsCountryOptionsDkIgic": ( + "stripe.params.tax._registration_create_params", + False, + ), "RegistrationCreateParamsCountryOptionsDkStandard": ( "stripe.params.tax._registration_create_params", False, @@ -566,6 +621,10 @@ "stripe.params.tax._registration_create_params", False, ), + "RegistrationCreateParamsCountryOptionsEeIgic": ( + "stripe.params.tax._registration_create_params", + False, + ), "RegistrationCreateParamsCountryOptionsEeStandard": ( "stripe.params.tax._registration_create_params", False, @@ -578,6 +637,10 @@ "stripe.params.tax._registration_create_params", False, ), + "RegistrationCreateParamsCountryOptionsEsIgic": ( + "stripe.params.tax._registration_create_params", + False, + ), "RegistrationCreateParamsCountryOptionsEsStandard": ( "stripe.params.tax._registration_create_params", False, @@ -594,6 +657,10 @@ "stripe.params.tax._registration_create_params", False, ), + "RegistrationCreateParamsCountryOptionsFiIgic": ( + "stripe.params.tax._registration_create_params", + False, + ), "RegistrationCreateParamsCountryOptionsFiStandard": ( "stripe.params.tax._registration_create_params", False, @@ -602,6 +669,10 @@ "stripe.params.tax._registration_create_params", False, ), + "RegistrationCreateParamsCountryOptionsFrIgic": ( + "stripe.params.tax._registration_create_params", + False, + ), "RegistrationCreateParamsCountryOptionsFrStandard": ( "stripe.params.tax._registration_create_params", False, @@ -630,6 +701,10 @@ "stripe.params.tax._registration_create_params", False, ), + "RegistrationCreateParamsCountryOptionsGrIgic": ( + "stripe.params.tax._registration_create_params", + False, + ), "RegistrationCreateParamsCountryOptionsGrStandard": ( "stripe.params.tax._registration_create_params", False, @@ -638,6 +713,10 @@ "stripe.params.tax._registration_create_params", False, ), + "RegistrationCreateParamsCountryOptionsHrIgic": ( + "stripe.params.tax._registration_create_params", + False, + ), "RegistrationCreateParamsCountryOptionsHrStandard": ( "stripe.params.tax._registration_create_params", False, @@ -646,6 +725,10 @@ "stripe.params.tax._registration_create_params", False, ), + "RegistrationCreateParamsCountryOptionsHuIgic": ( + "stripe.params.tax._registration_create_params", + False, + ), "RegistrationCreateParamsCountryOptionsHuStandard": ( "stripe.params.tax._registration_create_params", False, @@ -658,6 +741,10 @@ "stripe.params.tax._registration_create_params", False, ), + "RegistrationCreateParamsCountryOptionsIeIgic": ( + "stripe.params.tax._registration_create_params", + False, + ), "RegistrationCreateParamsCountryOptionsIeStandard": ( "stripe.params.tax._registration_create_params", False, @@ -678,6 +765,10 @@ "stripe.params.tax._registration_create_params", False, ), + "RegistrationCreateParamsCountryOptionsItIgic": ( + "stripe.params.tax._registration_create_params", + False, + ), "RegistrationCreateParamsCountryOptionsItStandard": ( "stripe.params.tax._registration_create_params", False, @@ -722,6 +813,10 @@ "stripe.params.tax._registration_create_params", False, ), + "RegistrationCreateParamsCountryOptionsLtIgic": ( + "stripe.params.tax._registration_create_params", + False, + ), "RegistrationCreateParamsCountryOptionsLtStandard": ( "stripe.params.tax._registration_create_params", False, @@ -730,6 +825,10 @@ "stripe.params.tax._registration_create_params", False, ), + "RegistrationCreateParamsCountryOptionsLuIgic": ( + "stripe.params.tax._registration_create_params", + False, + ), "RegistrationCreateParamsCountryOptionsLuStandard": ( "stripe.params.tax._registration_create_params", False, @@ -738,6 +837,10 @@ "stripe.params.tax._registration_create_params", False, ), + "RegistrationCreateParamsCountryOptionsLvIgic": ( + "stripe.params.tax._registration_create_params", + False, + ), "RegistrationCreateParamsCountryOptionsLvStandard": ( "stripe.params.tax._registration_create_params", False, @@ -778,6 +881,10 @@ "stripe.params.tax._registration_create_params", False, ), + "RegistrationCreateParamsCountryOptionsMtIgic": ( + "stripe.params.tax._registration_create_params", + False, + ), "RegistrationCreateParamsCountryOptionsMtStandard": ( "stripe.params.tax._registration_create_params", False, @@ -798,6 +905,10 @@ "stripe.params.tax._registration_create_params", False, ), + "RegistrationCreateParamsCountryOptionsNlIgic": ( + "stripe.params.tax._registration_create_params", + False, + ), "RegistrationCreateParamsCountryOptionsNlStandard": ( "stripe.params.tax._registration_create_params", False, @@ -842,6 +953,10 @@ "stripe.params.tax._registration_create_params", False, ), + "RegistrationCreateParamsCountryOptionsPlIgic": ( + "stripe.params.tax._registration_create_params", + False, + ), "RegistrationCreateParamsCountryOptionsPlStandard": ( "stripe.params.tax._registration_create_params", False, @@ -850,6 +965,10 @@ "stripe.params.tax._registration_create_params", False, ), + "RegistrationCreateParamsCountryOptionsPtIgic": ( + "stripe.params.tax._registration_create_params", + False, + ), "RegistrationCreateParamsCountryOptionsPtStandard": ( "stripe.params.tax._registration_create_params", False, @@ -858,6 +977,10 @@ "stripe.params.tax._registration_create_params", False, ), + "RegistrationCreateParamsCountryOptionsRoIgic": ( + "stripe.params.tax._registration_create_params", + False, + ), "RegistrationCreateParamsCountryOptionsRoStandard": ( "stripe.params.tax._registration_create_params", False, @@ -882,6 +1005,10 @@ "stripe.params.tax._registration_create_params", False, ), + "RegistrationCreateParamsCountryOptionsSeIgic": ( + "stripe.params.tax._registration_create_params", + False, + ), "RegistrationCreateParamsCountryOptionsSeStandard": ( "stripe.params.tax._registration_create_params", False, @@ -898,6 +1025,10 @@ "stripe.params.tax._registration_create_params", False, ), + "RegistrationCreateParamsCountryOptionsSiIgic": ( + "stripe.params.tax._registration_create_params", + False, + ), "RegistrationCreateParamsCountryOptionsSiStandard": ( "stripe.params.tax._registration_create_params", False, @@ -906,6 +1037,10 @@ "stripe.params.tax._registration_create_params", False, ), + "RegistrationCreateParamsCountryOptionsSkIgic": ( + "stripe.params.tax._registration_create_params", + False, + ), "RegistrationCreateParamsCountryOptionsSkStandard": ( "stripe.params.tax._registration_create_params", False, diff --git a/stripe/params/tax/_registration_create_params.py b/stripe/params/tax/_registration_create_params.py index a3ff7e09d..4720ec44a 100644 --- a/stripe/params/tax/_registration_create_params.py +++ b/stripe/params/tax/_registration_create_params.py @@ -506,6 +506,10 @@ class RegistrationCreateParamsCountryOptionsAoStandard(TypedDict): class RegistrationCreateParamsCountryOptionsAt(TypedDict): + igic: NotRequired["RegistrationCreateParamsCountryOptionsAtIgic"] + """ + Options for the IGIC registration. + """ standard: NotRequired["RegistrationCreateParamsCountryOptionsAtStandard"] """ Options for the standard registration. @@ -516,6 +520,13 @@ class RegistrationCreateParamsCountryOptionsAt(TypedDict): """ +class RegistrationCreateParamsCountryOptionsAtIgic(TypedDict): + place_of_supply_scheme: Literal["inbound_goods", "standard"] + """ + Place of supply scheme used in an IGIC registration. + """ + + class RegistrationCreateParamsCountryOptionsAtStandard(TypedDict): place_of_supply_scheme: Union[ Literal["inbound_goods", "small_seller", "standard"], str @@ -633,6 +644,10 @@ class RegistrationCreateParamsCountryOptionsBdStandard(TypedDict): class RegistrationCreateParamsCountryOptionsBe(TypedDict): + igic: NotRequired["RegistrationCreateParamsCountryOptionsBeIgic"] + """ + Options for the IGIC registration. + """ standard: NotRequired["RegistrationCreateParamsCountryOptionsBeStandard"] """ Options for the standard registration. @@ -643,6 +658,13 @@ class RegistrationCreateParamsCountryOptionsBe(TypedDict): """ +class RegistrationCreateParamsCountryOptionsBeIgic(TypedDict): + place_of_supply_scheme: Literal["inbound_goods", "standard"] + """ + Place of supply scheme used in an IGIC registration. + """ + + class RegistrationCreateParamsCountryOptionsBeStandard(TypedDict): place_of_supply_scheme: Union[ Literal["inbound_goods", "small_seller", "standard"], str @@ -673,6 +695,10 @@ class RegistrationCreateParamsCountryOptionsBfStandard(TypedDict): class RegistrationCreateParamsCountryOptionsBg(TypedDict): + igic: NotRequired["RegistrationCreateParamsCountryOptionsBgIgic"] + """ + Options for the IGIC registration. + """ standard: NotRequired["RegistrationCreateParamsCountryOptionsBgStandard"] """ Options for the standard registration. @@ -683,6 +709,13 @@ class RegistrationCreateParamsCountryOptionsBg(TypedDict): """ +class RegistrationCreateParamsCountryOptionsBgIgic(TypedDict): + place_of_supply_scheme: Literal["inbound_goods", "standard"] + """ + Place of supply scheme used in an IGIC registration. + """ + + class RegistrationCreateParamsCountryOptionsBgStandard(TypedDict): place_of_supply_scheme: Union[ Literal["inbound_goods", "small_seller", "standard"], str @@ -842,6 +875,10 @@ class RegistrationCreateParamsCountryOptionsCv(TypedDict): class RegistrationCreateParamsCountryOptionsCy(TypedDict): + igic: NotRequired["RegistrationCreateParamsCountryOptionsCyIgic"] + """ + Options for the IGIC registration. + """ standard: NotRequired["RegistrationCreateParamsCountryOptionsCyStandard"] """ Options for the standard registration. @@ -852,6 +889,13 @@ class RegistrationCreateParamsCountryOptionsCy(TypedDict): """ +class RegistrationCreateParamsCountryOptionsCyIgic(TypedDict): + place_of_supply_scheme: Literal["inbound_goods", "standard"] + """ + Place of supply scheme used in an IGIC registration. + """ + + class RegistrationCreateParamsCountryOptionsCyStandard(TypedDict): place_of_supply_scheme: Union[ Literal["inbound_goods", "small_seller", "standard"], str @@ -862,6 +906,10 @@ class RegistrationCreateParamsCountryOptionsCyStandard(TypedDict): class RegistrationCreateParamsCountryOptionsCz(TypedDict): + igic: NotRequired["RegistrationCreateParamsCountryOptionsCzIgic"] + """ + Options for the IGIC registration. + """ standard: NotRequired["RegistrationCreateParamsCountryOptionsCzStandard"] """ Options for the standard registration. @@ -872,6 +920,13 @@ class RegistrationCreateParamsCountryOptionsCz(TypedDict): """ +class RegistrationCreateParamsCountryOptionsCzIgic(TypedDict): + place_of_supply_scheme: Literal["inbound_goods", "standard"] + """ + Place of supply scheme used in an IGIC registration. + """ + + class RegistrationCreateParamsCountryOptionsCzStandard(TypedDict): place_of_supply_scheme: Union[ Literal["inbound_goods", "small_seller", "standard"], str @@ -882,6 +937,10 @@ class RegistrationCreateParamsCountryOptionsCzStandard(TypedDict): class RegistrationCreateParamsCountryOptionsDe(TypedDict): + igic: NotRequired["RegistrationCreateParamsCountryOptionsDeIgic"] + """ + Options for the IGIC registration. + """ standard: NotRequired["RegistrationCreateParamsCountryOptionsDeStandard"] """ Options for the standard registration. @@ -892,6 +951,13 @@ class RegistrationCreateParamsCountryOptionsDe(TypedDict): """ +class RegistrationCreateParamsCountryOptionsDeIgic(TypedDict): + place_of_supply_scheme: Literal["inbound_goods", "standard"] + """ + Place of supply scheme used in an IGIC registration. + """ + + class RegistrationCreateParamsCountryOptionsDeStandard(TypedDict): place_of_supply_scheme: Union[ Literal["inbound_goods", "small_seller", "standard"], str @@ -902,6 +968,10 @@ class RegistrationCreateParamsCountryOptionsDeStandard(TypedDict): class RegistrationCreateParamsCountryOptionsDk(TypedDict): + igic: NotRequired["RegistrationCreateParamsCountryOptionsDkIgic"] + """ + Options for the IGIC registration. + """ standard: NotRequired["RegistrationCreateParamsCountryOptionsDkStandard"] """ Options for the standard registration. @@ -912,6 +982,13 @@ class RegistrationCreateParamsCountryOptionsDk(TypedDict): """ +class RegistrationCreateParamsCountryOptionsDkIgic(TypedDict): + place_of_supply_scheme: Literal["inbound_goods", "standard"] + """ + Place of supply scheme used in an IGIC registration. + """ + + class RegistrationCreateParamsCountryOptionsDkStandard(TypedDict): place_of_supply_scheme: Union[ Literal["inbound_goods", "small_seller", "standard"], str @@ -929,6 +1006,10 @@ class RegistrationCreateParamsCountryOptionsEc(TypedDict): class RegistrationCreateParamsCountryOptionsEe(TypedDict): + igic: NotRequired["RegistrationCreateParamsCountryOptionsEeIgic"] + """ + Options for the IGIC registration. + """ standard: NotRequired["RegistrationCreateParamsCountryOptionsEeStandard"] """ Options for the standard registration. @@ -939,6 +1020,13 @@ class RegistrationCreateParamsCountryOptionsEe(TypedDict): """ +class RegistrationCreateParamsCountryOptionsEeIgic(TypedDict): + place_of_supply_scheme: Literal["inbound_goods", "standard"] + """ + Place of supply scheme used in an IGIC registration. + """ + + class RegistrationCreateParamsCountryOptionsEeStandard(TypedDict): place_of_supply_scheme: Union[ Literal["inbound_goods", "small_seller", "standard"], str @@ -956,6 +1044,10 @@ class RegistrationCreateParamsCountryOptionsEg(TypedDict): class RegistrationCreateParamsCountryOptionsEs(TypedDict): + igic: NotRequired["RegistrationCreateParamsCountryOptionsEsIgic"] + """ + Options for the IGIC registration. + """ standard: NotRequired["RegistrationCreateParamsCountryOptionsEsStandard"] """ Options for the standard registration. @@ -966,6 +1058,13 @@ class RegistrationCreateParamsCountryOptionsEs(TypedDict): """ +class RegistrationCreateParamsCountryOptionsEsIgic(TypedDict): + place_of_supply_scheme: Literal["inbound_goods", "standard"] + """ + Place of supply scheme used in an IGIC registration. + """ + + class RegistrationCreateParamsCountryOptionsEsStandard(TypedDict): place_of_supply_scheme: Union[ Literal["inbound_goods", "small_seller", "standard"], str @@ -996,6 +1095,10 @@ class RegistrationCreateParamsCountryOptionsEtStandard(TypedDict): class RegistrationCreateParamsCountryOptionsFi(TypedDict): + igic: NotRequired["RegistrationCreateParamsCountryOptionsFiIgic"] + """ + Options for the IGIC registration. + """ standard: NotRequired["RegistrationCreateParamsCountryOptionsFiStandard"] """ Options for the standard registration. @@ -1006,6 +1109,13 @@ class RegistrationCreateParamsCountryOptionsFi(TypedDict): """ +class RegistrationCreateParamsCountryOptionsFiIgic(TypedDict): + place_of_supply_scheme: Literal["inbound_goods", "standard"] + """ + Place of supply scheme used in an IGIC registration. + """ + + class RegistrationCreateParamsCountryOptionsFiStandard(TypedDict): place_of_supply_scheme: Union[ Literal["inbound_goods", "small_seller", "standard"], str @@ -1016,6 +1126,10 @@ class RegistrationCreateParamsCountryOptionsFiStandard(TypedDict): class RegistrationCreateParamsCountryOptionsFr(TypedDict): + igic: NotRequired["RegistrationCreateParamsCountryOptionsFrIgic"] + """ + Options for the IGIC registration. + """ standard: NotRequired["RegistrationCreateParamsCountryOptionsFrStandard"] """ Options for the standard registration. @@ -1026,6 +1140,13 @@ class RegistrationCreateParamsCountryOptionsFr(TypedDict): """ +class RegistrationCreateParamsCountryOptionsFrIgic(TypedDict): + place_of_supply_scheme: Literal["inbound_goods", "standard"] + """ + Place of supply scheme used in an IGIC registration. + """ + + class RegistrationCreateParamsCountryOptionsFrStandard(TypedDict): place_of_supply_scheme: Union[ Literal["inbound_goods", "small_seller", "standard"], str @@ -1083,6 +1204,10 @@ class RegistrationCreateParamsCountryOptionsGnStandard(TypedDict): class RegistrationCreateParamsCountryOptionsGr(TypedDict): + igic: NotRequired["RegistrationCreateParamsCountryOptionsGrIgic"] + """ + Options for the IGIC registration. + """ standard: NotRequired["RegistrationCreateParamsCountryOptionsGrStandard"] """ Options for the standard registration. @@ -1093,6 +1218,13 @@ class RegistrationCreateParamsCountryOptionsGr(TypedDict): """ +class RegistrationCreateParamsCountryOptionsGrIgic(TypedDict): + place_of_supply_scheme: Literal["inbound_goods", "standard"] + """ + Place of supply scheme used in an IGIC registration. + """ + + class RegistrationCreateParamsCountryOptionsGrStandard(TypedDict): place_of_supply_scheme: Union[ Literal["inbound_goods", "small_seller", "standard"], str @@ -1103,6 +1235,10 @@ class RegistrationCreateParamsCountryOptionsGrStandard(TypedDict): class RegistrationCreateParamsCountryOptionsHr(TypedDict): + igic: NotRequired["RegistrationCreateParamsCountryOptionsHrIgic"] + """ + Options for the IGIC registration. + """ standard: NotRequired["RegistrationCreateParamsCountryOptionsHrStandard"] """ Options for the standard registration. @@ -1113,6 +1249,13 @@ class RegistrationCreateParamsCountryOptionsHr(TypedDict): """ +class RegistrationCreateParamsCountryOptionsHrIgic(TypedDict): + place_of_supply_scheme: Literal["inbound_goods", "standard"] + """ + Place of supply scheme used in an IGIC registration. + """ + + class RegistrationCreateParamsCountryOptionsHrStandard(TypedDict): place_of_supply_scheme: Union[ Literal["inbound_goods", "small_seller", "standard"], str @@ -1123,6 +1266,10 @@ class RegistrationCreateParamsCountryOptionsHrStandard(TypedDict): class RegistrationCreateParamsCountryOptionsHu(TypedDict): + igic: NotRequired["RegistrationCreateParamsCountryOptionsHuIgic"] + """ + Options for the IGIC registration. + """ standard: NotRequired["RegistrationCreateParamsCountryOptionsHuStandard"] """ Options for the standard registration. @@ -1133,6 +1280,13 @@ class RegistrationCreateParamsCountryOptionsHu(TypedDict): """ +class RegistrationCreateParamsCountryOptionsHuIgic(TypedDict): + place_of_supply_scheme: Literal["inbound_goods", "standard"] + """ + Place of supply scheme used in an IGIC registration. + """ + + class RegistrationCreateParamsCountryOptionsHuStandard(TypedDict): place_of_supply_scheme: Union[ Literal["inbound_goods", "small_seller", "standard"], str @@ -1150,6 +1304,10 @@ class RegistrationCreateParamsCountryOptionsId(TypedDict): class RegistrationCreateParamsCountryOptionsIe(TypedDict): + igic: NotRequired["RegistrationCreateParamsCountryOptionsIeIgic"] + """ + Options for the IGIC registration. + """ standard: NotRequired["RegistrationCreateParamsCountryOptionsIeStandard"] """ Options for the standard registration. @@ -1160,6 +1318,13 @@ class RegistrationCreateParamsCountryOptionsIe(TypedDict): """ +class RegistrationCreateParamsCountryOptionsIeIgic(TypedDict): + place_of_supply_scheme: Literal["inbound_goods", "standard"] + """ + Place of supply scheme used in an IGIC registration. + """ + + class RegistrationCreateParamsCountryOptionsIeStandard(TypedDict): place_of_supply_scheme: Union[ Literal["inbound_goods", "small_seller", "standard"], str @@ -1197,6 +1362,10 @@ class RegistrationCreateParamsCountryOptionsIsStandard(TypedDict): class RegistrationCreateParamsCountryOptionsIt(TypedDict): + igic: NotRequired["RegistrationCreateParamsCountryOptionsItIgic"] + """ + Options for the IGIC registration. + """ standard: NotRequired["RegistrationCreateParamsCountryOptionsItStandard"] """ Options for the standard registration. @@ -1207,6 +1376,13 @@ class RegistrationCreateParamsCountryOptionsIt(TypedDict): """ +class RegistrationCreateParamsCountryOptionsItIgic(TypedDict): + place_of_supply_scheme: Literal["inbound_goods", "standard"] + """ + Place of supply scheme used in an IGIC registration. + """ + + class RegistrationCreateParamsCountryOptionsItStandard(TypedDict): place_of_supply_scheme: Union[ Literal["inbound_goods", "small_seller", "standard"], str @@ -1286,6 +1462,10 @@ class RegistrationCreateParamsCountryOptionsLk(TypedDict): class RegistrationCreateParamsCountryOptionsLt(TypedDict): + igic: NotRequired["RegistrationCreateParamsCountryOptionsLtIgic"] + """ + Options for the IGIC registration. + """ standard: NotRequired["RegistrationCreateParamsCountryOptionsLtStandard"] """ Options for the standard registration. @@ -1296,6 +1476,13 @@ class RegistrationCreateParamsCountryOptionsLt(TypedDict): """ +class RegistrationCreateParamsCountryOptionsLtIgic(TypedDict): + place_of_supply_scheme: Literal["inbound_goods", "standard"] + """ + Place of supply scheme used in an IGIC registration. + """ + + class RegistrationCreateParamsCountryOptionsLtStandard(TypedDict): place_of_supply_scheme: Union[ Literal["inbound_goods", "small_seller", "standard"], str @@ -1306,6 +1493,10 @@ class RegistrationCreateParamsCountryOptionsLtStandard(TypedDict): class RegistrationCreateParamsCountryOptionsLu(TypedDict): + igic: NotRequired["RegistrationCreateParamsCountryOptionsLuIgic"] + """ + Options for the IGIC registration. + """ standard: NotRequired["RegistrationCreateParamsCountryOptionsLuStandard"] """ Options for the standard registration. @@ -1316,6 +1507,13 @@ class RegistrationCreateParamsCountryOptionsLu(TypedDict): """ +class RegistrationCreateParamsCountryOptionsLuIgic(TypedDict): + place_of_supply_scheme: Literal["inbound_goods", "standard"] + """ + Place of supply scheme used in an IGIC registration. + """ + + class RegistrationCreateParamsCountryOptionsLuStandard(TypedDict): place_of_supply_scheme: Union[ Literal["inbound_goods", "small_seller", "standard"], str @@ -1326,6 +1524,10 @@ class RegistrationCreateParamsCountryOptionsLuStandard(TypedDict): class RegistrationCreateParamsCountryOptionsLv(TypedDict): + igic: NotRequired["RegistrationCreateParamsCountryOptionsLvIgic"] + """ + Options for the IGIC registration. + """ standard: NotRequired["RegistrationCreateParamsCountryOptionsLvStandard"] """ Options for the standard registration. @@ -1336,6 +1538,13 @@ class RegistrationCreateParamsCountryOptionsLv(TypedDict): """ +class RegistrationCreateParamsCountryOptionsLvIgic(TypedDict): + place_of_supply_scheme: Literal["inbound_goods", "standard"] + """ + Place of supply scheme used in an IGIC registration. + """ + + class RegistrationCreateParamsCountryOptionsLvStandard(TypedDict): place_of_supply_scheme: Union[ Literal["inbound_goods", "small_seller", "standard"], str @@ -1420,6 +1629,10 @@ class RegistrationCreateParamsCountryOptionsMrStandard(TypedDict): class RegistrationCreateParamsCountryOptionsMt(TypedDict): + igic: NotRequired["RegistrationCreateParamsCountryOptionsMtIgic"] + """ + Options for the IGIC registration. + """ standard: NotRequired["RegistrationCreateParamsCountryOptionsMtStandard"] """ Options for the standard registration. @@ -1430,6 +1643,13 @@ class RegistrationCreateParamsCountryOptionsMt(TypedDict): """ +class RegistrationCreateParamsCountryOptionsMtIgic(TypedDict): + place_of_supply_scheme: Literal["inbound_goods", "standard"] + """ + Place of supply scheme used in an IGIC registration. + """ + + class RegistrationCreateParamsCountryOptionsMtStandard(TypedDict): place_of_supply_scheme: Union[ Literal["inbound_goods", "small_seller", "standard"], str @@ -1461,6 +1681,10 @@ class RegistrationCreateParamsCountryOptionsNg(TypedDict): class RegistrationCreateParamsCountryOptionsNl(TypedDict): + igic: NotRequired["RegistrationCreateParamsCountryOptionsNlIgic"] + """ + Options for the IGIC registration. + """ standard: NotRequired["RegistrationCreateParamsCountryOptionsNlStandard"] """ Options for the standard registration. @@ -1471,6 +1695,13 @@ class RegistrationCreateParamsCountryOptionsNl(TypedDict): """ +class RegistrationCreateParamsCountryOptionsNlIgic(TypedDict): + place_of_supply_scheme: Literal["inbound_goods", "standard"] + """ + Place of supply scheme used in an IGIC registration. + """ + + class RegistrationCreateParamsCountryOptionsNlStandard(TypedDict): place_of_supply_scheme: Union[ Literal["inbound_goods", "small_seller", "standard"], str @@ -1562,6 +1793,10 @@ class RegistrationCreateParamsCountryOptionsPh(TypedDict): class RegistrationCreateParamsCountryOptionsPl(TypedDict): + igic: NotRequired["RegistrationCreateParamsCountryOptionsPlIgic"] + """ + Options for the IGIC registration. + """ standard: NotRequired["RegistrationCreateParamsCountryOptionsPlStandard"] """ Options for the standard registration. @@ -1572,6 +1807,13 @@ class RegistrationCreateParamsCountryOptionsPl(TypedDict): """ +class RegistrationCreateParamsCountryOptionsPlIgic(TypedDict): + place_of_supply_scheme: Literal["inbound_goods", "standard"] + """ + Place of supply scheme used in an IGIC registration. + """ + + class RegistrationCreateParamsCountryOptionsPlStandard(TypedDict): place_of_supply_scheme: Union[ Literal["inbound_goods", "small_seller", "standard"], str @@ -1582,6 +1824,10 @@ class RegistrationCreateParamsCountryOptionsPlStandard(TypedDict): class RegistrationCreateParamsCountryOptionsPt(TypedDict): + igic: NotRequired["RegistrationCreateParamsCountryOptionsPtIgic"] + """ + Options for the IGIC registration. + """ standard: NotRequired["RegistrationCreateParamsCountryOptionsPtStandard"] """ Options for the standard registration. @@ -1592,6 +1838,13 @@ class RegistrationCreateParamsCountryOptionsPt(TypedDict): """ +class RegistrationCreateParamsCountryOptionsPtIgic(TypedDict): + place_of_supply_scheme: Literal["inbound_goods", "standard"] + """ + Place of supply scheme used in an IGIC registration. + """ + + class RegistrationCreateParamsCountryOptionsPtStandard(TypedDict): place_of_supply_scheme: Union[ Literal["inbound_goods", "small_seller", "standard"], str @@ -1602,6 +1855,10 @@ class RegistrationCreateParamsCountryOptionsPtStandard(TypedDict): class RegistrationCreateParamsCountryOptionsRo(TypedDict): + igic: NotRequired["RegistrationCreateParamsCountryOptionsRoIgic"] + """ + Options for the IGIC registration. + """ standard: NotRequired["RegistrationCreateParamsCountryOptionsRoStandard"] """ Options for the standard registration. @@ -1612,6 +1869,13 @@ class RegistrationCreateParamsCountryOptionsRo(TypedDict): """ +class RegistrationCreateParamsCountryOptionsRoIgic(TypedDict): + place_of_supply_scheme: Literal["inbound_goods", "standard"] + """ + Place of supply scheme used in an IGIC registration. + """ + + class RegistrationCreateParamsCountryOptionsRoStandard(TypedDict): place_of_supply_scheme: Union[ Literal["inbound_goods", "small_seller", "standard"], str @@ -1656,6 +1920,10 @@ class RegistrationCreateParamsCountryOptionsSa(TypedDict): class RegistrationCreateParamsCountryOptionsSe(TypedDict): + igic: NotRequired["RegistrationCreateParamsCountryOptionsSeIgic"] + """ + Options for the IGIC registration. + """ standard: NotRequired["RegistrationCreateParamsCountryOptionsSeStandard"] """ Options for the standard registration. @@ -1666,6 +1934,13 @@ class RegistrationCreateParamsCountryOptionsSe(TypedDict): """ +class RegistrationCreateParamsCountryOptionsSeIgic(TypedDict): + place_of_supply_scheme: Literal["inbound_goods", "standard"] + """ + Place of supply scheme used in an IGIC registration. + """ + + class RegistrationCreateParamsCountryOptionsSeStandard(TypedDict): place_of_supply_scheme: Union[ Literal["inbound_goods", "small_seller", "standard"], str @@ -1696,6 +1971,10 @@ class RegistrationCreateParamsCountryOptionsSgStandard(TypedDict): class RegistrationCreateParamsCountryOptionsSi(TypedDict): + igic: NotRequired["RegistrationCreateParamsCountryOptionsSiIgic"] + """ + Options for the IGIC registration. + """ standard: NotRequired["RegistrationCreateParamsCountryOptionsSiStandard"] """ Options for the standard registration. @@ -1706,6 +1985,13 @@ class RegistrationCreateParamsCountryOptionsSi(TypedDict): """ +class RegistrationCreateParamsCountryOptionsSiIgic(TypedDict): + place_of_supply_scheme: Literal["inbound_goods", "standard"] + """ + Place of supply scheme used in an IGIC registration. + """ + + class RegistrationCreateParamsCountryOptionsSiStandard(TypedDict): place_of_supply_scheme: Union[ Literal["inbound_goods", "small_seller", "standard"], str @@ -1716,6 +2002,10 @@ class RegistrationCreateParamsCountryOptionsSiStandard(TypedDict): class RegistrationCreateParamsCountryOptionsSk(TypedDict): + igic: NotRequired["RegistrationCreateParamsCountryOptionsSkIgic"] + """ + Options for the IGIC registration. + """ standard: NotRequired["RegistrationCreateParamsCountryOptionsSkStandard"] """ Options for the standard registration. @@ -1726,6 +2016,13 @@ class RegistrationCreateParamsCountryOptionsSk(TypedDict): """ +class RegistrationCreateParamsCountryOptionsSkIgic(TypedDict): + place_of_supply_scheme: Literal["inbound_goods", "standard"] + """ + Place of supply scheme used in an IGIC registration. + """ + + class RegistrationCreateParamsCountryOptionsSkStandard(TypedDict): place_of_supply_scheme: Union[ Literal["inbound_goods", "small_seller", "standard"], str @@ -1763,7 +2060,7 @@ class RegistrationCreateParamsCountryOptionsSrStandard(TypedDict): class RegistrationCreateParamsCountryOptionsTh(TypedDict): - type: Literal["simplified"] + type: Union[Literal["simplified"], str] """ Type of registration to be created in `country`. """ diff --git a/stripe/params/terminal/_reader_activate_gift_card_params.py b/stripe/params/terminal/_reader_activate_gift_card_params.py index b05b476f0..753b2d088 100644 --- a/stripe/params/terminal/_reader_activate_gift_card_params.py +++ b/stripe/params/terminal/_reader_activate_gift_card_params.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._request_options import RequestOptions -from typing import List +from typing import List, Union from typing_extensions import Literal, NotRequired, TypedDict @@ -10,7 +10,7 @@ class ReaderActivateGiftCardParams(RequestOptions): """ The initial balance to set on the gift card. """ - brand: Literal["svs"] + brand: Union[Literal["svs"], str] """ The brand of the gift card. """ diff --git a/stripe/params/terminal/_reader_cashout_gift_card_params.py b/stripe/params/terminal/_reader_cashout_gift_card_params.py index 211d79501..59f2df582 100644 --- a/stripe/params/terminal/_reader_cashout_gift_card_params.py +++ b/stripe/params/terminal/_reader_cashout_gift_card_params.py @@ -1,12 +1,12 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._request_options import RequestOptions -from typing import List +from typing import List, Union from typing_extensions import Literal, NotRequired class ReaderCashoutGiftCardParams(RequestOptions): - brand: Literal["svs"] + brand: Union[Literal["svs"], str] """ The brand of the gift card. """ diff --git a/stripe/params/terminal/_reader_check_gift_card_balance_params.py b/stripe/params/terminal/_reader_check_gift_card_balance_params.py index 31a52b6af..8ce2b3740 100644 --- a/stripe/params/terminal/_reader_check_gift_card_balance_params.py +++ b/stripe/params/terminal/_reader_check_gift_card_balance_params.py @@ -1,12 +1,12 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._request_options import RequestOptions -from typing import List +from typing import List, Union from typing_extensions import Literal, NotRequired class ReaderCheckGiftCardBalanceParams(RequestOptions): - brand: Literal["svs"] + brand: Union[Literal["svs"], str] """ The brand of the gift card. """ diff --git a/stripe/params/terminal/_reader_collect_payment_method_params.py b/stripe/params/terminal/_reader_collect_payment_method_params.py index 884c0803a..f892429f4 100644 --- a/stripe/params/terminal/_reader_collect_payment_method_params.py +++ b/stripe/params/terminal/_reader_collect_payment_method_params.py @@ -33,7 +33,7 @@ class ReaderCollectPaymentMethodParamsCollectConfig(TypedDict): """ Enables cancel button on transaction screens. """ - gift_card_brand: NotRequired[Literal["svs"]] + gift_card_brand: NotRequired["Literal['svs']|str"] """ The gift card brand to use in the transaction. """ diff --git a/stripe/params/terminal/_reader_present_payment_method_params.py b/stripe/params/terminal/_reader_present_payment_method_params.py index 422ca46cc..465193552 100644 --- a/stripe/params/terminal/_reader_present_payment_method_params.py +++ b/stripe/params/terminal/_reader_present_payment_method_params.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._request_options import RequestOptions -from typing import List +from typing import List, Union from typing_extensions import Literal, NotRequired, TypedDict @@ -67,7 +67,7 @@ class ReaderPresentPaymentMethodParamsCardPresent(TypedDict): class ReaderPresentPaymentMethodParamsGiftCard(TypedDict): - brand: Literal["svs"] + brand: Union[Literal["svs"], str] """ The brand of the gift card. """ diff --git a/stripe/params/terminal/_reader_process_payment_intent_params.py b/stripe/params/terminal/_reader_process_payment_intent_params.py index 6397a3037..b8762ae79 100644 --- a/stripe/params/terminal/_reader_process_payment_intent_params.py +++ b/stripe/params/terminal/_reader_process_payment_intent_params.py @@ -33,7 +33,7 @@ class ReaderProcessPaymentIntentParamsProcessConfig(TypedDict): """ Enables cancel button on transaction screens. """ - gift_card_brand: NotRequired[Literal["svs"]] + gift_card_brand: NotRequired["Literal['svs']|str"] """ The gift card brand to use in the transaction. """ diff --git a/stripe/params/terminal/_reader_reload_gift_card_params.py b/stripe/params/terminal/_reader_reload_gift_card_params.py index 83c20580b..2311f3dad 100644 --- a/stripe/params/terminal/_reader_reload_gift_card_params.py +++ b/stripe/params/terminal/_reader_reload_gift_card_params.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._request_options import RequestOptions -from typing import List +from typing import List, Union from typing_extensions import Literal, NotRequired @@ -10,7 +10,7 @@ class ReaderReloadGiftCardParams(RequestOptions): """ The amount to add to the gift card balance, in the smallest currency unit. """ - brand: Literal["svs"] + brand: Union[Literal["svs"], str] """ The brand of the gift card. """ diff --git a/stripe/params/test_helpers/_confirmation_token_create_params.py b/stripe/params/test_helpers/_confirmation_token_create_params.py index a8f41d81b..51aa98c3e 100644 --- a/stripe/params/test_helpers/_confirmation_token_create_params.py +++ b/stripe/params/test_helpers/_confirmation_token_create_params.py @@ -418,6 +418,7 @@ class ConfirmationTokenCreateParamsPaymentMethodData(TypedDict): "satispay", "scalapay", "sepa_debit", + "sequra", "shopeepay", "sofort", "stripe_balance", diff --git a/stripe/params/test_helpers/shared_payment/__init__.py b/stripe/params/test_helpers/shared_payment/__init__.py index 9290020d8..a6ca455c2 100644 --- a/stripe/params/test_helpers/shared_payment/__init__.py +++ b/stripe/params/test_helpers/shared_payment/__init__.py @@ -7,6 +7,7 @@ from stripe.params.test_helpers.shared_payment._granted_token_create_params import ( GrantedTokenCreateParams as GrantedTokenCreateParams, GrantedTokenCreateParamsUsageLimits as GrantedTokenCreateParamsUsageLimits, + GrantedTokenCreateParamsUsageLimitsRecurring as GrantedTokenCreateParamsUsageLimitsRecurring, ) from stripe.params.test_helpers.shared_payment._granted_token_revoke_params import ( GrantedTokenRevokeParams as GrantedTokenRevokeParams, @@ -22,6 +23,10 @@ "stripe.params.test_helpers.shared_payment._granted_token_create_params", False, ), + "GrantedTokenCreateParamsUsageLimitsRecurring": ( + "stripe.params.test_helpers.shared_payment._granted_token_create_params", + False, + ), "GrantedTokenRevokeParams": ( "stripe.params.test_helpers.shared_payment._granted_token_revoke_params", False, diff --git a/stripe/params/test_helpers/shared_payment/_granted_token_create_params.py b/stripe/params/test_helpers/shared_payment/_granted_token_create_params.py index a5d23dc4e..026642384 100644 --- a/stripe/params/test_helpers/shared_payment/_granted_token_create_params.py +++ b/stripe/params/test_helpers/shared_payment/_granted_token_create_params.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._stripe_object import UntypedStripeObject -from typing import Dict, List +from typing import Dict, List, Union from typing_extensions import Literal, NotRequired, TypedDict @@ -43,7 +43,22 @@ class GrantedTokenCreateParamsUsageLimits(TypedDict): """ Max amount that can be captured using this SharedPaymentToken """ + recurring: NotRequired["GrantedTokenCreateParamsUsageLimitsRecurring"] + """ + The recurring schedule for the shared payment token's amount usage restrictions. + """ recurring_interval: NotRequired["Literal['month', 'week', 'year']|str"] """ The recurring interval at which the shared payment token's amount usage restrictions reset. """ + + +class GrantedTokenCreateParamsUsageLimitsRecurring(TypedDict): + interval: Union[Literal["day", "month", "week", "year"], str] + """ + The interval at which the shared payment token's amount usage restrictions reset. + """ + interval_count: NotRequired[int] + """ + The number of intervals between each reset. Defaults to 1. + """ diff --git a/stripe/params/test_helpers/terminal/_reader_present_payment_method_params.py b/stripe/params/test_helpers/terminal/_reader_present_payment_method_params.py index 0ae44d5d8..53001205b 100644 --- a/stripe/params/test_helpers/terminal/_reader_present_payment_method_params.py +++ b/stripe/params/test_helpers/terminal/_reader_present_payment_method_params.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from typing import List +from typing import List, Union from typing_extensions import Literal, NotRequired, TypedDict @@ -66,7 +66,7 @@ class ReaderPresentPaymentMethodParamsCardPresent(TypedDict): class ReaderPresentPaymentMethodParamsGiftCard(TypedDict): - brand: Literal["svs"] + brand: Union[Literal["svs"], str] """ The brand of the gift card. """ diff --git a/stripe/params/v2/billing/_cadence_list_params.py b/stripe/params/v2/billing/_cadence_list_params.py index 505cd00d6..5e8eeae81 100644 --- a/stripe/params/v2/billing/_cadence_list_params.py +++ b/stripe/params/v2/billing/_cadence_list_params.py @@ -37,7 +37,7 @@ class CadenceListParamsPayer(TypedDict): """ The ID of the Customer object. If provided, only cadences that specifically reference the provided customer ID will be returned. """ - type: Literal["customer"] + type: Union[Literal["customer"], str] """ A string identifying the type of the payer. Currently the only supported value is `customer`. """ diff --git a/stripe/params/v2/billing/_collection_setting_create_params.py b/stripe/params/v2/billing/_collection_setting_create_params.py index 9d8c260af..7ef3011f0 100644 --- a/stripe/params/v2/billing/_collection_setting_create_params.py +++ b/stripe/params/v2/billing/_collection_setting_create_params.py @@ -180,7 +180,7 @@ class CollectionSettingCreateParamsPaymentMethodOptionsCustomerBalance( """ Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`. """ - funding_type: NotRequired[Literal["bank_transfer"]] + funding_type: NotRequired["Literal['bank_transfer']|str"] """ The funding method type to be used when there are not enough funds in the customer balance. Currently the only supported value is `bank_transfer`. """ diff --git a/stripe/params/v2/billing/_collection_setting_update_params.py b/stripe/params/v2/billing/_collection_setting_update_params.py index f9878966d..89c19dc4a 100644 --- a/stripe/params/v2/billing/_collection_setting_update_params.py +++ b/stripe/params/v2/billing/_collection_setting_update_params.py @@ -186,7 +186,7 @@ class CollectionSettingUpdateParamsPaymentMethodOptionsCustomerBalance( """ Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`. """ - funding_type: NotRequired[Literal["bank_transfer"]] + funding_type: NotRequired["Literal['bank_transfer']|str"] """ The funding method type to be used when there are not enough funds in the customer balance. Currently the only supported value is `bank_transfer`. """ diff --git a/stripe/params/v2/billing/_contract_create_params.py b/stripe/params/v2/billing/_contract_create_params.py index d750c9648..948b17e81 100644 --- a/stripe/params/v2/billing/_contract_create_params.py +++ b/stripe/params/v2/billing/_contract_create_params.py @@ -220,7 +220,7 @@ class ContractCreateParamsPricingLineEndsAt(TypedDict): """ The timestamp when the item ends. Required if `type` is `timestamp`. """ - type: Literal["timestamp"] + type: Union[Literal["timestamp"], str] """ The type of the ends_at. """ @@ -233,7 +233,7 @@ class ContractCreateParamsPricingLinePricing(TypedDict): """ V1 price details. Required if `type` is `price`. """ - type: Literal["price"] + type: Union[Literal["price"], str] """ The type of pricing. """ @@ -296,7 +296,7 @@ class ContractCreateParamsPricingLinePricingPriceDetailsPricingOverride( """ When the override starts. Defaults to the pricing line's start if not specified. """ - type: Literal["overwrite_price"] + type: Union[Literal["overwrite_price"], str] """ The type of override. """ @@ -309,7 +309,7 @@ class ContractCreateParamsPricingLinePricingPriceDetailsPricingOverrideEndsAt( """ The timestamp when the item ends. Required if `type` is `timestamp`. """ - type: Literal["timestamp"] + type: Union[Literal["timestamp"], str] """ The type of the ends_at. """ @@ -331,7 +331,7 @@ class ContractCreateParamsPricingLinePricingPriceDetailsPricingOverrideStartsAt( """ The timestamp when the item starts. Required if `type` is `timestamp`. """ - type: Literal["timestamp"] + type: Union[Literal["timestamp"], str] """ The type of the starts_at. """ @@ -357,7 +357,7 @@ class ContractCreateParamsPricingLinePricingPriceDetailsQuantityChangeEffectiveA """ The timestamp for the effective at. """ - type: Literal["timestamp"] + type: Union[Literal["timestamp"], str] """ The type of the effective at. """ @@ -368,7 +368,7 @@ class ContractCreateParamsPricingLineStartsAt(TypedDict): """ The timestamp when the item starts. Required if `type` is `timestamp`. """ - type: Literal["timestamp"] + type: Union[Literal["timestamp"], str] """ The type of the starts_at. """ @@ -401,7 +401,7 @@ class ContractCreateParamsPricingOverride(TypedDict): """ When the pricing override starts. """ - type: Literal["multiply_pricing"] + type: Union[Literal["multiply_pricing"], str] """ The type of pricing override. """ @@ -412,7 +412,7 @@ class ContractCreateParamsPricingOverrideEndsAt(TypedDict): """ The timestamp when the item ends. Required if `type` is `timestamp`. """ - type: Literal["timestamp"] + type: Union[Literal["timestamp"], str] """ The type of the ends_at. """ @@ -451,7 +451,7 @@ class ContractCreateParamsPricingOverrideStartsAt(TypedDict): """ The timestamp when the item starts. Required if `type` is `timestamp`. """ - type: Literal["timestamp"] + type: Union[Literal["timestamp"], str] """ The type of the starts_at. """ diff --git a/stripe/params/v2/billing/_contract_update_params.py b/stripe/params/v2/billing/_contract_update_params.py index bf14f83e0..dd6c6b81e 100644 --- a/stripe/params/v2/billing/_contract_update_params.py +++ b/stripe/params/v2/billing/_contract_update_params.py @@ -90,7 +90,7 @@ class ContractUpdateParamsPricingLineActionAddEndsAt(TypedDict): """ The timestamp when the pricing ends. """ - type: Literal["timestamp"] + type: Union[Literal["timestamp"], str] """ The type of end time to apply. """ @@ -103,7 +103,7 @@ class ContractUpdateParamsPricingLineActionAddPricing(TypedDict): """ V1 price details. Required if `type` is `price`. """ - type: Literal["price"] + type: Union[Literal["price"], str] """ The type of pricing. """ @@ -166,7 +166,7 @@ class ContractUpdateParamsPricingLineActionAddPricingPriceDetailsPricingOverride """ When the override starts. Defaults to the pricing line's start if not specified. """ - type: Literal["overwrite_price"] + type: Union[Literal["overwrite_price"], str] """ The type of override. """ @@ -179,7 +179,7 @@ class ContractUpdateParamsPricingLineActionAddPricingPriceDetailsPricingOverride """ The timestamp when the item ends. Required if `type` is `timestamp`. """ - type: Literal["timestamp"] + type: Union[Literal["timestamp"], str] """ The type of the ends_at. """ @@ -201,7 +201,7 @@ class ContractUpdateParamsPricingLineActionAddPricingPriceDetailsPricingOverride """ The timestamp when the item starts. Required if `type` is `timestamp`. """ - type: Literal["timestamp"] + type: Union[Literal["timestamp"], str] """ The type of the starts_at. """ @@ -227,7 +227,7 @@ class ContractUpdateParamsPricingLineActionAddPricingPriceDetailsQuantityChangeE """ The timestamp for the effective at. """ - type: Literal["timestamp"] + type: Union[Literal["timestamp"], str] """ The type of the effective at. """ @@ -238,7 +238,7 @@ class ContractUpdateParamsPricingLineActionAddStartsAt(TypedDict): """ The timestamp when the pricing starts. """ - type: Literal["timestamp"] + type: Union[Literal["timestamp"], str] """ The type of start time to apply. """ @@ -283,7 +283,7 @@ class ContractUpdateParamsPricingLineActionUpdateEndsAt(TypedDict): """ The timestamp when the pricing ends. """ - type: Literal["timestamp"] + type: Union[Literal["timestamp"], str] """ The type of end time to apply. """ @@ -375,7 +375,7 @@ class ContractUpdateParamsPricingLineActionUpdatePricingPriceDetailsPricingOverr """ The start time for the override. """ - type: Literal["overwrite_price"] + type: Union[Literal["overwrite_price"], str] """ The type of override to add. """ @@ -388,7 +388,7 @@ class ContractUpdateParamsPricingLineActionUpdatePricingPriceDetailsPricingOverr """ The timestamp when the pricing ends. """ - type: Literal["timestamp"] + type: Union[Literal["timestamp"], str] """ The type of end time to apply. """ @@ -410,7 +410,7 @@ class ContractUpdateParamsPricingLineActionUpdatePricingPriceDetailsPricingOverr """ The timestamp when the pricing starts. """ - type: Literal["timestamp"] + type: Union[Literal["timestamp"], str] """ The type of start time to apply. """ @@ -467,7 +467,7 @@ class ContractUpdateParamsPricingLineActionUpdatePricingPriceDetailsPricingOverr """ The timestamp when the pricing ends. """ - type: Literal["timestamp"] + type: Union[Literal["timestamp"], str] """ The type of end time to apply. """ @@ -480,7 +480,7 @@ class ContractUpdateParamsPricingLineActionUpdatePricingPriceDetailsPricingOverr """ The timestamp when the pricing starts. """ - type: Literal["timestamp"] + type: Union[Literal["timestamp"], str] """ The type of start time to apply. """ @@ -506,7 +506,7 @@ class ContractUpdateParamsPricingLineActionUpdatePricingPriceDetailsQuantityChan """ The timestamp for the effective at. """ - type: Literal["timestamp"] + type: Union[Literal["timestamp"], str] """ The type of the effective at. """ @@ -517,7 +517,7 @@ class ContractUpdateParamsPricingLineActionUpdateStartsAt(TypedDict): """ The timestamp when the pricing starts. """ - type: Literal["timestamp"] + type: Union[Literal["timestamp"], str] """ The type of start time to apply. """ @@ -575,7 +575,7 @@ class ContractUpdateParamsPricingOverrideActionAdd(TypedDict): """ The start time for the pricing override. """ - type: Literal["multiply_pricing"] + type: Union[Literal["multiply_pricing"], str] """ The type of pricing override to add. """ @@ -586,7 +586,7 @@ class ContractUpdateParamsPricingOverrideActionAddEndsAt(TypedDict): """ The timestamp when the pricing ends. """ - type: Literal["timestamp"] + type: Union[Literal["timestamp"], str] """ The type of end time to apply. """ @@ -634,7 +634,7 @@ class ContractUpdateParamsPricingOverrideActionAddStartsAt(TypedDict): """ The timestamp when the pricing starts. """ - type: Literal["timestamp"] + type: Union[Literal["timestamp"], str] """ The type of start time to apply. """ @@ -677,7 +677,7 @@ class ContractUpdateParamsPricingOverrideActionUpdateEndsAt(TypedDict): """ The timestamp when the pricing ends. """ - type: Literal["timestamp"] + type: Union[Literal["timestamp"], str] """ The type of end time to apply. """ @@ -688,7 +688,7 @@ class ContractUpdateParamsPricingOverrideActionUpdateStartsAt(TypedDict): """ The timestamp when the pricing starts. """ - type: Literal["timestamp"] + type: Union[Literal["timestamp"], str] """ The type of start time to apply. """ diff --git a/stripe/params/v2/billing/_intent_create_params.py b/stripe/params/v2/billing/_intent_create_params.py index 34ead884c..efbb72047 100644 --- a/stripe/params/v2/billing/_intent_create_params.py +++ b/stripe/params/v2/billing/_intent_create_params.py @@ -117,7 +117,7 @@ class IntentCreateParamsActionApplyEffectiveAt(TypedDict): class IntentCreateParamsActionApplyInvoiceDiscountRule(TypedDict): - applies_to: Literal["cadence"] + applies_to: Union[Literal["cadence"], str] """ The entity that the discount rule applies to, for example, the cadence. """ @@ -127,7 +127,7 @@ class IntentCreateParamsActionApplyInvoiceDiscountRule(TypedDict): """ Configuration for percentage off discount. """ - type: Literal["percent_off"] + type: Union[Literal["percent_off"], str] """ Type of the discount rule. """ @@ -147,7 +147,7 @@ class IntentCreateParamsActionApplyInvoiceDiscountRulePercentOff(TypedDict): class IntentCreateParamsActionApplyInvoiceDiscountRulePercentOffMaximumApplications( TypedDict, ): - type: Literal["indefinite"] + type: Union[Literal["indefinite"], str] """ The type of maximum applications configuration. """ @@ -164,7 +164,7 @@ class IntentCreateParamsActionApplySpendModifierRule(TypedDict): """ Details for max billing period spend modifier. Only present if type is max_billing_period_spend. """ - type: Literal["max_billing_period_spend"] + type: Union[Literal["max_billing_period_spend"], str] """ Type of the spend modifier. """ diff --git a/stripe/params/v2/billing/_meter_event_adjustment_create_params.py b/stripe/params/v2/billing/_meter_event_adjustment_create_params.py index b39cc81f2..2de4e99d4 100644 --- a/stripe/params/v2/billing/_meter_event_adjustment_create_params.py +++ b/stripe/params/v2/billing/_meter_event_adjustment_create_params.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec +from typing import Union from typing_extensions import Literal, TypedDict @@ -12,7 +13,7 @@ class MeterEventAdjustmentCreateParams(TypedDict): """ The name of the meter event. Corresponds with the `event_name` field on a meter. """ - type: Literal["cancel"] + type: Union[Literal["cancel"], str] """ Specifies the type of cancellation. Currently supports canceling a single event. """ diff --git a/stripe/params/v2/billing/_pricing_plan_subscription_list_params.py b/stripe/params/v2/billing/_pricing_plan_subscription_list_params.py index 48cadeb6d..d9001385a 100644 --- a/stripe/params/v2/billing/_pricing_plan_subscription_list_params.py +++ b/stripe/params/v2/billing/_pricing_plan_subscription_list_params.py @@ -49,7 +49,7 @@ class PricingPlanSubscriptionListParamsPayer(TypedDict): """ The ID of the Customer object. If provided, only Pricing Plan Subscriptions that are subscribed on the cadences with the specified payer will be returned. """ - type: Literal["customer"] + type: Union[Literal["customer"], str] """ A string identifying the type of the payer. Currently the only supported value is `customer`. """ diff --git a/stripe/params/v2/billing/_rate_card_subscription_list_params.py b/stripe/params/v2/billing/_rate_card_subscription_list_params.py index ddf330ac4..0e4033754 100644 --- a/stripe/params/v2/billing/_rate_card_subscription_list_params.py +++ b/stripe/params/v2/billing/_rate_card_subscription_list_params.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec +from typing import Union from typing_extensions import Literal, NotRequired, TypedDict @@ -38,7 +39,7 @@ class RateCardSubscriptionListParamsPayer(TypedDict): """ The ID of the Customer object. If provided, only the Rate Card Subscriptions that are subscribed on the Billing Cadences with the specified payer will be returned. """ - type: Literal["customer"] + type: Union[Literal["customer"], str] """ A string identifying the type of the payer. Currently the only supported value is `customer`. """ diff --git a/stripe/params/v2/billing/_service_action_create_params.py b/stripe/params/v2/billing/_service_action_create_params.py index 0070637f9..2a6e0cc31 100644 --- a/stripe/params/v2/billing/_service_action_create_params.py +++ b/stripe/params/v2/billing/_service_action_create_params.py @@ -104,14 +104,14 @@ class ServiceActionCreateParamsCreditGrantApplicabilityConfigScope(TypedDict): """ The billable items to apply the credit grant to. """ - price_type: NotRequired[Literal["metered"]] + price_type: NotRequired["Literal['metered']|str"] """ The price type that credit grants can apply to. Stripe supports the `metered` price type, which applies to metered prices and rate cards. Cannot be used in combination with `billable_items`. """ class ServiceActionCreateParamsCreditGrantExpiryConfig(TypedDict): - type: Literal["end_of_service_period"] + type: Union[Literal["end_of_service_period"], str] """ The type of the expiry configuration. We currently support `end_of_service_period`. """ @@ -200,14 +200,14 @@ class ServiceActionCreateParamsCreditGrantPerTenantApplicabilityConfigScope( """ The billable items to apply the credit grant to. """ - price_type: NotRequired[Literal["metered"]] + price_type: NotRequired["Literal['metered']|str"] """ The price type that credit grants can apply to. Stripe supports the `metered` price type, which applies to metered prices and rate cards. Cannot be used in combination with `billable_items`. """ class ServiceActionCreateParamsCreditGrantPerTenantExpiryConfig(TypedDict): - type: Literal["end_of_service_period"] + type: Union[Literal["end_of_service_period"], str] """ The type of the expiry configuration. We currently support `end_of_service_period`. """ @@ -220,7 +220,7 @@ class ServiceActionCreateParamsCreditGrantPerTenantGrantCondition(TypedDict): """ The grant condition for the meter event first per period. """ - type: Literal["meter_event_first_per_period"] + type: Union[Literal["meter_event_first_per_period"], str] """ The type of the grant condition. We currently support `meter_event_first_per_period`. """ @@ -246,7 +246,7 @@ class ServiceActionCreateParamsCreditGrantPerTenantGrantConditionMeterEventFirst """ Dimension-based meter segment condition. """ - type: Literal["dimension"] + type: Union[Literal["dimension"], str] """ The type of the meter segment condition. We currently support `dimension`. """ diff --git a/stripe/params/v2/core/_account_create_params.py b/stripe/params/v2/core/_account_create_params.py index 3649ff988..c9b57617d 100644 --- a/stripe/params/v2/core/_account_create_params.py +++ b/stripe/params/v2/core/_account_create_params.py @@ -6771,7 +6771,7 @@ class AccountCreateParamsIdentityBusinessDetailsDocumentsBankAccountOwnershipVer """ One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. """ - type: Literal["files"] + type: Union[Literal["files"], str] """ The format of the document. Currently supports `files` only. """ @@ -6784,7 +6784,7 @@ class AccountCreateParamsIdentityBusinessDetailsDocumentsCompanyLicense( """ One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. """ - type: Literal["files"] + type: Union[Literal["files"], str] """ The format of the document. Currently supports `files` only. """ @@ -6797,7 +6797,7 @@ class AccountCreateParamsIdentityBusinessDetailsDocumentsCompanyMemorandumOfAsso """ One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. """ - type: Literal["files"] + type: Union[Literal["files"], str] """ The format of the document. Currently supports `files` only. """ @@ -6810,7 +6810,7 @@ class AccountCreateParamsIdentityBusinessDetailsDocumentsCompanyMinisterialDecre """ One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. """ - type: Literal["files"] + type: Union[Literal["files"], str] """ The format of the document. Currently supports `files` only. """ @@ -6823,7 +6823,7 @@ class AccountCreateParamsIdentityBusinessDetailsDocumentsCompanyRegistrationVeri """ One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. """ - type: Literal["files"] + type: Union[Literal["files"], str] """ The format of the document. Currently supports `files` only. """ @@ -6836,7 +6836,7 @@ class AccountCreateParamsIdentityBusinessDetailsDocumentsCompanyTaxIdVerificatio """ One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. """ - type: Literal["files"] + type: Union[Literal["files"], str] """ The format of the document. Currently supports `files` only. """ @@ -6849,7 +6849,7 @@ class AccountCreateParamsIdentityBusinessDetailsDocumentsPrimaryVerification( """ The [file upload](https://docs.stripe.com/api/persons/update#create_file) tokens referring to each side of the document. """ - type: Literal["front_back"] + type: Union[Literal["front_back"], str] """ The format of the verification document. Currently supports `front_back` only. """ @@ -6875,7 +6875,7 @@ class AccountCreateParamsIdentityBusinessDetailsDocumentsProofOfAddress( """ One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. """ - type: Literal["files"] + type: Union[Literal["files"], str] """ The format of the document. Currently supports `files` only. """ @@ -6894,7 +6894,7 @@ class AccountCreateParamsIdentityBusinessDetailsDocumentsProofOfRegistration( """ Person that is signing the document. """ - type: Literal["files"] + type: Union[Literal["files"], str] """ The format of the document. Currently supports `files` only. """ @@ -6922,7 +6922,7 @@ class AccountCreateParamsIdentityBusinessDetailsDocumentsProofOfUltimateBenefici """ Person that is signing the document. """ - type: Literal["files"] + type: Union[Literal["files"], str] """ The format of the document. Currently supports `files` only. """ @@ -7451,7 +7451,7 @@ class AccountCreateParamsIdentityIndividualDocumentsCompanyAuthorization( """ One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. """ - type: Literal["files"] + type: Union[Literal["files"], str] """ The format of the document. Currently supports `files` only. """ @@ -7462,7 +7462,7 @@ class AccountCreateParamsIdentityIndividualDocumentsPassport(TypedDict): """ One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. """ - type: Literal["files"] + type: Union[Literal["files"], str] """ The format of the document. Currently supports `files` only. """ @@ -7475,7 +7475,7 @@ class AccountCreateParamsIdentityIndividualDocumentsPrimaryVerification( """ The [file upload](https://docs.stripe.com/api/persons/update#create_file) tokens referring to each side of the document. """ - type: Literal["front_back"] + type: Union[Literal["front_back"], str] """ The format of the verification document. Currently supports `front_back` only. """ @@ -7501,7 +7501,7 @@ class AccountCreateParamsIdentityIndividualDocumentsSecondaryVerification( """ The [file upload](https://docs.stripe.com/api/persons/update#create_file) tokens referring to each side of the document. """ - type: Literal["front_back"] + type: Union[Literal["front_back"], str] """ The format of the verification document. Currently supports `front_back` only. """ @@ -7525,7 +7525,7 @@ class AccountCreateParamsIdentityIndividualDocumentsVisa(TypedDict): """ One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. """ - type: Literal["files"] + type: Union[Literal["files"], str] """ The format of the document. Currently supports `files` only. """ diff --git a/stripe/params/v2/core/_account_link_create_params.py b/stripe/params/v2/core/_account_link_create_params.py index 51dfa05aa..9e63c8a62 100644 --- a/stripe/params/v2/core/_account_link_create_params.py +++ b/stripe/params/v2/core/_account_link_create_params.py @@ -139,7 +139,7 @@ class AccountLinkCreateParamsUseCaseRecipientOnboarding(TypedDict): """ Specifies the requirements that Stripe collects from v2/core/accounts in the Onboarding flow. """ - configurations: List[Literal["recipient"]] + configurations: List[Union[Literal["recipient"], str]] """ Open Enum. A v2/core/account can be configured to enable certain functionality. The configuration param targets the v2/core/account_link to collect information for the specified v2/core/account configuration/s. """ @@ -173,7 +173,7 @@ class AccountLinkCreateParamsUseCaseRecipientUpdate(TypedDict): """ Specifies the requirements that Stripe collects from v2/core/accounts in the Update flow. """ - configurations: List[Literal["recipient"]] + configurations: List[Union[Literal["recipient"], str]] """ Open Enum. A v2/account can be configured to enable certain functionality. The configuration param targets the v2/account_link to collect information for the specified v2/account configuration/s. """ diff --git a/stripe/params/v2/core/_account_token_create_params.py b/stripe/params/v2/core/_account_token_create_params.py index fdd2d10e8..06599ba3f 100644 --- a/stripe/params/v2/core/_account_token_create_params.py +++ b/stripe/params/v2/core/_account_token_create_params.py @@ -694,7 +694,7 @@ class AccountTokenCreateParamsIdentityBusinessDetailsDocumentsBankAccountOwnersh """ One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. """ - type: Literal["files"] + type: Union[Literal["files"], str] """ The format of the document. Currently supports `files` only. """ @@ -707,7 +707,7 @@ class AccountTokenCreateParamsIdentityBusinessDetailsDocumentsCompanyLicense( """ One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. """ - type: Literal["files"] + type: Union[Literal["files"], str] """ The format of the document. Currently supports `files` only. """ @@ -720,7 +720,7 @@ class AccountTokenCreateParamsIdentityBusinessDetailsDocumentsCompanyMemorandumO """ One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. """ - type: Literal["files"] + type: Union[Literal["files"], str] """ The format of the document. Currently supports `files` only. """ @@ -733,7 +733,7 @@ class AccountTokenCreateParamsIdentityBusinessDetailsDocumentsCompanyMinisterial """ One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. """ - type: Literal["files"] + type: Union[Literal["files"], str] """ The format of the document. Currently supports `files` only. """ @@ -746,7 +746,7 @@ class AccountTokenCreateParamsIdentityBusinessDetailsDocumentsCompanyRegistratio """ One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. """ - type: Literal["files"] + type: Union[Literal["files"], str] """ The format of the document. Currently supports `files` only. """ @@ -759,7 +759,7 @@ class AccountTokenCreateParamsIdentityBusinessDetailsDocumentsCompanyTaxIdVerifi """ One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. """ - type: Literal["files"] + type: Union[Literal["files"], str] """ The format of the document. Currently supports `files` only. """ @@ -772,7 +772,7 @@ class AccountTokenCreateParamsIdentityBusinessDetailsDocumentsPrimaryVerificatio """ The [file upload](https://docs.stripe.com/api/persons/update#create_file) tokens referring to each side of the document. """ - type: Literal["front_back"] + type: Union[Literal["front_back"], str] """ The format of the verification document. Currently supports `front_back` only. """ @@ -798,7 +798,7 @@ class AccountTokenCreateParamsIdentityBusinessDetailsDocumentsProofOfAddress( """ One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. """ - type: Literal["files"] + type: Union[Literal["files"], str] """ The format of the document. Currently supports `files` only. """ @@ -817,7 +817,7 @@ class AccountTokenCreateParamsIdentityBusinessDetailsDocumentsProofOfRegistratio """ Person that is signing the document. """ - type: Literal["files"] + type: Union[Literal["files"], str] """ The format of the document. Currently supports `files` only. """ @@ -845,7 +845,7 @@ class AccountTokenCreateParamsIdentityBusinessDetailsDocumentsProofOfUltimateBen """ Person that is signing the document. """ - type: Literal["files"] + type: Union[Literal["files"], str] """ The format of the document. Currently supports `files` only. """ @@ -1390,7 +1390,7 @@ class AccountTokenCreateParamsIdentityIndividualDocumentsCompanyAuthorization( """ One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. """ - type: Literal["files"] + type: Union[Literal["files"], str] """ The format of the document. Currently supports `files` only. """ @@ -1401,7 +1401,7 @@ class AccountTokenCreateParamsIdentityIndividualDocumentsPassport(TypedDict): """ One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. """ - type: Literal["files"] + type: Union[Literal["files"], str] """ The format of the document. Currently supports `files` only. """ @@ -1414,7 +1414,7 @@ class AccountTokenCreateParamsIdentityIndividualDocumentsPrimaryVerification( """ The [file upload](https://docs.stripe.com/api/persons/update#create_file) tokens referring to each side of the document. """ - type: Literal["front_back"] + type: Union[Literal["front_back"], str] """ The format of the verification document. Currently supports `front_back` only. """ @@ -1440,7 +1440,7 @@ class AccountTokenCreateParamsIdentityIndividualDocumentsSecondaryVerification( """ The [file upload](https://docs.stripe.com/api/persons/update#create_file) tokens referring to each side of the document. """ - type: Literal["front_back"] + type: Union[Literal["front_back"], str] """ The format of the verification document. Currently supports `front_back` only. """ @@ -1464,7 +1464,7 @@ class AccountTokenCreateParamsIdentityIndividualDocumentsVisa(TypedDict): """ One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. """ - type: Literal["files"] + type: Union[Literal["files"], str] """ The format of the document. Currently supports `files` only. """ diff --git a/stripe/params/v2/core/_account_update_params.py b/stripe/params/v2/core/_account_update_params.py index a842afbc5..a29cdbb6e 100644 --- a/stripe/params/v2/core/_account_update_params.py +++ b/stripe/params/v2/core/_account_update_params.py @@ -6805,7 +6805,7 @@ class AccountUpdateParamsIdentityBusinessDetailsDocumentsBankAccountOwnershipVer """ One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. """ - type: Literal["files"] + type: Union[Literal["files"], str] """ The format of the document. Currently supports `files` only. """ @@ -6818,7 +6818,7 @@ class AccountUpdateParamsIdentityBusinessDetailsDocumentsCompanyLicense( """ One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. """ - type: Literal["files"] + type: Union[Literal["files"], str] """ The format of the document. Currently supports `files` only. """ @@ -6831,7 +6831,7 @@ class AccountUpdateParamsIdentityBusinessDetailsDocumentsCompanyMemorandumOfAsso """ One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. """ - type: Literal["files"] + type: Union[Literal["files"], str] """ The format of the document. Currently supports `files` only. """ @@ -6844,7 +6844,7 @@ class AccountUpdateParamsIdentityBusinessDetailsDocumentsCompanyMinisterialDecre """ One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. """ - type: Literal["files"] + type: Union[Literal["files"], str] """ The format of the document. Currently supports `files` only. """ @@ -6857,7 +6857,7 @@ class AccountUpdateParamsIdentityBusinessDetailsDocumentsCompanyRegistrationVeri """ One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. """ - type: Literal["files"] + type: Union[Literal["files"], str] """ The format of the document. Currently supports `files` only. """ @@ -6870,7 +6870,7 @@ class AccountUpdateParamsIdentityBusinessDetailsDocumentsCompanyTaxIdVerificatio """ One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. """ - type: Literal["files"] + type: Union[Literal["files"], str] """ The format of the document. Currently supports `files` only. """ @@ -6883,7 +6883,7 @@ class AccountUpdateParamsIdentityBusinessDetailsDocumentsPrimaryVerification( """ The [file upload](https://docs.stripe.com/api/persons/update#create_file) tokens referring to each side of the document. """ - type: Literal["front_back"] + type: Union[Literal["front_back"], str] """ The format of the verification document. Currently supports `front_back` only. """ @@ -6909,7 +6909,7 @@ class AccountUpdateParamsIdentityBusinessDetailsDocumentsProofOfAddress( """ One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. """ - type: Literal["files"] + type: Union[Literal["files"], str] """ The format of the document. Currently supports `files` only. """ @@ -6928,7 +6928,7 @@ class AccountUpdateParamsIdentityBusinessDetailsDocumentsProofOfRegistration( """ Person that is signing the document. """ - type: Literal["files"] + type: Union[Literal["files"], str] """ The format of the document. Currently supports `files` only. """ @@ -6956,7 +6956,7 @@ class AccountUpdateParamsIdentityBusinessDetailsDocumentsProofOfUltimateBenefici """ Person that is signing the document. """ - type: Literal["files"] + type: Union[Literal["files"], str] """ The format of the document. Currently supports `files` only. """ @@ -7487,7 +7487,7 @@ class AccountUpdateParamsIdentityIndividualDocumentsCompanyAuthorization( """ One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. """ - type: Literal["files"] + type: Union[Literal["files"], str] """ The format of the document. Currently supports `files` only. """ @@ -7498,7 +7498,7 @@ class AccountUpdateParamsIdentityIndividualDocumentsPassport(TypedDict): """ One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. """ - type: Literal["files"] + type: Union[Literal["files"], str] """ The format of the document. Currently supports `files` only. """ @@ -7511,7 +7511,7 @@ class AccountUpdateParamsIdentityIndividualDocumentsPrimaryVerification( """ The [file upload](https://docs.stripe.com/api/persons/update#create_file) tokens referring to each side of the document. """ - type: Literal["front_back"] + type: Union[Literal["front_back"], str] """ The format of the verification document. Currently supports `front_back` only. """ @@ -7537,7 +7537,7 @@ class AccountUpdateParamsIdentityIndividualDocumentsSecondaryVerification( """ The [file upload](https://docs.stripe.com/api/persons/update#create_file) tokens referring to each side of the document. """ - type: Literal["front_back"] + type: Union[Literal["front_back"], str] """ The format of the verification document. Currently supports `front_back` only. """ @@ -7561,7 +7561,7 @@ class AccountUpdateParamsIdentityIndividualDocumentsVisa(TypedDict): """ One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. """ - type: Literal["files"] + type: Union[Literal["files"], str] """ The format of the document. Currently supports `files` only. """ diff --git a/stripe/params/v2/core/_event_destination_list_params.py b/stripe/params/v2/core/_event_destination_list_params.py index c0320468a..d0cd324a3 100644 --- a/stripe/params/v2/core/_event_destination_list_params.py +++ b/stripe/params/v2/core/_event_destination_list_params.py @@ -1,11 +1,11 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from typing import List +from typing import List, Union from typing_extensions import Literal, NotRequired, TypedDict class EventDestinationListParams(TypedDict): - include: NotRequired[List[Literal["webhook_endpoint.url"]]] + include: NotRequired[List[Union[Literal["webhook_endpoint.url"], str]]] """ Additional fields to include in the response. Currently supports `webhook_endpoint.url`. """ diff --git a/stripe/params/v2/core/_event_destination_retrieve_params.py b/stripe/params/v2/core/_event_destination_retrieve_params.py index d43606b1d..ad0200416 100644 --- a/stripe/params/v2/core/_event_destination_retrieve_params.py +++ b/stripe/params/v2/core/_event_destination_retrieve_params.py @@ -1,11 +1,11 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from typing import List +from typing import List, Union from typing_extensions import Literal, NotRequired, TypedDict class EventDestinationRetrieveParams(TypedDict): - include: NotRequired[List[Literal["webhook_endpoint.url"]]] + include: NotRequired[List[Union[Literal["webhook_endpoint.url"], str]]] """ Additional fields to include in the response. """ diff --git a/stripe/params/v2/core/_event_destination_update_params.py b/stripe/params/v2/core/_event_destination_update_params.py index bc0feb0b8..b9b59ba83 100644 --- a/stripe/params/v2/core/_event_destination_update_params.py +++ b/stripe/params/v2/core/_event_destination_update_params.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._stripe_object import UntypedStripeObject -from typing import Dict, List, Optional +from typing import Dict, List, Optional, Union from typing_extensions import Literal, NotRequired, TypedDict @@ -14,7 +14,7 @@ class EventDestinationUpdateParams(TypedDict): """ The list of events to enable for this endpoint. """ - include: NotRequired[List[Literal["webhook_endpoint.url"]]] + include: NotRequired[List[Union[Literal["webhook_endpoint.url"], str]]] """ Additional fields to include in the response. Currently supports `webhook_endpoint.url`. """ diff --git a/stripe/params/v2/core/_event_list_params.py b/stripe/params/v2/core/_event_list_params.py index f4ce800a9..9e2a4da69 100644 --- a/stripe/params/v2/core/_event_list_params.py +++ b/stripe/params/v2/core/_event_list_params.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from typing import List +from typing import List, Union from typing_extensions import Literal, NotRequired, TypedDict @@ -9,7 +9,7 @@ class EventListParams(TypedDict): """ Set of filters to query events within a range of `created` timestamps. """ - include: NotRequired[List[Literal["reason.request.client"]]] + include: NotRequired[List[Union[Literal["reason.request.client"], str]]] """ Additional fields to include in the response. """ diff --git a/stripe/params/v2/core/_event_retrieve_params.py b/stripe/params/v2/core/_event_retrieve_params.py index 12cabb660..cc751095f 100644 --- a/stripe/params/v2/core/_event_retrieve_params.py +++ b/stripe/params/v2/core/_event_retrieve_params.py @@ -1,11 +1,11 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from typing import List +from typing import List, Union from typing_extensions import Literal, NotRequired, TypedDict class EventRetrieveParams(TypedDict): - include: NotRequired[List[Literal["reason.request.client"]]] + include: NotRequired[List[Union[Literal["reason.request.client"], str]]] """ Additional fields to include in the response. """ diff --git a/stripe/params/v2/core/accounts/_person_create_params.py b/stripe/params/v2/core/accounts/_person_create_params.py index f0aadc02f..d4f098d25 100644 --- a/stripe/params/v2/core/accounts/_person_create_params.py +++ b/stripe/params/v2/core/accounts/_person_create_params.py @@ -245,7 +245,7 @@ class PersonCreateParamsDocumentsCompanyAuthorization(TypedDict): """ One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. """ - type: Literal["files"] + type: Union[Literal["files"], str] """ The format of the document. Currently supports `files` only. """ @@ -256,7 +256,7 @@ class PersonCreateParamsDocumentsPassport(TypedDict): """ One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. """ - type: Literal["files"] + type: Union[Literal["files"], str] """ The format of the document. Currently supports `files` only. """ @@ -267,7 +267,7 @@ class PersonCreateParamsDocumentsPrimaryVerification(TypedDict): """ The [file upload](https://docs.stripe.com/api/persons/update#create_file) tokens referring to each side of the document. """ - type: Literal["front_back"] + type: Union[Literal["front_back"], str] """ The format of the verification document. Currently supports `front_back` only. """ @@ -289,7 +289,7 @@ class PersonCreateParamsDocumentsSecondaryVerification(TypedDict): """ The [file upload](https://docs.stripe.com/api/persons/update#create_file) tokens referring to each side of the document. """ - type: Literal["front_back"] + type: Union[Literal["front_back"], str] """ The format of the verification document. Currently supports `front_back` only. """ @@ -311,7 +311,7 @@ class PersonCreateParamsDocumentsVisa(TypedDict): """ One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. """ - type: Literal["files"] + type: Union[Literal["files"], str] """ The format of the document. Currently supports `files` only. """ diff --git a/stripe/params/v2/core/accounts/_person_token_create_params.py b/stripe/params/v2/core/accounts/_person_token_create_params.py index 4f9e18c42..332835fe6 100644 --- a/stripe/params/v2/core/accounts/_person_token_create_params.py +++ b/stripe/params/v2/core/accounts/_person_token_create_params.py @@ -239,7 +239,7 @@ class PersonTokenCreateParamsDocumentsCompanyAuthorization(TypedDict): """ One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. """ - type: Literal["files"] + type: Union[Literal["files"], str] """ The format of the document. Currently supports `files` only. """ @@ -250,7 +250,7 @@ class PersonTokenCreateParamsDocumentsPassport(TypedDict): """ One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. """ - type: Literal["files"] + type: Union[Literal["files"], str] """ The format of the document. Currently supports `files` only. """ @@ -261,7 +261,7 @@ class PersonTokenCreateParamsDocumentsPrimaryVerification(TypedDict): """ The [file upload](https://docs.stripe.com/api/persons/update#create_file) tokens referring to each side of the document. """ - type: Literal["front_back"] + type: Union[Literal["front_back"], str] """ The format of the verification document. Currently supports `front_back` only. """ @@ -285,7 +285,7 @@ class PersonTokenCreateParamsDocumentsSecondaryVerification(TypedDict): """ The [file upload](https://docs.stripe.com/api/persons/update#create_file) tokens referring to each side of the document. """ - type: Literal["front_back"] + type: Union[Literal["front_back"], str] """ The format of the verification document. Currently supports `front_back` only. """ @@ -309,7 +309,7 @@ class PersonTokenCreateParamsDocumentsVisa(TypedDict): """ One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. """ - type: Literal["files"] + type: Union[Literal["files"], str] """ The format of the document. Currently supports `files` only. """ diff --git a/stripe/params/v2/core/accounts/_person_update_params.py b/stripe/params/v2/core/accounts/_person_update_params.py index 60ac97414..447caf2ba 100644 --- a/stripe/params/v2/core/accounts/_person_update_params.py +++ b/stripe/params/v2/core/accounts/_person_update_params.py @@ -247,7 +247,7 @@ class PersonUpdateParamsDocumentsCompanyAuthorization(TypedDict): """ One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. """ - type: Literal["files"] + type: Union[Literal["files"], str] """ The format of the document. Currently supports `files` only. """ @@ -258,7 +258,7 @@ class PersonUpdateParamsDocumentsPassport(TypedDict): """ One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. """ - type: Literal["files"] + type: Union[Literal["files"], str] """ The format of the document. Currently supports `files` only. """ @@ -269,7 +269,7 @@ class PersonUpdateParamsDocumentsPrimaryVerification(TypedDict): """ The [file upload](https://docs.stripe.com/api/persons/update#create_file) tokens referring to each side of the document. """ - type: Literal["front_back"] + type: Union[Literal["front_back"], str] """ The format of the verification document. Currently supports `front_back` only. """ @@ -291,7 +291,7 @@ class PersonUpdateParamsDocumentsSecondaryVerification(TypedDict): """ The [file upload](https://docs.stripe.com/api/persons/update#create_file) tokens referring to each side of the document. """ - type: Literal["front_back"] + type: Union[Literal["front_back"], str] """ The format of the verification document. Currently supports `front_back` only. """ @@ -313,7 +313,7 @@ class PersonUpdateParamsDocumentsVisa(TypedDict): """ One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. """ - type: Literal["files"] + type: Union[Literal["files"], str] """ The format of the document. Currently supports `files` only. """ diff --git a/stripe/params/v2/data/reporting/_query_run_retrieve_params.py b/stripe/params/v2/data/reporting/_query_run_retrieve_params.py index 01bcd4e4c..a429bc340 100644 --- a/stripe/params/v2/data/reporting/_query_run_retrieve_params.py +++ b/stripe/params/v2/data/reporting/_query_run_retrieve_params.py @@ -1,11 +1,11 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from typing import List +from typing import List, Union from typing_extensions import Literal, NotRequired, TypedDict class QueryRunRetrieveParams(TypedDict): - include: NotRequired[List[Literal["result.file.schema"]]] + include: NotRequired[List[Union[Literal["result.file.schema"], str]]] """ Any optional includes (see https://docs.stripe.com/api-includable-response-values). """ diff --git a/stripe/params/v2/money_management/_outbound_payment_create_params.py b/stripe/params/v2/money_management/_outbound_payment_create_params.py index ecfc2e750..01ab786cf 100644 --- a/stripe/params/v2/money_management/_outbound_payment_create_params.py +++ b/stripe/params/v2/money_management/_outbound_payment_create_params.py @@ -32,7 +32,7 @@ class OutboundPaymentCreateParams(_OutboundPaymentCreateParamsBase): """ The quote for this OutboundPayment. Only required for countries with regulatory mandates to display fee estimates before OutboundPayment creation. """ - purpose: NotRequired[Literal["payroll"]] + purpose: NotRequired["Literal['payroll']|str"] """ The purpose of the OutboundPayment. """ @@ -196,7 +196,7 @@ class OutboundPaymentCreateParamsToPayoutMethodOptionsBankAccountPreferredNetwor """ Open Enum. ACH submission timing. """ - transaction_purpose: NotRequired[Literal["payroll"]] + transaction_purpose: NotRequired["Literal['payroll']|str"] """ The transaction purpose for this ACH payment. """ diff --git a/stripe/params/v2/money_management/_outbound_payment_quote_create_params.py b/stripe/params/v2/money_management/_outbound_payment_quote_create_params.py index 89cd0d831..b8d455cd4 100644 --- a/stripe/params/v2/money_management/_outbound_payment_quote_create_params.py +++ b/stripe/params/v2/money_management/_outbound_payment_quote_create_params.py @@ -136,7 +136,7 @@ class OutboundPaymentQuoteCreateParamsToPayoutMethodOptionsBankAccountPreferredN """ Open Enum. ACH submission timing. """ - transaction_purpose: NotRequired[Literal["payroll"]] + transaction_purpose: NotRequired["Literal['payroll']|str"] """ The transaction purpose for this ACH payment. """ diff --git a/stripe/params/v2/money_management/_payout_intent_create_params.py b/stripe/params/v2/money_management/_payout_intent_create_params.py index 520a6c4e7..7c953632e 100644 --- a/stripe/params/v2/money_management/_payout_intent_create_params.py +++ b/stripe/params/v2/money_management/_payout_intent_create_params.py @@ -151,7 +151,7 @@ class PayoutIntentCreateParamsToPayoutMethodOptionsBankAccountPreferredNetworkOp """ Open Enum. ACH submission timing. """ - transaction_purpose: NotRequired[Literal["payroll"]] + transaction_purpose: NotRequired["Literal['payroll']|str"] """ The transaction purpose for this ACH payment. """ diff --git a/stripe/params/v2/money_management/_payout_intent_update_params.py b/stripe/params/v2/money_management/_payout_intent_update_params.py index 43475e8cc..092a5dc8b 100644 --- a/stripe/params/v2/money_management/_payout_intent_update_params.py +++ b/stripe/params/v2/money_management/_payout_intent_update_params.py @@ -147,7 +147,7 @@ class PayoutIntentUpdateParamsToPayoutMethodOptionsBankAccountPreferredNetworkOp """ Open Enum. ACH submission timing. """ - transaction_purpose: NotRequired[Literal["payroll"]] + transaction_purpose: NotRequired["Literal['payroll']|str"] """ The transaction purpose for this ACH payment. """ diff --git a/stripe/params/v2/money_management/_received_debit_mandate_list_params.py b/stripe/params/v2/money_management/_received_debit_mandate_list_params.py index 36d29adb0..b63d02f2c 100644 --- a/stripe/params/v2/money_management/_received_debit_mandate_list_params.py +++ b/stripe/params/v2/money_management/_received_debit_mandate_list_params.py @@ -26,7 +26,7 @@ class ReceivedDebitMandateListParams(TypedDict): """ Filter by mandate status. """ - type: NotRequired[Literal["bank_transfer"]] + type: NotRequired["Literal['bank_transfer']|str"] """ The type of ReceivedDebitMandate to filter by. """ diff --git a/stripe/params/v2/payments/_off_session_payment_create_params.py b/stripe/params/v2/payments/_off_session_payment_create_params.py index c293d94df..bccd5b8fc 100644 --- a/stripe/params/v2/payments/_off_session_payment_create_params.py +++ b/stripe/params/v2/payments/_off_session_payment_create_params.py @@ -222,7 +222,7 @@ class OffSessionPaymentCreateParamsPaymentMethodData(TypedDict): """ Contains card details that can be used to create a card PaymentMethod for PCI compliant users. """ - type: Literal["card"] + type: Union[Literal["card"], str] """ The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type. """ diff --git a/stripe/params/v2/reporting/_report_run_retrieve_params.py b/stripe/params/v2/reporting/_report_run_retrieve_params.py index 9f390f5f6..6ce97c58a 100644 --- a/stripe/params/v2/reporting/_report_run_retrieve_params.py +++ b/stripe/params/v2/reporting/_report_run_retrieve_params.py @@ -1,11 +1,11 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec -from typing import List +from typing import List, Union from typing_extensions import Literal, NotRequired, TypedDict class ReportRunRetrieveParams(TypedDict): - include: NotRequired[List[Literal["result.file.schema"]]] + include: NotRequired[List[Union[Literal["result.file.schema"], str]]] """ Any optional includes (see https://docs.stripe.com/api-includable-response-values). """ diff --git a/stripe/product_catalog/_trial_offer.py b/stripe/product_catalog/_trial_offer.py index d9e9fcf3e..1b740f53a 100644 --- a/stripe/product_catalog/_trial_offer.py +++ b/stripe/product_catalog/_trial_offer.py @@ -59,7 +59,7 @@ class Transition(StripeObject): """ transition: Transition - type: Literal["transition"] + type: Union[Literal["transition"], str] """ The type of behavior when the trial offer ends. """ diff --git a/stripe/radar/__init__.py b/stripe/radar/__init__.py index b41469436..2a6f65a74 100644 --- a/stripe/radar/__init__.py +++ b/stripe/radar/__init__.py @@ -10,6 +10,12 @@ from stripe.radar._account_evaluation_service import ( AccountEvaluationService as AccountEvaluationService, ) + from stripe.radar._billing_evaluation import ( + BillingEvaluation as BillingEvaluation, + ) + from stripe.radar._billing_evaluation_service import ( + BillingEvaluationService as BillingEvaluationService, + ) from stripe.radar._customer_evaluation import ( CustomerEvaluation as CustomerEvaluation, ) @@ -50,6 +56,11 @@ "stripe.radar._account_evaluation_service", False, ), + "BillingEvaluation": ("stripe.radar._billing_evaluation", False), + "BillingEvaluationService": ( + "stripe.radar._billing_evaluation_service", + False, + ), "CustomerEvaluation": ("stripe.radar._customer_evaluation", False), "CustomerEvaluationService": ( "stripe.radar._customer_evaluation_service", diff --git a/stripe/radar/_billing_evaluation.py b/stripe/radar/_billing_evaluation.py new file mode 100644 index 000000000..1011f111c --- /dev/null +++ b/stripe/radar/_billing_evaluation.py @@ -0,0 +1,324 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._createable_api_resource import CreateableAPIResource +from stripe._stripe_object import StripeObject, UntypedStripeObject +from typing import ClassVar, Optional, Union, cast +from typing_extensions import Literal, Unpack, TYPE_CHECKING + +if TYPE_CHECKING: + from stripe.params.radar._billing_evaluation_create_params import ( + BillingEvaluationCreateParams, + ) + + +class BillingEvaluation(CreateableAPIResource["BillingEvaluation"]): + """ + Billing Evaluations represent Stripe Radar's assessment of the non-payment abuse risk of an upcoming charge. Unlike a [Payment Evaluation](https://docs.stripe.com/api/radar/payment-evaluation), a billing evaluation is created before the payment is attempted and returns the `non_payment_abuse` signal only. + """ + + OBJECT_NAME: ClassVar[Literal["radar.billing_evaluation"]] = ( + "radar.billing_evaluation" + ) + + class ClientDeviceMetadataDetails(StripeObject): + radar_session: Optional[str] + """ + ID for the Radar Session associated with the billing evaluation. A [Radar Session](https://docs.stripe.com/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. + """ + + class CustomerDetails(StripeObject): + class Data(StripeObject): + email: Optional[str] + """ + The customer's email address. + """ + name: Optional[str] + """ + The customer's full name or business name. + """ + phone: Optional[str] + """ + The customer's phone number. + """ + + customer: Optional[str] + """ + The ID of the customer whose upcoming payment was evaluated. + """ + customer_account: Optional[str] + """ + The ID of the Account representing the customer whose upcoming payment was evaluated. + """ + data: Optional[Data] + """ + Attributes of the customer being evaluated. These are populated from the `customer` or `customer_account` object when one was supplied, and from the request otherwise. + """ + _inner_class_types = {"data": Data} + + class PaymentDetails(StripeObject): + class MoneyMovementDetails(StripeObject): + class Card(StripeObject): + customer_presence: Optional[ + Union[Literal["off_session", "on_session"], str] + ] + """ + Describes the presence of the customer during the payment. + """ + payment_type: Optional[ + Union[ + Literal[ + "one_off", + "recurring", + "setup_one_off", + "setup_recurring", + ], + str, + ] + ] + """ + Describes the type of payment. + """ + + card: Optional[Card] + """ + Describes card money movement details. + """ + money_movement_type: Literal["card"] + """ + Describes the type of money movement. Currently only `card` is supported. + """ + _inner_class_types = {"card": Card} + + class PaymentMethodDetails(StripeObject): + class BillingDetails(StripeObject): + class Address(StripeObject): + city: Optional[str] + """ + City, district, suburb, town, or village. + """ + country: Optional[str] + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: Optional[str] + """ + Address line 1, such as the street, PO Box, or company name. + """ + line2: Optional[str] + """ + Address line 2, such as the apartment, suite, unit, or building. + """ + postal_code: Optional[str] + """ + ZIP or postal code. + """ + state: Optional[str] + """ + State, county, province, or region ([ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2)). + """ + + address: Address + """ + Address data. + """ + email: Optional[str] + """ + Email address. + """ + name: Optional[str] + """ + Full name. + """ + phone: Optional[str] + """ + Billing phone number (including extension). + """ + _inner_class_types = {"address": Address} + + billing_details: Optional[BillingDetails] + """ + Billing information associated with the billing evaluation. + """ + payment_method: Optional[str] + """ + The payment method that will be charged. + """ + _inner_class_types = {"billing_details": BillingDetails} + + class ShippingDetails(StripeObject): + class Address(StripeObject): + city: Optional[str] + """ + City, district, suburb, town, or village. + """ + country: Optional[str] + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: Optional[str] + """ + Address line 1, such as the street, PO Box, or company name. + """ + line2: Optional[str] + """ + Address line 2, such as the apartment, suite, unit, or building. + """ + postal_code: Optional[str] + """ + ZIP or postal code. + """ + state: Optional[str] + """ + State, county, province, or region ([ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2)). + """ + + address: Address + """ + Address data. + """ + name: Optional[str] + """ + Shipping name. + """ + phone: Optional[str] + """ + Shipping phone number. + """ + _inner_class_types = {"address": Address} + + amount: int + """ + Amount intended to be collected by this payment. A positive integer representing how much to charge in the [smallest currency unit](https://docs.stripe.com/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). The minimum amount is $0.50 US or [equivalent in charge currency](https://docs.stripe.com/currencies#minimum-and-maximum-charge-amounts). The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99). + """ + currency: str + """ + Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). + """ + description: Optional[str] + """ + An arbitrary string attached to the object. Often useful for displaying to users. + """ + money_movement_details: Optional[MoneyMovementDetails] + """ + Details about the payment's customer presence and type. + """ + payment_method_details: Optional[PaymentMethodDetails] + """ + Details about the payment method that will be charged. + """ + shipping_details: Optional[ShippingDetails] + """ + Shipping details for the billing evaluation. + """ + statement_descriptor: Optional[str] + """ + Payment statement descriptor. + """ + _inner_class_types = { + "money_movement_details": MoneyMovementDetails, + "payment_method_details": PaymentMethodDetails, + "shipping_details": ShippingDetails, + } + + class Signals(StripeObject): + class NonPaymentAbuse(StripeObject): + evaluated_at: int + """ + The time when this signal was evaluated. + """ + risk_level: Union[ + Literal[ + "elevated", + "highest", + "low", + "normal", + "not_assessed", + "unknown", + ], + str, + ] + """ + Risk level. + """ + + non_payment_abuse: Optional[NonPaymentAbuse] + """ + Stripe Radar's assessment of the likelihood that the upcoming charge results in non-payment abuse. + """ + _inner_class_types = {"non_payment_abuse": NonPaymentAbuse} + + client_device_metadata_details: Optional[ClientDeviceMetadataDetails] + """ + Client device metadata attached to this billing evaluation. + """ + created_at: int + """ + Time at which the object was created. Measured in seconds since the Unix epoch. + """ + customer_details: Optional[CustomerDetails] + """ + Details of the customer this billing evaluation assesses. + """ + id: str + """ + Unique identifier for the object. + """ + livemode: bool + """ + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. + """ + metadata: Optional[UntypedStripeObject[str]] + """ + Set of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + """ + object: Literal["radar.billing_evaluation"] + """ + String representing the object's type. Objects of the same type share the same value. + """ + payment_details: Optional[PaymentDetails] + """ + Payment details for the upcoming charge this billing evaluation assesses. + """ + signals: Signals + """ + Stripe Radar's signals for the upcoming charge this billing evaluation assesses. + """ + + @classmethod + def create( + cls, **params: Unpack["BillingEvaluationCreateParams"] + ) -> "BillingEvaluation": + """ + Request Stripe Radar's assessment of the non-payment abuse risk of an upcoming charge, before the payment is attempted. + """ + return cast( + "BillingEvaluation", + cls._static_request( + "post", + cls.class_url(), + params=params, + ), + ) + + @classmethod + async def create_async( + cls, **params: Unpack["BillingEvaluationCreateParams"] + ) -> "BillingEvaluation": + """ + Request Stripe Radar's assessment of the non-payment abuse risk of an upcoming charge, before the payment is attempted. + """ + return cast( + "BillingEvaluation", + await cls._static_request_async( + "post", + cls.class_url(), + params=params, + ), + ) + + _inner_class_types = { + "client_device_metadata_details": ClientDeviceMetadataDetails, + "customer_details": CustomerDetails, + "payment_details": PaymentDetails, + "signals": Signals, + } diff --git a/stripe/radar/_billing_evaluation_service.py b/stripe/radar/_billing_evaluation_service.py new file mode 100644 index 000000000..df8501c06 --- /dev/null +++ b/stripe/radar/_billing_evaluation_service.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_service import StripeService +from typing import Optional, cast +from typing_extensions import TYPE_CHECKING + +if TYPE_CHECKING: + from stripe._request_options import RequestOptions + from stripe.params.radar._billing_evaluation_create_params import ( + BillingEvaluationCreateParams, + ) + from stripe.radar._billing_evaluation import BillingEvaluation + + +class BillingEvaluationService(StripeService): + def create( + self, + params: "BillingEvaluationCreateParams", + options: Optional["RequestOptions"] = None, + ) -> "BillingEvaluation": + """ + Request Stripe Radar's assessment of the non-payment abuse risk of an upcoming charge, before the payment is attempted. + """ + return cast( + "BillingEvaluation", + self._request( + "post", + "/v1/radar/billing_evaluations", + base_address="api", + params=params, + options=options, + ), + ) + + async def create_async( + self, + params: "BillingEvaluationCreateParams", + options: Optional["RequestOptions"] = None, + ) -> "BillingEvaluation": + """ + Request Stripe Radar's assessment of the non-payment abuse risk of an upcoming charge, before the payment is attempted. + """ + return cast( + "BillingEvaluation", + await self._request_async( + "post", + "/v1/radar/billing_evaluations", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/radar/_payment_evaluation.py b/stripe/radar/_payment_evaluation.py index cc9b24909..c666bd580 100644 --- a/stripe/radar/_payment_evaluation.py +++ b/stripe/radar/_payment_evaluation.py @@ -366,7 +366,7 @@ class Card(StripeObject): card: Optional[Card] """ - Describes card money movement details for the payment evaluation. + Describes card money movement details. """ money_movement_type: Literal["card"] """ diff --git a/stripe/shared_payment/_granted_token.py b/stripe/shared_payment/_granted_token.py index 9d0a5f90e..21310fb2d 100644 --- a/stripe/shared_payment/_granted_token.py +++ b/stripe/shared_payment/_granted_token.py @@ -532,6 +532,16 @@ class AmountCaptured(StripeObject): _inner_class_types = {"amount_captured": AmountCaptured} class UsageLimits(StripeObject): + class Recurring(StripeObject): + interval: Union[Literal["day", "month", "week", "year"], str] + """ + The interval at which the shared payment token's amount usage restrictions reset. + """ + interval_count: int + """ + The number of intervals between each reset. + """ + currency: str """ Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). @@ -544,12 +554,17 @@ class UsageLimits(StripeObject): """ Max amount that can be captured using this SharedPaymentToken. """ + recurring: Optional[Recurring] + """ + The recurring schedule for the shared payment token's amount usage restrictions. + """ recurring_interval: Optional[ Union[Literal["month", "week", "year"], str] ] """ The recurring interval at which the shared payment token's amount usage restrictions reset. """ + _inner_class_types = {"recurring": Recurring} agent_details: Optional[AgentDetails] """ diff --git a/stripe/shared_payment/_issued_token.py b/stripe/shared_payment/_issued_token.py index 57e5cb2f5..d0fec92a9 100644 --- a/stripe/shared_payment/_issued_token.py +++ b/stripe/shared_payment/_issued_token.py @@ -175,6 +175,16 @@ class AmountCaptured(StripeObject): _inner_class_types = {"amount_captured": AmountCaptured} class UsageLimits(StripeObject): + class Recurring(StripeObject): + interval: Union[Literal["day", "month", "week", "year"], str] + """ + The interval at which the shared payment token's amount usage restrictions reset. + """ + interval_count: int + """ + The number of intervals between each reset. + """ + currency: str """ Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). @@ -187,12 +197,17 @@ class UsageLimits(StripeObject): """ Max amount that can be captured using this SharedPaymentToken. """ + recurring: Optional[Recurring] + """ + The recurring schedule for the shared payment token's amount usage restrictions. + """ recurring_interval: Optional[ Union[Literal["month", "week", "year"], str] ] """ The recurring interval at which the shared payment token's amount usage restrictions reset. """ + _inner_class_types = {"recurring": Recurring} created: int """ diff --git a/stripe/tax/_registration.py b/stripe/tax/_registration.py index ac77c57b1..f2ec86c17 100644 --- a/stripe/tax/_registration.py +++ b/stripe/tax/_registration.py @@ -1166,7 +1166,7 @@ class Sr(StripeObject): """ class Th(StripeObject): - type: Literal["simplified"] + type: Union[Literal["simplified"], str] """ Type of registration in `country`. """ diff --git a/stripe/terminal/_reader.py b/stripe/terminal/_reader.py index 86ebb8c83..e82b63dbe 100644 --- a/stripe/terminal/_reader.py +++ b/stripe/terminal/_reader.py @@ -132,6 +132,7 @@ class ApiError(StripeObject): "api_key_expired", "application_fees_not_allowed", "approval_required", + "authentication_failure", "authentication_required", "balance_insufficient", "balance_invalid_parameter", @@ -144,6 +145,7 @@ class ApiError(StripeObject): "bank_account_verification_failed", "billing_invalid_mandate", "bitcoin_upgrade_required", + "capability_not_active", "capture_charge_authorization_expired", "capture_unauthorized_payment", "card_decline_rate_limit_exceeded", @@ -168,6 +170,7 @@ class ApiError(StripeObject): "debit_not_authorized", "email_invalid", "expired_card", + "expired_payment_method", "failed_tax_calculation", "financial_account_balance_does_not_support_currency", "financial_account_capability_not_enabled", @@ -187,6 +190,7 @@ class ApiError(StripeObject): "incorrect_address", "incorrect_cvc", "incorrect_number", + "incorrect_postal_code", "incorrect_zip", "india_recurring_payment_mandate_canceled", "instant_payouts_config_disabled", @@ -196,6 +200,7 @@ class ApiError(StripeObject): "insufficient_funds", "intent_invalid_state", "intent_verification_method_missing", + "invalid_canceled_subscription_fields", "invalid_card_type", "invalid_characters", "invalid_charge_amount", @@ -255,6 +260,7 @@ class ApiError(StripeObject): "payment_method_not_available", "payment_method_provider_decline", "payment_method_provider_timeout", + "payment_method_restricted", "payment_method_unactivated", "payment_method_unexpected_state", "payment_method_unsupported_type", @@ -1074,7 +1080,7 @@ class LineItem(StripeObject): """ status: Optional[Union[Literal["offline", "online"], str]] """ - The networking status of the reader. We do not recommend using this field in flows that may block taking payments. + The networking status of the reader. This value is `null` for mobile readers. We do not recommend using this field in flows that may block taking payments. """ @classmethod diff --git a/stripe/treasury/_outbound_payment.py b/stripe/treasury/_outbound_payment.py index 6cc41a812..4512897ec 100644 --- a/stripe/treasury/_outbound_payment.py +++ b/stripe/treasury/_outbound_payment.py @@ -300,7 +300,7 @@ class UsDomesticWire(StripeObject): """ String representing the object's type. Objects of the same type share the same value. """ - purpose: Optional[Literal["payroll"]] + purpose: Optional[Union[Literal["payroll"], str]] """ The purpose of the OutboundPayment, if applicable. """ diff --git a/stripe/v2/billing/_cadence.py b/stripe/v2/billing/_cadence.py index 7d52123d2..132942731 100644 --- a/stripe/v2/billing/_cadence.py +++ b/stripe/v2/billing/_cadence.py @@ -174,7 +174,7 @@ class Time(StripeObject): class InvoiceDiscountRule(StripeObject): class PercentOff(StripeObject): class MaximumApplications(StripeObject): - type: Literal["indefinite"] + type: Union[Literal["indefinite"], str] """ Max applications type of this discount, ex: indefinite. """ @@ -198,7 +198,7 @@ class MaximumApplications(StripeObject): """ Details if the discount is a percentage off. """ - type: Literal["percent_off"] + type: Union[Literal["percent_off"], str] """ The type of the discount. """ @@ -213,7 +213,7 @@ class Payer(StripeObject): """ The ID of the Customer object. """ - type: Literal["customer"] + type: Union[Literal["customer"], str] """ A string identifying the type of the payer. Currently the only supported value is `customer`. """ @@ -425,7 +425,9 @@ class EuBankTransfer(StripeObject): """ Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`. """ - funding_type: Optional[Literal["bank_transfer"]] + funding_type: Optional[ + Union[Literal["bank_transfer"], str] + ] """ The funding method type to be used when there are not enough funds in the customer balance. Currently the only supported value is `bank_transfer`. """ diff --git a/stripe/v2/billing/_cadence_spend_modifier.py b/stripe/v2/billing/_cadence_spend_modifier.py index 5bb8a877e..fae279692 100644 --- a/stripe/v2/billing/_cadence_spend_modifier.py +++ b/stripe/v2/billing/_cadence_spend_modifier.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._stripe_object import StripeObject -from typing import ClassVar, Optional +from typing import ClassVar, Optional, Union from typing_extensions import Literal @@ -30,7 +30,7 @@ class CustomPricingUnit(StripeObject): """ The custom pricing unit amount. Present if type is `custom_pricing_unit`. """ - type: Literal["custom_pricing_unit"] + type: Union[Literal["custom_pricing_unit"], str] """ The type of the spend modifier amount. """ @@ -91,7 +91,7 @@ class CustomPricingUnitOverageRate(StripeObject): """ String representing the object's type. Objects of the same type share the same value of the object field. """ - type: Literal["max_billing_period_spend"] + type: Union[Literal["max_billing_period_spend"], str] """ The type of the spend modifier. """ diff --git a/stripe/v2/billing/_collection_setting.py b/stripe/v2/billing/_collection_setting.py index 910efe646..61dc994d9 100644 --- a/stripe/v2/billing/_collection_setting.py +++ b/stripe/v2/billing/_collection_setting.py @@ -131,7 +131,7 @@ class EuBankTransfer(StripeObject): """ Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`. """ - funding_type: Optional[Literal["bank_transfer"]] + funding_type: Optional[Union[Literal["bank_transfer"], str]] """ The funding method type to be used when there are not enough funds in the customer balance. Currently the only supported value is `bank_transfer`. """ diff --git a/stripe/v2/billing/_collection_setting_version.py b/stripe/v2/billing/_collection_setting_version.py index 9e7502b1c..85b248ebd 100644 --- a/stripe/v2/billing/_collection_setting_version.py +++ b/stripe/v2/billing/_collection_setting_version.py @@ -131,7 +131,7 @@ class EuBankTransfer(StripeObject): """ Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`. """ - funding_type: Optional[Literal["bank_transfer"]] + funding_type: Optional[Union[Literal["bank_transfer"], str]] """ The funding method type to be used when there are not enough funds in the customer balance. Currently the only supported value is `bank_transfer`. """ diff --git a/stripe/v2/billing/_contract.py b/stripe/v2/billing/_contract.py index a70de4235..b5c284237 100644 --- a/stripe/v2/billing/_contract.py +++ b/stripe/v2/billing/_contract.py @@ -162,7 +162,7 @@ class StartsAt(StripeObject): """ Timestamp when this override starts. """ - type: Literal["overwrite_price"] + type: Union[Literal["overwrite_price"], str] """ The type of override. """ @@ -199,7 +199,7 @@ class StartsAt(StripeObject): """ V1 price details. Present when `type` is `price`. """ - type: Literal["price"] + type: Union[Literal["price"], str] """ The type of pricing. """ @@ -314,7 +314,7 @@ class StartsAt(StripeObject): """ Resolved timestamp when the pricing override starts. """ - type: Literal["multiply_pricing"] + type: Union[Literal["multiply_pricing"], str] """ The type of pricing override. """ diff --git a/stripe/v2/billing/_contract_pricing_line_quantity_change.py b/stripe/v2/billing/_contract_pricing_line_quantity_change.py index f473bc5ca..7ff9d5c02 100644 --- a/stripe/v2/billing/_contract_pricing_line_quantity_change.py +++ b/stripe/v2/billing/_contract_pricing_line_quantity_change.py @@ -2,7 +2,7 @@ # File generated from our OpenAPI spec from decimal import Decimal from stripe._stripe_object import StripeObject -from typing import ClassVar, Optional +from typing import ClassVar, Optional, Union from typing_extensions import Literal @@ -20,7 +20,7 @@ class Pricing(StripeObject): """ The ID of the V1 price. Present when `type` is `price`. """ - type: Literal["price"] + type: Union[Literal["price"], str] """ The type of pricing. """ diff --git a/stripe/v2/billing/_intent_action.py b/stripe/v2/billing/_intent_action.py index 69c69ac78..4dd2ddef2 100644 --- a/stripe/v2/billing/_intent_action.py +++ b/stripe/v2/billing/_intent_action.py @@ -55,7 +55,7 @@ class EffectiveAt(StripeObject): class InvoiceDiscountRule(StripeObject): class PercentOff(StripeObject): class MaximumApplications(StripeObject): - type: Literal["indefinite"] + type: Union[Literal["indefinite"], str] """ The type of maximum applications configuration. """ @@ -73,7 +73,7 @@ class MaximumApplications(StripeObject): } _field_encodings = {"percent_off": "decimal_string"} - applies_to: Literal["cadence"] + applies_to: Union[Literal["cadence"], str] """ The entity that the discount rule applies to, for example, the Billing Cadence. """ @@ -85,7 +85,7 @@ class MaximumApplications(StripeObject): """ Configuration for percentage off discount. """ - type: Literal["percent_off"] + type: Union[Literal["percent_off"], str] """ Type of the discount rule. """ @@ -147,7 +147,7 @@ class CustomPricingUnitOverageRate(StripeObject): """ Details for max billing period spend modifier. Only present if type is max_billing_period_spend. """ - type: Literal["max_billing_period_spend"] + type: Union[Literal["max_billing_period_spend"], str] """ Type of the spend modifier. """ diff --git a/stripe/v2/billing/_meter_event_adjustment.py b/stripe/v2/billing/_meter_event_adjustment.py index 741df9078..1a74d9bc3 100644 --- a/stripe/v2/billing/_meter_event_adjustment.py +++ b/stripe/v2/billing/_meter_event_adjustment.py @@ -48,7 +48,7 @@ class Cancel(StripeObject): """ Open Enum. The meter event adjustment's status. """ - type: Literal["cancel"] + type: Union[Literal["cancel"], str] """ Open Enum. Specifies the type of cancellation. Currently supports canceling a single event. """ diff --git a/stripe/v2/billing/_pricing_plan_subscription.py b/stripe/v2/billing/_pricing_plan_subscription.py index dce05a1b5..98d432992 100644 --- a/stripe/v2/billing/_pricing_plan_subscription.py +++ b/stripe/v2/billing/_pricing_plan_subscription.py @@ -46,7 +46,7 @@ class CancellationDetails(StripeObject): """ The customer submitted reason for why they canceled, if the subscription was canceled explicitly by the user. """ - reason: Optional[Literal["cancellation_requested"]] + reason: Optional[Union[Literal["cancellation_requested"], str]] """ System-generated reason for cancellation. """ @@ -283,7 +283,7 @@ class Scope(StripeObject): """ The billable items to apply the credit grant to. """ - price_type: Optional[Literal["metered"]] + price_type: Optional[Union[Literal["metered"], str]] """ The price type that credit grants can apply to. Stripe supports the `metered` price type, which applies to metered prices and rate cards. Cannot be used in combination with `billable_items`. """ @@ -295,7 +295,7 @@ class Scope(StripeObject): _inner_class_types = {"scope": Scope} class ExpiryConfig(StripeObject): - type: Literal["end_of_service_period"] + type: Union[Literal["end_of_service_period"], str] """ The type of the expiry configuration. We currently support `end_of_service_period`. """ @@ -361,7 +361,7 @@ class Scope(StripeObject): """ The billable items to apply the credit grant to. """ - price_type: Optional[Literal["metered"]] + price_type: Optional[Union[Literal["metered"], str]] """ The price type that credit grants can apply to. Stripe supports the `metered` price type, which applies to metered prices and rate cards. Cannot be used in combination with `billable_items`. """ @@ -373,7 +373,7 @@ class Scope(StripeObject): _inner_class_types = {"scope": Scope} class ExpiryConfig(StripeObject): - type: Literal["end_of_service_period"] + type: Union[Literal["end_of_service_period"], str] """ The type of the expiry configuration. We currently support `end_of_service_period`. """ diff --git a/stripe/v2/billing/_service_action.py b/stripe/v2/billing/_service_action.py index 263bf5a53..aeeeff607 100644 --- a/stripe/v2/billing/_service_action.py +++ b/stripe/v2/billing/_service_action.py @@ -60,7 +60,7 @@ class Scope(StripeObject): """ The billable items to apply the credit grant to. """ - price_type: Optional[Literal["metered"]] + price_type: Optional[Union[Literal["metered"], str]] """ The price type that credit grants can apply to. Stripe supports the `metered` price type, which applies to metered prices and rate cards. Cannot be used in combination with `billable_items`. """ @@ -72,7 +72,7 @@ class Scope(StripeObject): _inner_class_types = {"scope": Scope} class ExpiryConfig(StripeObject): - type: Literal["end_of_service_period"] + type: Union[Literal["end_of_service_period"], str] """ The type of the expiry configuration. We currently support `end_of_service_period`. """ @@ -146,7 +146,7 @@ class Scope(StripeObject): """ The billable items to apply the credit grant to. """ - price_type: Optional[Literal["metered"]] + price_type: Optional[Union[Literal["metered"], str]] """ The price type that credit grants can apply to. Stripe supports the `metered` price type, which applies to metered prices and rate cards. Cannot be used in combination with `billable_items`. """ @@ -158,7 +158,7 @@ class Scope(StripeObject): _inner_class_types = {"scope": Scope} class ExpiryConfig(StripeObject): - type: Literal["end_of_service_period"] + type: Union[Literal["end_of_service_period"], str] """ The type of the expiry configuration. We currently support `end_of_service_period`. """ diff --git a/stripe/v2/core/_account.py b/stripe/v2/core/_account.py index 78d8e2d85..a65022a6c 100644 --- a/stripe/v2/core/_account.py +++ b/stripe/v2/core/_account.py @@ -11098,7 +11098,7 @@ class BankAccountOwnershipVerification(StripeObject): """ One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. """ - type: Literal["files"] + type: Union[Literal["files"], str] """ The format of the document. Currently supports `files` only. """ @@ -11108,7 +11108,7 @@ class CompanyLicense(StripeObject): """ One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. """ - type: Literal["files"] + type: Union[Literal["files"], str] """ The format of the document. Currently supports `files` only. """ @@ -11118,7 +11118,7 @@ class CompanyMemorandumOfAssociation(StripeObject): """ One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. """ - type: Literal["files"] + type: Union[Literal["files"], str] """ The format of the document. Currently supports `files` only. """ @@ -11128,7 +11128,7 @@ class CompanyMinisterialDecree(StripeObject): """ One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. """ - type: Literal["files"] + type: Union[Literal["files"], str] """ The format of the document. Currently supports `files` only. """ @@ -11138,7 +11138,7 @@ class CompanyRegistrationVerification(StripeObject): """ One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. """ - type: Literal["files"] + type: Union[Literal["files"], str] """ The format of the document. Currently supports `files` only. """ @@ -11148,7 +11148,7 @@ class CompanyTaxIdVerification(StripeObject): """ One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. """ - type: Literal["files"] + type: Union[Literal["files"], str] """ The format of the document. Currently supports `files` only. """ @@ -11168,7 +11168,7 @@ class FrontBack(StripeObject): """ The [file upload](https://docs.stripe.com/api/persons/update#create_file) tokens for the front and back of the verification document. """ - type: Literal["front_back"] + type: Union[Literal["front_back"], str] """ The format of the verification document. Currently supports `front_back` only. """ @@ -11179,7 +11179,7 @@ class ProofOfAddress(StripeObject): """ One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. """ - type: Literal["files"] + type: Union[Literal["files"], str] """ The format of the document. Currently supports `files` only. """ @@ -11199,7 +11199,7 @@ class Signer(StripeObject): """ Person that is signing the document. """ - type: Literal["files"] + type: Union[Literal["files"], str] """ The format of the document. Currently supports `files` only. """ @@ -11220,7 +11220,7 @@ class Signer(StripeObject): """ Person that is signing the document. """ - type: Literal["files"] + type: Union[Literal["files"], str] """ The format of the document. Currently supports `files` only. """ @@ -11780,7 +11780,7 @@ class CompanyAuthorization(StripeObject): """ One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. """ - type: Literal["files"] + type: Union[Literal["files"], str] """ The format of the document. Currently supports `files` only. """ @@ -11790,7 +11790,7 @@ class Passport(StripeObject): """ One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. """ - type: Literal["files"] + type: Union[Literal["files"], str] """ The format of the document. Currently supports `files` only. """ @@ -11810,7 +11810,7 @@ class FrontBack(StripeObject): """ The [file upload](https://docs.stripe.com/api/persons/update#create_file) tokens for the front and back of the verification document. """ - type: Literal["front_back"] + type: Union[Literal["front_back"], str] """ The format of the verification document. Currently supports `front_back` only. """ @@ -11831,7 +11831,7 @@ class FrontBack(StripeObject): """ The [file upload](https://docs.stripe.com/api/persons/update#create_file) tokens for the front and back of the verification document. """ - type: Literal["front_back"] + type: Union[Literal["front_back"], str] """ The format of the verification document. Currently supports `front_back` only. """ @@ -11842,7 +11842,7 @@ class Visa(StripeObject): """ One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. """ - type: Literal["files"] + type: Union[Literal["files"], str] """ The format of the document. Currently supports `files` only. """ diff --git a/stripe/v2/core/_account_link.py b/stripe/v2/core/_account_link.py index 0e92b7ab1..e11a043bd 100644 --- a/stripe/v2/core/_account_link.py +++ b/stripe/v2/core/_account_link.py @@ -122,7 +122,7 @@ class CollectionOptions(StripeObject): """ Specifies the requirements that Stripe collects from v2/core/accounts in the Onboarding flow. """ - configurations: List[Literal["recipient"]] + configurations: List[Union[Literal["recipient"], str]] """ Open Enum. A v2/core/account can be configured to enable certain functionality. The configuration param targets the v2/core/account_link to collect information for the specified v2/core/account configuration/s. """ @@ -155,7 +155,7 @@ class CollectionOptions(StripeObject): """ Specifies the requirements that Stripe collects from v2/core/accounts in the Update flow. """ - configurations: List[Literal["recipient"]] + configurations: List[Union[Literal["recipient"], str]] """ Open Enum. A v2/account can be configured to enable certain functionality. The configuration param targets the v2/account_link to collect information for the specified v2/account configuration/s. """ diff --git a/stripe/v2/core/_account_person.py b/stripe/v2/core/_account_person.py index fc5826ae6..03d139225 100644 --- a/stripe/v2/core/_account_person.py +++ b/stripe/v2/core/_account_person.py @@ -138,7 +138,7 @@ class CompanyAuthorization(StripeObject): """ One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. """ - type: Literal["files"] + type: Union[Literal["files"], str] """ The format of the document. Currently supports `files` only. """ @@ -148,7 +148,7 @@ class Passport(StripeObject): """ One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. """ - type: Literal["files"] + type: Union[Literal["files"], str] """ The format of the document. Currently supports `files` only. """ @@ -168,7 +168,7 @@ class FrontBack(StripeObject): """ The [file upload](https://docs.stripe.com/api/persons/update#create_file) tokens for the front and back of the verification document. """ - type: Literal["front_back"] + type: Union[Literal["front_back"], str] """ The format of the verification document. Currently supports `front_back` only. """ @@ -189,7 +189,7 @@ class FrontBack(StripeObject): """ The [file upload](https://docs.stripe.com/api/persons/update#create_file) tokens for the front and back of the verification document. """ - type: Literal["front_back"] + type: Union[Literal["front_back"], str] """ The format of the verification document. Currently supports `front_back` only. """ @@ -200,7 +200,7 @@ class Visa(StripeObject): """ One or more document IDs returned by a [file upload](https://docs.stripe.com/api/persons/update#create_file) with a purpose value of `account_requirement`. """ - type: Literal["files"] + type: Union[Literal["files"], str] """ The format of the document. Currently supports `files` only. """ diff --git a/stripe/v2/core/_event.py b/stripe/v2/core/_event.py index e53f33f80..0c39a1990 100644 --- a/stripe/v2/core/_event.py +++ b/stripe/v2/core/_event.py @@ -10,7 +10,7 @@ from typing_extensions import Literal, TYPE_CHECKING from stripe._stripe_object import StripeObject, UntypedStripeObject -from stripe._util import get_api_mode +from stripe._util import get_api_mode, sanitize_id from stripe._stripe_context import StripeContext from stripe._webhook import WebhookPayload @@ -95,7 +95,7 @@ class StripeAction(StripeObject): """ Information on the API request that instigated the event. """ - type: Literal["request"] + type: Union[Literal["request"], str] """ Event reason type. """ @@ -278,7 +278,7 @@ def __repr__(self) -> str: def fetch_event(self) -> Event: response = self._client.raw_request( "get", - f"/v2/core/events/{self.id}", + f"/v2/core/events/{sanitize_id(self.id)}", stripe_context=self.context, headers={"Stripe-Request-Trigger": f"event={self.id}"}, usage=["pushed_event_pull"], @@ -288,7 +288,7 @@ def fetch_event(self) -> Event: async def fetch_event_async(self) -> Event: response = await self._client.raw_request_async( "get", - f"/v2/core/events/{self.id}", + f"/v2/core/events/{sanitize_id(self.id)}", stripe_context=self.context, headers={"Stripe-Request-Trigger": f"event={self.id}"}, usage=["pushed_event_pull", "pushed_event_pull_async"], diff --git a/stripe/v2/core/health/_alert.py b/stripe/v2/core/health/_alert.py index 89a4f2d11..eeb086ef8 100644 --- a/stripe/v2/core/health/_alert.py +++ b/stripe/v2/core/health/_alert.py @@ -344,7 +344,7 @@ class IssuingAuthorizationRequestTimeout(StripeObject): """ class MeterEventSummariesDelayed(StripeObject): - ingestion_method: Optional[Literal["import_sets"]] + ingestion_method: Optional[Union[Literal["import_sets"], str]] """ The ingestion method. """ diff --git a/stripe/v2/core/health/_alert_history_entry.py b/stripe/v2/core/health/_alert_history_entry.py index e16b5b703..33ff102bc 100644 --- a/stripe/v2/core/health/_alert_history_entry.py +++ b/stripe/v2/core/health/_alert_history_entry.py @@ -334,7 +334,7 @@ class IssuingAuthorizationRequestTimeout(StripeObject): """ class MeterEventSummariesDelayed(StripeObject): - ingestion_method: Optional[Literal["import_sets"]] + ingestion_method: Optional[Union[Literal["import_sets"], str]] """ The ingestion method. """ diff --git a/stripe/v2/data/reporting/_query_run.py b/stripe/v2/data/reporting/_query_run.py index ed8e1fecd..a6fa66f3e 100644 --- a/stripe/v2/data/reporting/_query_run.py +++ b/stripe/v2/data/reporting/_query_run.py @@ -66,7 +66,7 @@ class Schema(StripeObject): Contains metadata about the file produced by the `ReportRun` or `QueryRun`, including its content type, size, and a URL to download its contents. """ - type: Literal["file"] + type: Union[Literal["file"], str] """ The type of the `ReportRun` or `QueryRun` result. """ diff --git a/stripe/v2/iam/_activity_log.py b/stripe/v2/iam/_activity_log.py index 23866eb63..f021e7ea9 100644 --- a/stripe/v2/iam/_activity_log.py +++ b/stripe/v2/iam/_activity_log.py @@ -54,7 +54,7 @@ class Application(StripeObject): """ An application. """ - type: Literal["application"] + type: Union[Literal["application"], str] """ The type of entity. """ @@ -206,7 +206,7 @@ class NovelDevice(StripeObject): """ The user access action used a novel device. """ - type: Literal["novel_device"] + type: Union[Literal["novel_device"], str] """ Type of risk signal. """ diff --git a/stripe/v2/iam/_api_key.py b/stripe/v2/iam/_api_key.py index dc0eba1e6..7db246b83 100644 --- a/stripe/v2/iam/_api_key.py +++ b/stripe/v2/iam/_api_key.py @@ -23,7 +23,7 @@ class Application(StripeObject): """ An application. """ - type: Literal["application"] + type: Union[Literal["application"], str] """ The type of entity. """ diff --git a/stripe/v2/money_management/_debit_dispute.py b/stripe/v2/money_management/_debit_dispute.py index 3e3707cff..84303ff28 100644 --- a/stripe/v2/money_management/_debit_dispute.py +++ b/stripe/v2/money_management/_debit_dispute.py @@ -45,7 +45,7 @@ class BankTransfer(StripeObject): class StatusDetails(StripeObject): class Failed(StripeObject): - reason: Literal["unknown"] + reason: Union[Literal["unknown"], str] """ The reason for the failure of the DebitDispute. """ @@ -114,7 +114,7 @@ class StatusTransitions(StripeObject): """ The time at which the DebitDispute transitioned to a particular status. """ - type: Literal["bank_transfer"] + type: Union[Literal["bank_transfer"], str] """ The type of the DebitDispute. """ diff --git a/stripe/v2/money_management/_outbound_payment.py b/stripe/v2/money_management/_outbound_payment.py index a66b7800e..335083e95 100644 --- a/stripe/v2/money_management/_outbound_payment.py +++ b/stripe/v2/money_management/_outbound_payment.py @@ -93,7 +93,7 @@ class Failed(StripeObject): """ class Processing(StripeObject): - reason: Literal["under_review"] + reason: Union[Literal["under_review"], str] """ Open Enum. The `processing` status reason. """ @@ -170,7 +170,9 @@ class Ach(StripeObject): """ Open Enum. ACH submission timing. """ - transaction_purpose: Optional[Literal["payroll"]] + transaction_purpose: Optional[ + Union[Literal["payroll"], str] + ] """ The transaction purpose for this ACH payment. """ @@ -366,7 +368,7 @@ class MailingAddress(StripeObject): """ The PayoutIntent ID that triggered this OutboundPayment. """ - purpose: Optional[Literal["payroll"]] + purpose: Optional[Union[Literal["payroll"], str]] """ The purpose of the OutboundPayment. """ diff --git a/stripe/v2/money_management/_outbound_payment_quote.py b/stripe/v2/money_management/_outbound_payment_quote.py index 8cb473efc..0bdb7165a 100644 --- a/stripe/v2/money_management/_outbound_payment_quote.py +++ b/stripe/v2/money_management/_outbound_payment_quote.py @@ -116,7 +116,9 @@ class Ach(StripeObject): """ Open Enum. ACH submission timing. """ - transaction_purpose: Optional[Literal["payroll"]] + transaction_purpose: Optional[ + Union[Literal["payroll"], str] + ] """ The transaction purpose for this ACH payment. """ diff --git a/stripe/v2/money_management/_outbound_transfer.py b/stripe/v2/money_management/_outbound_transfer.py index a985a394d..7bd46c442 100644 --- a/stripe/v2/money_management/_outbound_transfer.py +++ b/stripe/v2/money_management/_outbound_transfer.py @@ -54,7 +54,7 @@ class Failed(StripeObject): """ class Processing(StripeObject): - reason: Literal["under_review"] + reason: Union[Literal["under_review"], str] """ Open Enum. The `processing` status reason. """ diff --git a/stripe/v2/money_management/_payout_intent.py b/stripe/v2/money_management/_payout_intent.py index 6ce85e87d..7391f4258 100644 --- a/stripe/v2/money_management/_payout_intent.py +++ b/stripe/v2/money_management/_payout_intent.py @@ -219,7 +219,9 @@ class Ach(StripeObject): """ Open Enum. ACH submission timing. """ - transaction_purpose: Optional[Literal["payroll"]] + transaction_purpose: Optional[ + Union[Literal["payroll"], str] + ] """ The transaction purpose for this ACH payment. """ diff --git a/stripe/v2/money_management/_received_credit.py b/stripe/v2/money_management/_received_credit.py index 4348d7007..f246d80eb 100644 --- a/stripe/v2/money_management/_received_credit.py +++ b/stripe/v2/money_management/_received_credit.py @@ -65,7 +65,7 @@ class CaBankAccount(StripeObject): The last 4 digits of the account number that originated the transfer. Depending on the bank, this may instead be the last 4 digits of the return account number. """ - network: Literal["acss"] + network: Union[Literal["acss"], str] """ Open Enum. The money transmission network used to send funds for this ReceivedCredit. """ @@ -87,7 +87,7 @@ class EuBankAccount(StripeObject): """ The last 4 digits of the account number that originated the transfer. """ - network: Literal["sepa"] + network: Union[Literal["sepa"], str] """ Open Enum. The money transmission network used to send funds for this ReceivedCredit. """ @@ -127,7 +127,7 @@ class MxBankAccount(StripeObject): """ The last 4 digits of the account number that originated the transfer. """ - network: Literal["spei"] + network: Union[Literal["spei"], str] """ Open Enum. The money transmission network used to send funds for this ReceivedCredit. """ @@ -153,7 +153,7 @@ class SepaBankAccount(StripeObject): """ The IBAN that originated the transfer. """ - network: Literal["sepa_credit_transfer"] + network: Union[Literal["sepa_credit_transfer"], str] """ The money transmission network used to send funds for this ReceivedCredit. """ @@ -336,7 +336,7 @@ class Failed(StripeObject): """ class Returned(StripeObject): - reason: Literal["originator_initiated_reversal"] + reason: Union[Literal["originator_initiated_reversal"], str] """ Open Enum. The `returned` status reason. """ @@ -384,7 +384,7 @@ class From(StripeObject): """ The network ID of the sender. """ - type: Literal["network_business_profile"] + type: Union[Literal["network_business_profile"], str] """ Open Enum. The type of the sender. """ diff --git a/stripe/v2/money_management/_received_debit.py b/stripe/v2/money_management/_received_debit.py index c6d77aa64..bd06c89b4 100644 --- a/stripe/v2/money_management/_received_debit.py +++ b/stripe/v2/money_management/_received_debit.py @@ -20,7 +20,7 @@ class BalanceTransfer(StripeObject): """ The ID of the topup object that originated the ReceivedDebit. """ - type: Literal["topup"] + type: Union[Literal["topup"], str] """ Open Enum. The type of balance transfer that originated the ReceivedDebit. """ @@ -39,7 +39,7 @@ class GbBankAccount(StripeObject): """ Last 4 digits of the bank account number. """ - network: Literal["bacs"] + network: Union[Literal["bacs"], str] """ Open Enum. The bank network the debit was originated on. """ @@ -57,7 +57,7 @@ class UsBankAccount(StripeObject): """ The name of the bank the debit originated from. """ - network: Literal["ach"] + network: Union[Literal["ach"], str] """ Open Enum. The bank network the debit was originated on. """ @@ -164,7 +164,7 @@ class Failed(StripeObject): """ class Returned(StripeObject): - reason: Literal["originator_initiated"] + reason: Union[Literal["originator_initiated"], str] """ Open Enum. The reason the ReceivedDebit was returned. """ diff --git a/stripe/v2/money_management/_received_debit_mandate.py b/stripe/v2/money_management/_received_debit_mandate.py index cd7d88750..0353aad5c 100644 --- a/stripe/v2/money_management/_received_debit_mandate.py +++ b/stripe/v2/money_management/_received_debit_mandate.py @@ -23,7 +23,7 @@ class BankTransfer(StripeObject): """ The financial address associated with this mandate. """ - network: Literal["bacs"] + network: Union[Literal["bacs"], str] """ The bank transfer network for this mandate. """ @@ -122,7 +122,7 @@ class StatusTransitions(StripeObject): """ Timestamps describing when the mandate changed status. """ - type: Literal["bank_transfer"] + type: Union[Literal["bank_transfer"], str] """ The type of the ReceivedDebitMandate. """ diff --git a/stripe/v2/payments/_settlement_allocation_intent.py b/stripe/v2/payments/_settlement_allocation_intent.py index c3d6e469e..2b7d5bbf8 100644 --- a/stripe/v2/payments/_settlement_allocation_intent.py +++ b/stripe/v2/payments/_settlement_allocation_intent.py @@ -25,7 +25,7 @@ class Errored(StripeObject): """ User Message detailing the reason code and possible resolution . """ - reason_code: Literal["amount_mismatch"] + reason_code: Union[Literal["amount_mismatch"], str] """ Open Enum. The `errored` status reason. """ diff --git a/stripe/v2/reporting/_report_run.py b/stripe/v2/reporting/_report_run.py index 3a664d6e9..37047db16 100644 --- a/stripe/v2/reporting/_report_run.py +++ b/stripe/v2/reporting/_report_run.py @@ -67,7 +67,7 @@ class Schema(StripeObject): Contains metadata about the file produced by the `ReportRun` or `QueryRun`, including its content type, size, and a URL to download its contents. """ - type: Literal["file"] + type: Union[Literal["file"], str] """ The type of the `ReportRun` or `QueryRun` result. """ diff --git a/stripe/v2/tax/_operations_resolve_address_result.py b/stripe/v2/tax/_operations_resolve_address_result.py index b5ca9745b..0dbca5a4f 100644 --- a/stripe/v2/tax/_operations_resolve_address_result.py +++ b/stripe/v2/tax/_operations_resolve_address_result.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._stripe_object import StripeObject -from typing import ClassVar, List, Optional +from typing import ClassVar, List, Optional, Union from typing_extensions import Literal @@ -38,7 +38,7 @@ class Address(StripeObject): class PrecisionDetails(StripeObject): class Issue(StripeObject): - code: Literal["required_for_improved_precision"] + code: Union[Literal["required_for_improved_precision"], str] """ A code describing the issue. """ diff --git a/tests/api_resources/test_file.py b/tests/api_resources/test_file.py index 4494f543e..fe7037961 100644 --- a/tests/api_resources/test_file.py +++ b/tests/api_resources/test_file.py @@ -32,8 +32,14 @@ def test_is_retrievable(self, http_client_mock): ) assert isinstance(resource, stripe.File) - def test_is_creatable(self, setup_upload_api_base, http_client_mock): - MultipartDataGenerator._initialize_boundary = lambda self: 1234567890 + def test_is_creatable( + self, setup_upload_api_base, http_client_mock, monkeypatch + ): + monkeypatch.setattr( + MultipartDataGenerator, + "_initialize_boundary", + lambda self: "abc123", + ) test_file = tempfile.TemporaryFile() resource = stripe.File.create( purpose="dispute_evidence", @@ -44,7 +50,7 @@ def test_is_creatable(self, setup_upload_api_base, http_client_mock): "post", path="/v1/files", api_base=stripe.upload_api_base, - content_type="multipart/form-data; boundary=1234567890", + content_type="multipart/form-data; boundary=abc123", ) assert isinstance(resource, stripe.File) diff --git a/tests/api_resources/test_file_upload.py b/tests/api_resources/test_file_upload.py index 8e52cf103..a2896a378 100644 --- a/tests/api_resources/test_file_upload.py +++ b/tests/api_resources/test_file_upload.py @@ -33,8 +33,14 @@ def test_is_retrievable(self, http_client_mock): ) assert isinstance(resource, File) - def test_is_creatable(self, setup_upload_api_base, http_client_mock): - MultipartDataGenerator._initialize_boundary = lambda self: 1234567890 + def test_is_creatable( + self, setup_upload_api_base, http_client_mock, monkeypatch + ): + monkeypatch.setattr( + MultipartDataGenerator, + "_initialize_boundary", + lambda self: "abc123", + ) test_file = tempfile.TemporaryFile() resource = File.create( purpose="dispute_evidence", @@ -45,7 +51,7 @@ def test_is_creatable(self, setup_upload_api_base, http_client_mock): "post", api_base=stripe.upload_api_base, path="/v1/files", - content_type="multipart/form-data; boundary=1234567890", + content_type="multipart/form-data; boundary=abc123", ) assert isinstance(resource, File) diff --git a/tests/services/test_file_upload.py b/tests/services/test_file_upload.py index cae1c79b7..fa671c1ff 100644 --- a/tests/services/test_file_upload.py +++ b/tests/services/test_file_upload.py @@ -28,8 +28,13 @@ def test_is_creatable( self, file_stripe_mock_stripe_client, http_client_mock, + monkeypatch, ): - MultipartDataGenerator._initialize_boundary = lambda self: 1234567890 + monkeypatch.setattr( + MultipartDataGenerator, + "_initialize_boundary", + lambda self: "abc123", + ) test_file = tempfile.TemporaryFile() # We create a new client here instead of re-using the stripe_mock_stripe_client fixture @@ -46,6 +51,6 @@ def test_is_creatable( "post", api_base=stripe.upload_api_base, path="/v1/files", - content_type="multipart/form-data; boundary=1234567890", + content_type="multipart/form-data; boundary=abc123", ) assert isinstance(resource, File) diff --git a/tests/test_api_requestor.py b/tests/test_api_requestor.py index 0d6dc695f..e077b2057 100644 --- a/tests/test_api_requestor.py +++ b/tests/test_api_requestor.py @@ -23,8 +23,13 @@ StripeStreamResponse, StripeStreamResponseAsync, ) +from stripe._util import ( + validate_path, + _convert_to_stripe_object, +) from stripe.v2._deleted_object import DeletedObject from tests.http_client_mock import HTTPClientMock +from tests.test_webhook import generate_header VALID_API_METHODS = ("get", "post", "delete") @@ -175,10 +180,16 @@ def test_param_encoding(self, requestor, http_client_mock): urlencode(expectation).replace("%5B", "[").replace("%5D", "]") ) http_client_mock.stub_request( - "get", query_string=query_string, rbody="{}", rcode=200 + "get", + path=self.v1_path, + query_string=query_string, + rbody="{}", + rcode=200, ) - requestor.request("get", "", self.ENCODE_INPUTS, base_address="api") + requestor.request( + "get", self.v1_path, self.ENCODE_INPUTS, base_address="api" + ) http_client_mock.assert_requested("get", query_string=query_string) @@ -247,10 +258,11 @@ def test_ordereddict_encoding(self): assert encoded[4][0] == "ordered[nested][b]" def test_url_construction(self, requestor, http_client_mock): + # Paths must be origin-relative -- see validate_path. CASES = ( - (f"{stripe.api_base}?foo=bar", "", {"foo": "bar"}), - (f"{stripe.api_base}?foo=bar", "?", {"foo": "bar"}), - (stripe.api_base, "", {}), + (f"{stripe.api_base}/v1/foo?foo=bar", "/v1/foo", {"foo": "bar"}), + (f"{stripe.api_base}/v1/foo?foo=bar", "/v1/foo?", {"foo": "bar"}), + (f"{stripe.api_base}/v1/foo", "/v1/foo", {}), ( f"{stripe.api_base}/%20spaced?baz=5&foo=bar%24", "/%20spaced?foo=bar%24", @@ -258,8 +270,8 @@ def test_url_construction(self, requestor, http_client_mock): ), # duplicate query params keys should be deduped ( - f"{stripe.api_base}?foo=bar", - "?foo=bar", + f"{stripe.api_base}/v1/foo?foo=bar", + "/v1/foo?foo=bar", {"foo": "bar"}, ), ) @@ -1006,7 +1018,7 @@ def test_invalid_json(self, requestor, http_client_mock): def test_invalid_method(self, requestor): with pytest.raises(stripe.APIConnectionError): - requestor.request("foo", "bar", base_address="api") + requestor.request("foo", self.v1_path, base_address="api") def test_oauth_invalid_requestor_error(self, requestor, http_client_mock): http_client_mock.stub_request( @@ -1158,6 +1170,124 @@ def test_raw_request_with_file_param(self, requestor, http_client_mock): ) assert supplied_headers["Content-Type"] == "multipart/form-data" + ORIGIN_RELATIVE_PATHS = [ + "/v1/customers/cus_123", + "/v1/customers", + "/v2/core/accounts?page=page_123&limit=2", + # "@" is legal inside a path or query string -- it only opens an + # authority when it precedes the first "/". + "/v1/customers?email=user%40example.com", + "/v1/invoices/in_123@456", + # A backslash does not open an authority: the "/" already closed it. + "/v1/\\evil.example", + ] + + HOSTILE_PATHS = [ + # Concatenated onto a base address with no trailing slash, each of these + # moves the request's authority off api.stripe.com. + "@evil.example/v1/leak", + ":pw@evil.example/v1/leak", + ":80@evil.example/v1/leak", + # Extends the host into an attacker-owned subdomain + # (api.stripe.com.evil.example), which has a valid certificate. + ".evil.example/v1/leak", + "-evil.example/v1/leak", + "https://evil.example/v1/leak", + "//evil.example/v1/leak", + "", + "v1/customers", + ] + + @pytest.mark.parametrize("path", ORIGIN_RELATIVE_PATHS) + def test_accepts_origin_relative_path(self, path): + validate_path(path) + + @pytest.mark.parametrize("path", HOSTILE_PATHS) + def test_rejects_hostile_path(self, path): + with pytest.raises(ValueError): + validate_path(path) + + @pytest.mark.parametrize("path", HOSTILE_PATHS) + def test_request_rejects_hostile_path_without_issuing_request( + self, path, requestor, http_client_mock + ): + with pytest.raises(ValueError): + requestor.request("get", path, base_address="api") + + http_client_mock.assert_no_request() + + def test_raw_request_rejects_hostile_path_without_issuing_request( + self, http_client_mock + ): + client = stripe.StripeClient( + "sk_test_123", http_client=http_client_mock.get_mock_http_client() + ) + + with pytest.raises(ValueError): + client.raw_request("get", "@evil.example/v1/leak") + + http_client_mock.assert_no_request() + + def test_fetch_related_object_rejects_hostile_url_without_issuing_request( + self, http_client_mock + ): + client = stripe.StripeClient( + "sk_test_123", http_client=http_client_mock.get_mock_http_client() + ) + payload = json.dumps( + { + "id": "evt_123", + "object": "v2.core.event", + "type": "v2.core.account.created", + "created": "2026-01-01T00:00:00Z", + "related_object": { + "id": "acct_123", + "type": "account", + "url": "@evil.example/v1/leak", + }, + } + ) + secret = "whsec_test_secret" + header = generate_header(payload=payload, secret=secret) + + notification = client.parse_event_notification(payload, header, secret) + + with pytest.raises(ValueError): + notification.fetch_related_object() + + http_client_mock.assert_no_request() + + def test_v1_payload_does_not_produce_v2_list_object(self, requestor): + # A signature-verified v1 webhook body is attacker-shaped. Without the + # api_mode gate, `lines` here became an auto-paginating v2 collection + # whose next_page_url chose the host of the next authenticated request. + obj = _convert_to_stripe_object( + resp={ + "id": "in_123", + "object": "invoice", + "lines": { + "data": [{"id": "il_123"}], + "next_page_url": "@evil.example/v1/leak", + }, + }, + requestor=requestor, + api_mode="V1", + ) + + assert not isinstance(obj["lines"], stripe.v2.ListObject) + + def test_v2_response_still_produces_v2_list_object(self, requestor): + obj = _convert_to_stripe_object( + resp={ + "data": [{"id": "acct_123"}], + "next_page_url": "/v2/core/accounts?page=page_123", + }, + requestor=requestor, + api_mode="V2", + ) + + assert isinstance(obj, stripe.v2.ListObject) + class TestDefaultClient(object): @pytest.fixture(autouse=True) diff --git a/tests/test_discriminated_unions.py b/tests/test_discriminated_unions.py new file mode 100644 index 000000000..ff20cc1a6 --- /dev/null +++ b/tests/test_discriminated_unions.py @@ -0,0 +1,309 @@ +""" +Tests for discriminated union runtime behavior. + +A discriminated union field arrives as a plain JSON object, and the SDK has to +pick the variant class out of the discriminator carried inside that object. The +fixtures below mirror what codegen emits for the fake spec's `test.llama` +resource, including the part that makes dispatch *observable*: the two color +variants declare different `_field_encodings`, so identical wire bytes hydrate +differently based only on the discriminator. Without dispatch the value becomes +a bare StripeObject carrying no encodings, and every coercion assertion here +fails. + +Static type narrowing (Literal discriminators, Union resolution) is checked by +pyright, not here. +""" + +from decimal import Decimal +from typing import Any, Dict, Optional, Union + +from typing_extensions import Literal + +from stripe._encode import _coerce_v2_params +from stripe._stripe_object import StripeObject + + +# --------------------------------------------------------------------------- +# Fixtures — shaped the way codegen emits them +# --------------------------------------------------------------------------- + + +class RgbColor(StripeObject): + luminance: Optional[int] + model: Literal["rgb"] + _field_encodings = {"luminance": "int64_string"} + + +class HsvColor(StripeObject): + model: Literal["hsv"] + saturation_precision: Optional[Decimal] + _field_encodings = {"saturation_precision": "decimal_string"} + + +class HslColor(StripeObject): + model: Literal["hsl"] + + +class MagicLlama(StripeObject): + mana_cost: Optional[int] + _field_encodings = {"mana_cost": "int64_string"} + + +class Llama(StripeObject): + """ + Carries both union shapes the generator produces: a standalone `color` + union whose variants are separate classes, and an inline `magic_llama` + union whose discriminator lives on the parent and whose payload is a + plain inner class. + """ + + color: Union[RgbColor, HsvColor, HslColor] + magic_llama: Optional[MagicLlama] + name: str + type: Literal["earth_llama", "magic_llama"] + _inner_class_types = {"magic_llama": MagicLlama} + _inner_class_union_variant_types = { + "color": ( + "model", + {"rgb": RgbColor, "hsv": HsvColor, "hsl": HslColor}, + ), + } + + +def _llama(**values: Any) -> Llama: + return Llama.construct_from( + {"name": "kuzco", **values}, key="sk_test", api_mode="V2" + ) + + +# Copied from the generated `LlamaService.create` call site. The generator +# flattens every variant's fields into one map keyed by field name, so this +# single schema covers both `luminance` (rgb) and `saturation_precision` (hsv). +_COLOR_REQUEST_SCHEMA: Dict[str, Any] = { + "color": { + "luminance": "int64_string", + "saturation_precision": "decimal_string", + }, +} + + +# --------------------------------------------------------------------------- +# Response side — variant dispatch +# --------------------------------------------------------------------------- + + +class TestVariantDispatch: + """The discriminator selects the variant class, not the base.""" + + def test_dispatches_to_the_rgb_variant(self): + llama = _llama(color={"model": "rgb", "luminance": "1500"}) + assert isinstance(llama.color, RgbColor) + + def test_dispatches_to_the_hsv_variant(self): + llama = _llama(color={"model": "hsv", "saturation_precision": "0.125"}) + assert isinstance(llama.color, HsvColor) + + def test_dispatches_to_a_variant_with_no_payload_fields(self): + llama = _llama(color={"model": "hsl"}) + assert isinstance(llama.color, HslColor) + assert llama.color.model == "hsl" + + def test_the_variants_int64_encoding_applies(self): + llama = _llama(color={"model": "rgb", "luminance": "1500"}) + assert llama.color.luminance == 1500 + assert isinstance(llama.color.luminance, int) + + def test_the_variants_decimal_encoding_applies(self): + llama = _llama(color={"model": "hsv", "saturation_precision": "0.125"}) + assert llama.color.saturation_precision == Decimal("0.125") + assert isinstance(llama.color.saturation_precision, Decimal) + + def test_only_the_discriminator_decides_which_field_coerces(self): + """ + The sharpest statement of what dispatch buys: two payloads differing + in nothing but the discriminator coerce different fields, because each + variant class knows only its own encodings. + """ + payload = {"luminance": "1500", "saturation_precision": "0.125"} + + as_rgb = _llama(color={"model": "rgb", **payload}).color + assert as_rgb.luminance == 1500 + assert as_rgb.saturation_precision == "0.125" + + as_hsv = _llama(color={"model": "hsv", **payload}).color + assert as_hsv.luminance == "1500" + assert as_hsv.saturation_precision == Decimal("0.125") + + def test_the_discriminator_itself_is_readable_on_the_variant(self): + llama = _llama(color={"model": "rgb", "luminance": "1"}) + assert llama.color.model == "rgb" + assert llama.color["model"] == "rgb" + + +# --------------------------------------------------------------------------- +# Response side — fallback +# --------------------------------------------------------------------------- + + +class TestUnknownVariantFallback: + """ + A variant the API adds after this release must still deserialize. The + fallback is a plain StripeObject: readable, but with no encodings, since + the SDK has no idea what the new variant's fields mean. + """ + + def test_an_unknown_discriminator_falls_back(self): + llama = _llama(color={"model": "cmyk", "cyan": "1"}) + assert type(llama.color) is StripeObject + assert llama.color.model == "cmyk" + assert llama.color.cyan == "1" + + def test_an_absent_discriminator_falls_back(self): + llama = _llama(color={"luminance": "1500"}) + assert type(llama.color) is StripeObject + assert llama.color.luminance == "1500" + + def test_a_non_string_discriminator_falls_back(self): + llama = _llama(color={"model": 7}) + assert type(llama.color) is StripeObject + + def test_a_null_union_value_stays_none(self): + assert _llama(color=None).color is None + + def test_a_non_object_union_value_passes_through(self): + """ + Not a shape the API produces, but the lookup must not raise on it — + the union field is read before anything has validated its type. + """ + assert _llama(color="rgb").color == "rgb" + + +# --------------------------------------------------------------------------- +# Response side — inline unions are unaffected +# --------------------------------------------------------------------------- + + +class TestInlineUnionsUseInnerClassTypes: + """ + Inline union variants are namespaced by field name, so they need no + discriminator lookup and keep going through `_inner_class_types`. These + pin that the union lookup did not displace it. + """ + + def test_the_inline_variant_gets_its_inner_class(self): + llama = _llama(type="magic_llama", magic_llama={"mana_cost": "42"}) + assert isinstance(llama.magic_llama, MagicLlama) + + def test_the_inline_variants_encoding_applies(self): + llama = _llama(type="magic_llama", magic_llama={"mana_cost": "42"}) + assert llama.magic_llama.mana_cost == 42 + assert isinstance(llama.magic_llama.mana_cost, int) + + def test_the_non_selected_variant_is_not_fabricated(self): + llama = _llama(type="earth_llama") + assert llama.type == "earth_llama" + # `__getattr__` raises for a key absent from `_data`, so this is a + # real statement that nothing was materialized for the other variant. + assert not hasattr(llama, "magic_llama") + + +# --------------------------------------------------------------------------- +# Response side — serialization back out +# --------------------------------------------------------------------------- + + +class TestUnionValueSerialization: + def test_to_dict_recurses_into_the_variant(self): + llama = _llama(color={"model": "rgb", "luminance": "1500"}) + assert llama.to_dict()["color"] == { + "model": "rgb", + "luminance": 1500, + } + + def test_to_dict_for_json_restringifies_the_decimal(self): + """ + The variant hydrates `saturation_precision` to a Decimal, which is not + JSON-serializable, so `for_json` has to put the string back. + """ + llama = _llama(color={"model": "hsv", "saturation_precision": "0.125"}) + + plain = llama.to_dict()["color"]["saturation_precision"] + assert isinstance(plain, Decimal) + + for_json = llama.to_dict(for_json=True)["color"] + assert for_json["saturation_precision"] == "0.125" + assert isinstance(for_json["saturation_precision"], str) + + def test_to_dict_preserves_an_unknown_variant_verbatim(self): + llama = _llama(color={"model": "cmyk", "cyan": "1"}) + assert llama.to_dict()["color"] == {"model": "cmyk", "cyan": "1"} + + +# --------------------------------------------------------------------------- +# Request side +# --------------------------------------------------------------------------- + + +class TestUnionRequestCoercion: + """ + Outbound coercion runs off the method-level schema, which is keyed by + field name only — there is no discriminator in it. + """ + + def test_the_rgb_variants_int64_field_is_stringified(self): + result = _coerce_v2_params( + {"color": {"model": "rgb", "luminance": 1500}}, + _COLOR_REQUEST_SCHEMA, + ) + assert result == {"color": {"model": "rgb", "luminance": "1500"}} + + def test_the_hsv_variants_decimal_field_is_stringified(self): + result = _coerce_v2_params( + { + "color": { + "model": "hsv", + "saturation_precision": Decimal("0.125"), + } + }, + _COLOR_REQUEST_SCHEMA, + ) + assert result == { + "color": {"model": "hsv", "saturation_precision": "0.125"} + } + + def test_a_payload_free_variant_passes_through_untouched(self): + result = _coerce_v2_params( + {"color": {"model": "hsl"}}, _COLOR_REQUEST_SCHEMA + ) + assert result == {"color": {"model": "hsl"}} + + def test_coercion_is_by_field_name_not_by_variant(self): + """ + Pins the generator's flattening decision: every variant's fields land + in one map, so a field is coerced whenever it appears, whatever the + discriminator says. Safe while variants do not share a field name with + conflicting encodings. + """ + result = _coerce_v2_params( + { + "color": { + "model": "rgb", + "saturation_precision": Decimal("0.5"), + } + }, + _COLOR_REQUEST_SCHEMA, + ) + assert result == { + "color": {"model": "rgb", "saturation_precision": "0.5"} + } + + def test_unknown_variant_fields_pass_through(self): + result = _coerce_v2_params( + {"color": {"model": "cmyk", "cyan": 1}}, + _COLOR_REQUEST_SCHEMA, + ) + assert result == {"color": {"model": "cmyk", "cyan": 1}} + + def test_a_null_union_is_not_coerced(self): + result = _coerce_v2_params({"color": None}, _COLOR_REQUEST_SCHEMA) + assert result == {"color": None} diff --git a/tests/test_multipart_data_generator.py b/tests/test_multipart_data_generator.py index b8f4fa738..0b9d5f93e 100644 --- a/tests/test_multipart_data_generator.py +++ b/tests/test_multipart_data_generator.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- +import random import re import io @@ -87,3 +88,51 @@ def test_multipart_data_unicode_file_name(self): string = io.StringIO("foo") string.name = "паспорт.png" self.run_test_multipart_data_with_file(string) + + def test_boundary_is_not_derived_from_the_random_module(self): + # Seeding the `random` module must not determine the boundary. A + # boundary an attacker can predict lets a caller-influenced value + # (including file bytes) inject additional parts. + random.seed(0) + first = MultipartDataGenerator().boundary + random.seed(0) + second = MultipartDataGenerator().boundary + + assert first != second + assert re.fullmatch(r"[0-9a-f]{60}", first) + assert re.fullmatch(r"[0-9a-f]{60}", second) + + @staticmethod + def lines_starting_with(http_body, prefix): + return [ + line for line in http_body.split("\r\n") if line.startswith(prefix) + ] + + def test_escapes_quotes_and_crlf_in_param_names(self): + injected = 'a\r\nContent-Disposition: form-data; name="purpose' + generator = MultipartDataGenerator() + generator.add_params({injected: "value"}) + http_body = generator.get_post_data().decode("utf-8") + + # The injected CRLF must not begin a second header line, and the + # injected quote must not end the quoted-string early. + assert self.lines_starting_with(http_body, "Content-Disposition:") == [ + 'Content-Disposition: form-data; name="a Content-Disposition: ' + 'form-data; name=%22purpose"' + ] + # One opening delimiter and one closing delimiter: a single part. + assert http_body.count("--%s" % generator.boundary) == 2 + + def test_escapes_quotes_and_crlf_in_file_names(self): + test_file = io.StringIO("foo") + test_file.name = 'a\r\nX-Injected: yes"b.png' + generator = MultipartDataGenerator() + generator.add_params({"file": test_file}) + http_body = generator.get_post_data().decode("utf-8") + + assert self.lines_starting_with(http_body, "Content-Disposition:") == [ + 'Content-Disposition: form-data; name="file"; ' + 'filename="a X-Injected: yes%22b.png"' + ] + assert self.lines_starting_with(http_body, "X-Injected:") == [] + assert http_body.count("--%s" % generator.boundary) == 2