diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2beec026b..4f99a88e5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -87,16 +87,12 @@ jobs: python_version: # The last ~5 versions, once we're on schedule # https://docs.stripe.com/sdks/versioning?lang=python#stripe-sdk-language-version-support-policy - - "3.7" - - "3.8" - "3.9" - "3.10" - "3.11" - "3.12" - "3.13" - "3.14" - - "pypy-3.7" - - "pypy-3.8" - "pypy-3.9" - "pypy-3.10" - "pypy-3.11" @@ -117,8 +113,7 @@ jobs: name: Publish if: >- ((github.event_name == 'workflow_dispatch') || (github.event_name == 'push')) && - startsWith(github.ref, 'refs/tags/v') && - endsWith(github.actor, '-stripe') + startsWith(github.ref, 'refs/tags/v') needs: [build, test, lint] runs-on: "ubuntu-24.04" permissions: diff --git a/CODEGEN_VERSION b/CODEGEN_VERSION index c99d4272f..7ef144d2a 100644 --- a/CODEGEN_VERSION +++ b/CODEGEN_VERSION @@ -1 +1 @@ -e10daa4ed23a4fe87d6ea60836226446e042fdd3 \ No newline at end of file +5a12435b3b09ae0579265713bb543b4bd962f424 \ No newline at end of file diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 58dae7935..ad0b5d451 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v2186 \ No newline at end of file +v2204 \ No newline at end of file diff --git a/README.md b/README.md index 75b2f0fd9..ea26bd8d3 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,9 @@ [![pypi](https://img.shields.io/pypi/v/stripe.svg)](https://pypi.python.org/pypi/stripe) [![Build Status](https://github.com/stripe/stripe-python/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/stripe/stripe-python/actions?query=branch%3Amaster) +> [!TIP] +> Want to chat live with Stripe engineers? Join us on our [Discord server](https://stripe.com/go/discord/python). + The Stripe Python library provides convenient access to the Stripe API from applications written in the Python language. It includes a pre-defined set of classes for API resources that initialize themselves dynamically from API @@ -29,9 +32,9 @@ python -m pip install . ### Requirements -Per our [Language Version Support Policy](https://docs.stripe.com/sdks/versioning?lang=python#stripe-sdk-language-version-support-policy), we currently support **Python 3.7+**. +Per our [Language Version Support Policy](https://docs.stripe.com/sdks/versioning?lang=python#stripe-sdk-language-version-support-policy), we currently support **Python 3.9+**. -Support for Python 3.7 and 3.8 is deprecated and will be removed in an upcoming major version. Read more and see the full schedule in the docs: https://docs.stripe.com/sdks/versioning?lang=python#stripe-sdk-language-version-support-policy +Read more and see the full schedule in the docs: https://docs.stripe.com/sdks/versioning?lang=python#stripe-sdk-language-version-support-policy #### Extended Support @@ -195,7 +198,7 @@ print(customer.last_response.headers) ### How to use undocumented parameters and properties In some cases, you might encounter parameters on an API request or fields on an API response that aren’t available in the SDKs. -This might happen when they’re undocumented or when they’re in preview and you aren’t using a preview SDK. +This might happen when they’re undocumented or when they’re in preview and you aren’t using a preview SDK. See [undocumented params and properties](https://docs.stripe.com/sdks/server-side?lang=python#undocumented-params-and-fields) to send those parameters or access those fields. ### Writing a Plugin diff --git a/flake8_stripe/flake8_stripe.py b/flake8_stripe/flake8_stripe.py index 762efc4f3..3245b37c0 100644 --- a/flake8_stripe/flake8_stripe.py +++ b/flake8_stripe/flake8_stripe.py @@ -10,17 +10,12 @@ class TypingImportsChecker: version = "0.1.0" # Rules: - # * typing_extensions v4.1.1 is the latest that supports Python 3.6 - # so don't depend on anything from a more recent version than that. - # - # If we need something newer, maybe we can provide it for users on - # newer versions with a conditional import, but we'll cross that - # bridge when we come to it. - # If a symbol exists in both `typing` and `typing_extensions`, which # should you use? Prefer `typing_extensions` if the symbol available there. # in 4.1.1. In typing_extensions 4.7.0, `typing_extensions` started re-exporting # EVERYTHING from `typing` but this is not the case in v4.1.1. + + # now that we're into modern typing_extensions versions, we should probably prefer that over built-in typing _unless_ all of our `typing `needs are present in all supported Python versions. In that case, we could drop `typing_extensions`. See: https://go/j/DEVSDK-3046 allowed_typing_extensions_imports = [ "Literal", "NoReturn", @@ -36,6 +31,7 @@ class TypingImportsChecker: "Awaitable", "Never", "override", + "deprecated", ] allowed_typing_imports = [ diff --git a/pyproject.toml b/pyproject.toml index 0686931f8..8edc6bcb9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,7 +6,7 @@ description = "Python bindings for the Stripe API" authors = [{ name = "Stripe", email = "support@stripe.com" }] license-files = ["LICENSE"] keywords = ["stripe", "api", "payments"] -requires-python = ">=3.7" +requires-python = ">=3.9" classifiers = [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", @@ -27,11 +27,9 @@ classifiers = [ ] dependencies = [ - "typing_extensions <= 4.2.0, > 3.7.2; python_version < '3.7'", - # The best typing support comes from 4.5.0+ but we can support down to - # 3.7.2 without throwing exceptions. - "typing_extensions >= 4.5.0; python_version >= '3.7'", - "requests >= 2.20; python_version >= '3.0'", + # this is the version where everything started getting re-exported, so it's a convenient backstop + "typing_extensions >= 4.7.0", + "requests >= 2.20", ] [project.optional-dependencies] diff --git a/stripe/__init__.py b/stripe/__init__.py index 94eff9371..6b3dccdc8 100644 --- a/stripe/__init__.py +++ b/stripe/__init__.py @@ -158,6 +158,7 @@ def add_beta_version( issuing as issuing, params as params, privacy as privacy, + product_catalog as product_catalog, radar as radar, reporting as reporting, reserve as reserve, @@ -476,6 +477,9 @@ def add_beta_version( from stripe._price_service import PriceService as PriceService from stripe._privacy_service import PrivacyService as PrivacyService from stripe._product import Product as Product + from stripe._product_catalog_service import ( + ProductCatalogService as ProductCatalogService, + ) from stripe._product_feature import ProductFeature as ProductFeature from stripe._product_feature_service import ( ProductFeatureService as ProductFeatureService, @@ -638,6 +642,7 @@ def add_beta_version( "issuing": ("stripe.issuing", True), "params": ("stripe.params", True), "privacy": ("stripe.privacy", True), + "product_catalog": ("stripe.product_catalog", True), "radar": ("stripe.radar", True), "reporting": ("stripe.reporting", True), "reserve": ("stripe.reserve", True), @@ -901,6 +906,7 @@ def add_beta_version( "PriceService": ("stripe._price_service", False), "PrivacyService": ("stripe._privacy_service", False), "Product": ("stripe._product", False), + "ProductCatalogService": ("stripe._product_catalog_service", False), "ProductFeature": ("stripe._product_feature", False), "ProductFeatureService": ("stripe._product_feature_service", False), "ProductService": ("stripe._product_service", False), diff --git a/stripe/_account.py b/stripe/_account.py index 61156ed82..14965cd7e 100644 --- a/stripe/_account.py +++ b/stripe/_account.py @@ -81,6 +81,8 @@ class Account( UpdateableAPIResource["Account"], ): """ + For new integrations, we recommend using the [Accounts v2 API](https://docs.stripe.com/api/v2/core/accounts), in place of /v1/accounts and /v1/customers to represent a user. + This is an object representing a Stripe account. You can retrieve it to see properties on the account like its current requirements or if the account is enabled to make live charges or receive payouts. @@ -540,6 +542,10 @@ class Capabilities(StripeObject): """ The status of the TWINT capability of the account, or whether the account can directly process TWINT charges. """ + upi_payments: Optional[Literal["active", "inactive", "pending"]] + """ + The status of the upi payments capability of the account, or whether the account can directly process upi charges. + """ us_bank_account_ach_payments: Optional[ Literal["active", "inactive", "pending"] ] @@ -1527,7 +1533,7 @@ class Restricted(StripeObject): """ goods_type: Optional[Literal["digital_content", "other"]] """ - Whether your business sells digital content or not. + The type of goods your business sells. Use `digital_content` if you sell digital content. Use `other` for all other types of goods or services. """ site: Optional[Site] _inner_class_types = {"site": Site} @@ -1982,7 +1988,7 @@ def persons( # pyright: ignore[reportGeneralTypeIssues] self._request( "get", "/v1/accounts/{account}/persons".format( - account=sanitize_id(self.get("id")) + account=sanitize_id(self._data.get("id")) ), params=params, ), @@ -2037,7 +2043,7 @@ async def persons_async( # pyright: ignore[reportGeneralTypeIssues] await self._request_async( "get", "/v1/accounts/{account}/persons".format( - account=sanitize_id(self.get("id")) + account=sanitize_id(self._data.get("id")) ), params=params, ), @@ -2098,7 +2104,7 @@ def reject( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/accounts/{account}/reject".format( - account=sanitize_id(self.get("id")) + account=sanitize_id(self._data.get("id")) ), params=params, ), @@ -2161,7 +2167,7 @@ async def reject_async( # pyright: ignore[reportGeneralTypeIssues] await self._request_async( "post", "/v1/accounts/{account}/reject".format( - account=sanitize_id(self.get("id")) + account=sanitize_id(self._data.get("id")) ), params=params, ), @@ -2201,7 +2207,7 @@ def _build_instance_url(cls, sid): return "%s/%s" % (base, extn) def instance_url(self): - return self._build_instance_url(self.get("id")) + return self._build_instance_url(self._data.get("id")) def deauthorize(self, **params): params["stripe_user_id"] = self.id @@ -2211,7 +2217,7 @@ def serialize(self, previous): params = super(Account, self).serialize(previous) previous = previous or self._previous or {} - for k, v in iter(self.items()): + for k, v in iter(self._data.items()): if k == "individual" and isinstance(v, Person) and k not in params: params[k] = v.serialize(previous.get(k, None)) diff --git a/stripe/_account_notice.py b/stripe/_account_notice.py index 0338c413f..e3b06f515 100644 --- a/stripe/_account_notice.py +++ b/stripe/_account_notice.py @@ -82,7 +82,7 @@ class LinkedObjects(StripeObject): """ livemode: bool """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ metadata: Optional[Dict[str, str]] """ diff --git a/stripe/_account_session.py b/stripe/_account_session.py index dfeea38b7..bfb986646 100644 --- a/stripe/_account_session.py +++ b/stripe/_account_session.py @@ -511,7 +511,7 @@ class Features(StripeObject): """ livemode: bool """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ object: Literal["account_session"] """ diff --git a/stripe/_api_requestor.py b/stripe/_api_requestor.py index 5c3f1c7e5..60ec6b139 100644 --- a/stripe/_api_requestor.py +++ b/stripe/_api_requestor.py @@ -5,6 +5,7 @@ from typing import ( Any, AsyncIterable, + Callable, Dict, List, Mapping, @@ -545,14 +546,14 @@ def request_headers( ua: Dict[str, Union[str, "AppInfo"]] = { "bindings_version": VERSION, "lang": "python", - "publisher": "stripe", "httplib": self._get_http_client().name, } - for attr, func in [ - ["lang_version", platform.python_version], - ["platform", platform.platform], - ["uname", lambda: " ".join(platform.uname())], - ]: + attr_funcs: List[Tuple[str, Callable[[], str]]] = [ + ("lang_version", platform.python_version), + ] + if stripe.enable_telemetry: + attr_funcs.append(("platform", platform.platform)) + for attr, func in attr_funcs: try: val = func() except Exception: diff --git a/stripe/_api_resource.py b/stripe/_api_resource.py index 2866b42c1..f67eb5f16 100644 --- a/stripe/_api_resource.py +++ b/stripe/_api_resource.py @@ -1,4 +1,4 @@ -from typing_extensions import Literal, Self +from typing_extensions import Literal, Self, deprecated from stripe._error import InvalidRequestError from stripe._stripe_object import StripeObject @@ -6,7 +6,6 @@ from stripe._api_mode import ApiMode from stripe._base_address import BaseAddress from stripe._api_requestor import _APIRequestor -from stripe import _util from urllib.parse import quote_plus from typing import ( Any, @@ -26,7 +25,7 @@ class APIResource(StripeObject, Generic[T]): OBJECT_NAME: ClassVar[str] @classmethod - @_util.deprecated( + @deprecated( "This method is deprecated and will be removed in a future version of stripe-python. Child classes of APIResource should define their own `retrieve` and use APIResource._request directly." ) def retrieve(cls, id, **params) -> T: @@ -55,7 +54,7 @@ def class_url(cls) -> str: return "/v1/%ss" % (base,) def instance_url(self) -> str: - id = self.get("id") + id = self._data.get("id") if not isinstance(id, str): raise InvalidRequestError( diff --git a/stripe/_api_version.py b/stripe/_api_version.py index aa6178396..9aa7b9ee7 100644 --- a/stripe/_api_version.py +++ b/stripe/_api_version.py @@ -1,4 +1,4 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec class _ApiVersion: - CURRENT = "2026-02-25.preview" + CURRENT = "2026-03-25.preview" diff --git a/stripe/_apple_pay_domain.py b/stripe/_apple_pay_domain.py index 3ed5195a9..c1691cf24 100644 --- a/stripe/_apple_pay_domain.py +++ b/stripe/_apple_pay_domain.py @@ -44,7 +44,7 @@ class ApplePayDomain( """ livemode: bool """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ object: Literal["apple_pay_domain"] """ diff --git a/stripe/_application_fee.py b/stripe/_application_fee.py index f83ab1ead..c0abbb400 100644 --- a/stripe/_application_fee.py +++ b/stripe/_application_fee.py @@ -98,7 +98,7 @@ class FeeSource(StripeObject): """ livemode: bool """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ object: Literal["application_fee"] """ @@ -236,7 +236,7 @@ def refund( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/application_fees/{id}/refunds".format( - id=sanitize_id(self.get("id")) + id=sanitize_id(self._data.get("id")) ), params=params, ), @@ -321,7 +321,7 @@ async def refund_async( # pyright: ignore[reportGeneralTypeIssues] await self._request_async( "post", "/v1/application_fees/{id}/refunds".format( - id=sanitize_id(self.get("id")) + id=sanitize_id(self._data.get("id")) ), params=params, ), diff --git a/stripe/_balance.py b/stripe/_balance.py index 4824ba22c..ecfc6549b 100644 --- a/stripe/_balance.py +++ b/stripe/_balance.py @@ -254,6 +254,69 @@ class SourceTypes(StripeObject): """ _inner_class_types = {"available": Available, "pending": Pending} + class RiskReserved(StripeObject): + class Available(StripeObject): + class SourceTypes(StripeObject): + bank_account: Optional[int] + """ + Amount coming from [legacy US ACH payments](https://docs.stripe.com/ach-deprecated). + """ + card: Optional[int] + """ + Amount coming from most payment methods, including cards as well as [non-legacy bank debits](https://docs.stripe.com/payments/bank-debits). + """ + fpx: Optional[int] + """ + Amount coming from [FPX](https://docs.stripe.com/payments/fpx), a Malaysian payment method. + """ + + amount: int + """ + Balance amount. + """ + 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). + """ + source_types: Optional[SourceTypes] + _inner_class_types = {"source_types": SourceTypes} + + class Pending(StripeObject): + class SourceTypes(StripeObject): + bank_account: Optional[int] + """ + Amount coming from [legacy US ACH payments](https://docs.stripe.com/ach-deprecated). + """ + card: Optional[int] + """ + Amount coming from most payment methods, including cards as well as [non-legacy bank debits](https://docs.stripe.com/payments/bank-debits). + """ + fpx: Optional[int] + """ + Amount coming from [FPX](https://docs.stripe.com/payments/fpx), a Malaysian payment method. + """ + + amount: int + """ + Balance amount. + """ + 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). + """ + source_types: Optional[SourceTypes] + _inner_class_types = {"source_types": SourceTypes} + + available: List[Available] + """ + Funds that are available for use. + """ + pending: List[Pending] + """ + Funds that are pending + """ + _inner_class_types = {"available": Available, "pending": Pending} + available: List[Available] """ Available funds that you can transfer or pay out automatically by Stripe or explicitly through the [Transfers API](https://api.stripe.com#transfers) or [Payouts API](https://api.stripe.com#payouts). You can find the available balance for each currency and payment type in the `source_types` property. @@ -269,7 +332,7 @@ class SourceTypes(StripeObject): issuing: Optional[Issuing] livemode: bool """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ object: Literal["balance"] """ @@ -280,6 +343,7 @@ class SourceTypes(StripeObject): Funds that aren't available in the balance yet. You can find the pending balance for each currency and each payment type in the `source_types` property. """ refund_and_dispute_prefunding: Optional[RefundAndDisputePrefunding] + risk_reserved: Optional[RiskReserved] @classmethod def retrieve(cls, **params: Unpack["BalanceRetrieveParams"]) -> "Balance": @@ -314,4 +378,5 @@ def class_url(cls): "issuing": Issuing, "pending": Pending, "refund_and_dispute_prefunding": RefundAndDisputePrefunding, + "risk_reserved": RiskReserved, } diff --git a/stripe/_cash_balance.py b/stripe/_cash_balance.py index acd08a752..4164a8fb4 100644 --- a/stripe/_cash_balance.py +++ b/stripe/_cash_balance.py @@ -38,7 +38,7 @@ class Settings(StripeObject): """ livemode: bool """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ object: Literal["cash_balance"] """ diff --git a/stripe/_charge.py b/stripe/_charge.py index a3cd6ae25..2deedbbe9 100644 --- a/stripe/_charge.py +++ b/stripe/_charge.py @@ -1141,7 +1141,9 @@ class Crypto(StripeObject): """ The wallet address of the customer. """ - network: Optional[Literal["base", "ethereum", "polygon", "solana"]] + network: Optional[ + Literal["base", "ethereum", "polygon", "solana", "tempo"] + ] """ The blockchain network that the transaction was sent on. """ @@ -2090,10 +2092,6 @@ class StripeBalance(StripeObject): """ The connected account ID whose Stripe balance to use as the source of payment """ - source_type: Optional[Literal["bank_account", "card", "fpx"]] - """ - The [source_type](https://docs.stripe.com/api/balance/balance_object#balance_object-available-source_types) of the balance - """ class Swish(StripeObject): fingerprint: Optional[str] @@ -2112,6 +2110,12 @@ class Swish(StripeObject): class Twint(StripeObject): pass + class Upi(StripeObject): + vpa: Optional[str] + """ + Customer's unique Virtual Payment Address. + """ + class UsBankAccount(StripeObject): account_holder_type: Optional[Literal["company", "individual"]] """ @@ -2240,6 +2244,7 @@ class Zip(StripeObject): An additional hash is included on `payment_method_details` with a name matching this value. It contains information specific to the payment method. """ + upi: Optional[Upi] us_bank_account: Optional[UsBankAccount] wechat: Optional[Wechat] wechat_pay: Optional[WechatPay] @@ -2305,6 +2310,7 @@ class Zip(StripeObject): "stripe_balance": StripeBalance, "swish": Swish, "twint": Twint, + "upi": Upi, "us_bank_account": UsBankAccount, "wechat": Wechat, "wechat_pay": WechatPay, @@ -2469,7 +2475,7 @@ class TransferData(StripeObject): level3: Optional[Level3] livemode: bool """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ metadata: Dict[str, str] """ @@ -2634,7 +2640,7 @@ def capture( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/charges/{charge}/capture".format( - charge=sanitize_id(self.get("id")) + charge=sanitize_id(self._data.get("id")) ), params=params, ), @@ -2705,7 +2711,7 @@ async def capture_async( # pyright: ignore[reportGeneralTypeIssues] await self._request_async( "post", "/v1/charges/{charge}/capture".format( - charge=sanitize_id(self.get("id")) + charge=sanitize_id(self._data.get("id")) ), params=params, ), diff --git a/stripe/_confirmation_token.py b/stripe/_confirmation_token.py index 2248f0d67..a8a13dd30 100644 --- a/stripe/_confirmation_token.py +++ b/stripe/_confirmation_token.py @@ -1386,10 +1386,6 @@ class StripeBalance(StripeObject): """ The connected account ID whose Stripe balance to use as the source of payment """ - source_type: Optional[Literal["bank_account", "card", "fpx"]] - """ - The [source_type](https://docs.stripe.com/api/balance/balance_object#balance_object-available-source_types) of the balance - """ class Swish(StripeObject): pass @@ -1397,6 +1393,12 @@ class Swish(StripeObject): class Twint(StripeObject): pass + class Upi(StripeObject): + vpa: Optional[str] + """ + Customer's unique Virtual Payment Address + """ + class UsBankAccount(StripeObject): class Networks(StripeObject): preferred: Optional[str] @@ -1622,6 +1624,7 @@ class Zip(StripeObject): "stripe_balance", "swish", "twint", + "upi", "us_bank_account", "wechat_pay", "zip", @@ -1629,6 +1632,7 @@ class Zip(StripeObject): """ 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. """ + upi: Optional[Upi] us_bank_account: Optional[UsBankAccount] wechat_pay: Optional[WechatPay] zip: Optional[Zip] @@ -1690,6 +1694,7 @@ class Zip(StripeObject): "stripe_balance": StripeBalance, "swish": Swish, "twint": Twint, + "upi": Upi, "us_bank_account": UsBankAccount, "wechat_pay": WechatPay, "zip": Zip, @@ -1747,7 +1752,7 @@ class Address(StripeObject): """ livemode: bool """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ mandate_data: Optional[MandateData] """ diff --git a/stripe/_connect_collection_transfer.py b/stripe/_connect_collection_transfer.py index 397e20d15..b77ffa6f0 100644 --- a/stripe/_connect_collection_transfer.py +++ b/stripe/_connect_collection_transfer.py @@ -31,7 +31,7 @@ class ConnectCollectionTransfer(StripeObject): """ livemode: bool """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ object: Literal["connect_collection_transfer"] """ diff --git a/stripe/_coupon.py b/stripe/_coupon.py index 86c5a9fbb..a80ae22a0 100644 --- a/stripe/_coupon.py +++ b/stripe/_coupon.py @@ -27,7 +27,7 @@ class Coupon( """ A coupon contains information about a percent-off or amount-off discount you might want to apply to a customer. Coupons may be applied to [subscriptions](https://api.stripe.com#subscriptions), [invoices](https://api.stripe.com#invoices), - [checkout sessions](https://docs.stripe.com/api/checkout/sessions), [quotes](https://api.stripe.com#quotes), and more. Coupons do not work with conventional one-off [charges](https://api.stripe.com#create_charge) or [payment intents](https://docs.stripe.com/api/payment_intents). + [checkout sessions](https://docs.stripe.com/api/checkout/sessions), [quotes](https://api.stripe.com#quotes), and more. Coupons do not work with conventional one-off [charges](https://docs.stripe.com/api/charges/create) or [payment intents](https://docs.stripe.com/api/payment_intents). """ OBJECT_NAME: ClassVar[Literal["coupon"]] = "coupon" @@ -93,7 +93,7 @@ class Script(StripeObject): """ livemode: bool """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ max_redemptions: Optional[int] """ diff --git a/stripe/_credit_note.py b/stripe/_credit_note.py index 921d368a2..38fdf4a39 100644 --- a/stripe/_credit_note.py +++ b/stripe/_credit_note.py @@ -283,7 +283,7 @@ class TaxRateDetails(StripeObject): """ livemode: bool """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ memo: Optional[str] """ @@ -633,7 +633,7 @@ def void_credit_note( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/credit_notes/{id}/void".format( - id=sanitize_id(self.get("id")) + id=sanitize_id(self._data.get("id")) ), params=params, ), @@ -686,7 +686,7 @@ async def void_credit_note_async( # pyright: ignore[reportGeneralTypeIssues] await self._request_async( "post", "/v1/credit_notes/{id}/void".format( - id=sanitize_id(self.get("id")) + id=sanitize_id(self._data.get("id")) ), params=params, ), diff --git a/stripe/_credit_note_line_item.py b/stripe/_credit_note_line_item.py index 826e71e7b..96648ce45 100644 --- a/stripe/_credit_note_line_item.py +++ b/stripe/_credit_note_line_item.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, List, Optional +from typing import ClassVar, Dict, List, Optional from typing_extensions import Literal, TYPE_CHECKING if TYPE_CHECKING: @@ -138,7 +138,11 @@ class TaxRateDetails(StripeObject): """ livemode: bool """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. + """ + metadata: Optional[Dict[str, 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["credit_note_line_item"] """ diff --git a/stripe/_custom_method.py b/stripe/_custom_method.py index b2950f231..7b3a6de35 100644 --- a/stripe/_custom_method.py +++ b/stripe/_custom_method.py @@ -1,10 +1,11 @@ from typing import Optional from stripe import _util from urllib.parse import quote_plus +from typing_extensions import deprecated # TODO(major): 1704. -@_util.deprecated( +@deprecated( "the custom_method class decorator will be removed in a future version of stripe-python. Define custom methods directly and use StripeObject._static_request within." ) def custom_method( diff --git a/stripe/_customer.py b/stripe/_customer.py index 6486461b9..01f7bcf0b 100644 --- a/stripe/_customer.py +++ b/stripe/_customer.py @@ -366,7 +366,7 @@ class Location(StripeObject): invoice_settings: Optional[InvoiceSettings] livemode: bool """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ metadata: Optional[Dict[str, str]] """ @@ -510,7 +510,7 @@ def create_funding_instructions( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/customers/{customer}/funding_instructions".format( - customer=sanitize_id(self.get("id")) + customer=sanitize_id(self._data.get("id")) ), params=params, ), @@ -576,7 +576,7 @@ async def create_funding_instructions_async( # pyright: ignore[reportGeneralTyp await self._request_async( "post", "/v1/customers/{customer}/funding_instructions".format( - customer=sanitize_id(self.get("id")) + customer=sanitize_id(self._data.get("id")) ), params=params, ), @@ -727,7 +727,7 @@ def delete_discount( # pyright: ignore[reportGeneralTypeIssues] self._request( "delete", "/v1/customers/{customer}/discount".format( - customer=sanitize_id(self.get("id")) + customer=sanitize_id(self._data.get("id")) ), params=params, ), @@ -782,7 +782,7 @@ async def delete_discount_async( # pyright: ignore[reportGeneralTypeIssues] await self._request_async( "delete", "/v1/customers/{customer}/discount".format( - customer=sanitize_id(self.get("id")) + customer=sanitize_id(self._data.get("id")) ), params=params, ), @@ -879,7 +879,7 @@ def list_payment_methods( # pyright: ignore[reportGeneralTypeIssues] self._request( "get", "/v1/customers/{customer}/payment_methods".format( - customer=sanitize_id(self.get("id")) + customer=sanitize_id(self._data.get("id")) ), params=params, ), @@ -936,7 +936,7 @@ async def list_payment_methods_async( # pyright: ignore[reportGeneralTypeIssues await self._request_async( "get", "/v1/customers/{customer}/payment_methods".format( - customer=sanitize_id(self.get("id")) + customer=sanitize_id(self._data.get("id")) ), params=params, ), @@ -1061,7 +1061,7 @@ def retrieve_payment_method( # pyright: ignore[reportGeneralTypeIssues] self._request( "get", "/v1/customers/{customer}/payment_methods/{payment_method}".format( - customer=sanitize_id(self.get("id")), + customer=sanitize_id(self._data.get("id")), payment_method=sanitize_id(payment_method), ), params=params, @@ -1127,7 +1127,7 @@ async def retrieve_payment_method_async( # pyright: ignore[reportGeneralTypeIss await self._request_async( "get", "/v1/customers/{customer}/payment_methods/{payment_method}".format( - customer=sanitize_id(self.get("id")), + customer=sanitize_id(self._data.get("id")), payment_method=sanitize_id(payment_method), ), params=params, @@ -1469,7 +1469,7 @@ def create_source( If the card's owner has no default card, then the new card will become the default. However, if the owner already has a default, then it will not change. - To change the default, you should [update the customer](https://docs.stripe.com/docs/api#update_customer) to have a new default_source. + To change the default, you should [update the customer](https://docs.stripe.com/api/customers/update) to have a new default_source. """ return cast( Union["Account", "BankAccount", "Card", "Source"], @@ -1491,7 +1491,7 @@ async def create_source_async( If the card's owner has no default card, then the new card will become the default. However, if the owner already has a default, then it will not change. - To change the default, you should [update the customer](https://docs.stripe.com/docs/api#update_customer) to have a new default_source. + To change the default, you should [update the customer](https://docs.stripe.com/api/customers/update) to have a new default_source. """ return cast( Union["Account", "BankAccount", "Card", "Source"], @@ -1916,7 +1916,7 @@ def fund_cash_balance( # pyright: ignore[reportGeneralTypeIssues] self.resource._request( "post", "/v1/test_helpers/customers/{customer}/fund_cash_balance".format( - customer=sanitize_id(self.resource.get("id")) + customer=sanitize_id(self.resource._data.get("id")) ), params=params, ), @@ -1973,7 +1973,7 @@ async def fund_cash_balance_async( # pyright: ignore[reportGeneralTypeIssues] await self.resource._request_async( "post", "/v1/test_helpers/customers/{customer}/fund_cash_balance".format( - customer=sanitize_id(self.resource.get("id")) + customer=sanitize_id(self.resource._data.get("id")) ), params=params, ), diff --git a/stripe/_customer_balance_transaction.py b/stripe/_customer_balance_transaction.py index dafe4b81b..1c600800e 100644 --- a/stripe/_customer_balance_transaction.py +++ b/stripe/_customer_balance_transaction.py @@ -72,7 +72,7 @@ class CustomerBalanceTransaction(APIResource["CustomerBalanceTransaction"]): """ livemode: bool """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ metadata: Optional[Dict[str, str]] """ diff --git a/stripe/_customer_cash_balance_transaction.py b/stripe/_customer_cash_balance_transaction.py index e2aba6550..aeb4f2b7d 100644 --- a/stripe/_customer_cash_balance_transaction.py +++ b/stripe/_customer_cash_balance_transaction.py @@ -169,7 +169,7 @@ class UnappliedFromPayment(StripeObject): """ livemode: bool """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ net_amount: int """ diff --git a/stripe/_customer_payment_source_service.py b/stripe/_customer_payment_source_service.py index 7ea89ac77..589ccff6d 100644 --- a/stripe/_customer_payment_source_service.py +++ b/stripe/_customer_payment_source_service.py @@ -89,7 +89,7 @@ def create( If the card's owner has no default card, then the new card will become the default. However, if the owner already has a default, then it will not change. - To change the default, you should [update the customer](https://docs.stripe.com/docs/api#update_customer) to have a new default_source. + To change the default, you should [update the customer](https://docs.stripe.com/api/customers/update) to have a new default_source. """ return cast( "Union[Account, BankAccount, Card, Source]", @@ -115,7 +115,7 @@ async def create_async( If the card's owner has no default card, then the new card will become the default. However, if the owner already has a default, then it will not change. - To change the default, you should [update the customer](https://docs.stripe.com/docs/api#update_customer) to have a new default_source. + To change the default, you should [update the customer](https://docs.stripe.com/api/customers/update) to have a new default_source. """ return cast( "Union[Account, BankAccount, Card, Source]", diff --git a/stripe/_customer_session.py b/stripe/_customer_session.py index 245e82af9..012ee91d8 100644 --- a/stripe/_customer_session.py +++ b/stripe/_customer_session.py @@ -247,7 +247,7 @@ class Features(StripeObject): """ livemode: bool """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + 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_session"] """ diff --git a/stripe/_dispute.py b/stripe/_dispute.py index 71f056937..f93538966 100644 --- a/stripe/_dispute.py +++ b/stripe/_dispute.py @@ -478,7 +478,7 @@ class SmartDisputes(StripeObject): """ livemode: bool """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ metadata: Dict[str, str] """ @@ -571,7 +571,7 @@ def close( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/disputes/{dispute}/close".format( - dispute=sanitize_id(self.get("id")) + dispute=sanitize_id(self._data.get("id")) ), params=params, ), @@ -634,7 +634,7 @@ async def close_async( # pyright: ignore[reportGeneralTypeIssues] await self._request_async( "post", "/v1/disputes/{dispute}/close".format( - dispute=sanitize_id(self.get("id")) + dispute=sanitize_id(self._data.get("id")) ), params=params, ), diff --git a/stripe/_encode.py b/stripe/_encode.py index 3d7e68ef1..b27749857 100644 --- a/stripe/_encode.py +++ b/stripe/_encode.py @@ -2,7 +2,7 @@ import datetime import time from collections import OrderedDict -from typing import Generator, Tuple, Any +from typing import Any, Dict, Generator, Mapping, Optional, Tuple, Union def _encode_datetime(dttime: datetime.datetime): @@ -16,7 +16,8 @@ def _encode_datetime(dttime: datetime.datetime): def _encode_nested_dict(key, data, fmt="%s[%s]"): d = OrderedDict() - for subkey, subvalue in data.items(): + items = data._data.items() if hasattr(data, "_data") else data.items() + for subkey, subvalue in items: d[fmt % (key, subkey)] = subvalue return d @@ -27,8 +28,91 @@ def _json_encode_date_callback(value): return value -def _api_encode(data) -> Generator[Tuple[str, Any], None, None]: - for key, value in data.items(): +# Type for a request encoding schema node: either a leaf encoding string +# (e.g. "int64_string") or a nested dict mapping field names to sub-schemas. +_SchemaNode = Union[str, Dict[str, Any]] + + +def _coerce_v2_params( + params: Optional[Mapping[str, Any]], + schema: Dict[str, _SchemaNode], +) -> Optional[Mapping[str, Any]]: + """ + Coerce V2 request params according to the given encoding schema. + + For fields marked as "int64_string", converts int values to str so they + are serialized as JSON strings on the wire. Recurses into nested objects + and arrays. + """ + if params is None: + return None + + result: Dict[str, Any] = {} + for key, value in params.items(): + field_schema = schema.get(key) + if field_schema is not None: + result[key] = _coerce_value(value, field_schema) + else: + result[key] = value + return result + + +def _coerce_int64_string(value: Any, *, encode: bool) -> Any: + """ + Coerce an int64_string value in either direction. + + encode=True: int → str (request serialization) + encode=False: str → int (response hydration) + """ + if value is None: + return None + + from_type = int if encode else str + to_type = str if encode else int + + if isinstance(value, list): + return [ + to_type(v) + if isinstance(v, from_type) and not isinstance(v, bool) + else v + for v in value + ] + if isinstance(value, from_type) and not isinstance(value, bool): + return to_type(value) + return value + + +def _coerce_value(value: Any, schema: _SchemaNode) -> Any: + """Coerce a single value according to its schema node.""" + if value is None: + return None + + if schema == "int64_string": + return _coerce_int64_string(value, encode=True) + + if isinstance(schema, dict): + # Nested object schema + if isinstance(value, list): + # Array of objects with int64_string fields + return [ + dict(_coerce_v2_params(v, schema) or {}) + if isinstance(v, dict) + else v + for v in value + ] + if isinstance(value, dict): + return dict(_coerce_v2_params(value, schema) or {}) + return value + + return value + + +def _api_encode( + data: Mapping[str, Any], +) -> Generator[Tuple[str, Any], None, None]: + items = data.items() + + for key, value in items: if value is None: continue elif hasattr(value, "id"): @@ -37,13 +121,13 @@ def _api_encode(data) -> Generator[Tuple[str, Any], None, None]: for i, sv in enumerate(value): # Always use indexed format for arrays encoded_key = "%s[%d]" % (key, i) - if isinstance(sv, dict): + if isinstance(sv, dict) or hasattr(sv, "_data"): subdict = _encode_nested_dict(encoded_key, sv) for k, v in _api_encode(subdict): yield (k, v) else: yield (encoded_key, sv) - elif isinstance(value, dict): + elif isinstance(value, dict) or hasattr(value, "_data"): subdict = _encode_nested_dict(key, value) for subkey, subvalue in _api_encode(subdict): yield (subkey, subvalue) diff --git a/stripe/_ephemeral_key.py b/stripe/_ephemeral_key.py index 3b7d0b66b..2c0564c26 100644 --- a/stripe/_ephemeral_key.py +++ b/stripe/_ephemeral_key.py @@ -31,7 +31,7 @@ class EphemeralKey( """ livemode: bool """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ object: Literal["ephemeral_key"] """ diff --git a/stripe/_event.py b/stripe/_event.py index bdec492c8..b188ca695 100644 --- a/stripe/_event.py +++ b/stripe/_event.py @@ -123,7 +123,7 @@ class Request(StripeObject): """ livemode: bool """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ object: Literal["event"] """ diff --git a/stripe/_event_notification_handler.py b/stripe/_event_notification_handler.py index d29dda810..00fa531ae 100644 --- a/stripe/_event_notification_handler.py +++ b/stripe/_event_notification_handler.py @@ -73,6 +73,36 @@ from stripe.events._v2_core_account_updated_event import ( V2CoreAccountUpdatedEventNotification, ) + from stripe.events._v2_core_batch_job_batch_failed_event import ( + V2CoreBatchJobBatchFailedEventNotification, + ) + from stripe.events._v2_core_batch_job_canceled_event import ( + V2CoreBatchJobCanceledEventNotification, + ) + from stripe.events._v2_core_batch_job_completed_event import ( + V2CoreBatchJobCompletedEventNotification, + ) + from stripe.events._v2_core_batch_job_created_event import ( + V2CoreBatchJobCreatedEventNotification, + ) + from stripe.events._v2_core_batch_job_ready_for_upload_event import ( + V2CoreBatchJobReadyForUploadEventNotification, + ) + from stripe.events._v2_core_batch_job_timeout_event import ( + V2CoreBatchJobTimeoutEventNotification, + ) + from stripe.events._v2_core_batch_job_updated_event import ( + V2CoreBatchJobUpdatedEventNotification, + ) + from stripe.events._v2_core_batch_job_upload_timeout_event import ( + V2CoreBatchJobUploadTimeoutEventNotification, + ) + from stripe.events._v2_core_batch_job_validating_event import ( + V2CoreBatchJobValidatingEventNotification, + ) + from stripe.events._v2_core_batch_job_validation_failed_event import ( + V2CoreBatchJobValidationFailedEventNotification, + ) from stripe.events._v2_core_event_destination_ping_event import ( V2CoreEventDestinationPingEventNotification, ) @@ -556,6 +586,136 @@ def on_v2_core_account_updated( ) return func + def on_v2_core_batch_job_batch_failed( + self, + func: "Callable[[V2CoreBatchJobBatchFailedEventNotification, StripeClient], None]", + ): + """ + Registers a callback for the `V2CoreBatchJobBatchFailedEvent` (`v2.core.batch_job.batch_failed`) event notification. + """ + self._register( + "v2.core.batch_job.batch_failed", + func, + ) + return func + + def on_v2_core_batch_job_canceled( + self, + func: "Callable[[V2CoreBatchJobCanceledEventNotification, StripeClient], None]", + ): + """ + Registers a callback for the `V2CoreBatchJobCanceledEvent` (`v2.core.batch_job.canceled`) event notification. + """ + self._register( + "v2.core.batch_job.canceled", + func, + ) + return func + + def on_v2_core_batch_job_completed( + self, + func: "Callable[[V2CoreBatchJobCompletedEventNotification, StripeClient], None]", + ): + """ + Registers a callback for the `V2CoreBatchJobCompletedEvent` (`v2.core.batch_job.completed`) event notification. + """ + self._register( + "v2.core.batch_job.completed", + func, + ) + return func + + def on_v2_core_batch_job_created( + self, + func: "Callable[[V2CoreBatchJobCreatedEventNotification, StripeClient], None]", + ): + """ + Registers a callback for the `V2CoreBatchJobCreatedEvent` (`v2.core.batch_job.created`) event notification. + """ + self._register( + "v2.core.batch_job.created", + func, + ) + return func + + def on_v2_core_batch_job_ready_for_upload( + self, + func: "Callable[[V2CoreBatchJobReadyForUploadEventNotification, StripeClient], None]", + ): + """ + Registers a callback for the `V2CoreBatchJobReadyForUploadEvent` (`v2.core.batch_job.ready_for_upload`) event notification. + """ + self._register( + "v2.core.batch_job.ready_for_upload", + func, + ) + return func + + def on_v2_core_batch_job_timeout( + self, + func: "Callable[[V2CoreBatchJobTimeoutEventNotification, StripeClient], None]", + ): + """ + Registers a callback for the `V2CoreBatchJobTimeoutEvent` (`v2.core.batch_job.timeout`) event notification. + """ + self._register( + "v2.core.batch_job.timeout", + func, + ) + return func + + def on_v2_core_batch_job_updated( + self, + func: "Callable[[V2CoreBatchJobUpdatedEventNotification, StripeClient], None]", + ): + """ + Registers a callback for the `V2CoreBatchJobUpdatedEvent` (`v2.core.batch_job.updated`) event notification. + """ + self._register( + "v2.core.batch_job.updated", + func, + ) + return func + + def on_v2_core_batch_job_upload_timeout( + self, + func: "Callable[[V2CoreBatchJobUploadTimeoutEventNotification, StripeClient], None]", + ): + """ + Registers a callback for the `V2CoreBatchJobUploadTimeoutEvent` (`v2.core.batch_job.upload_timeout`) event notification. + """ + self._register( + "v2.core.batch_job.upload_timeout", + func, + ) + return func + + def on_v2_core_batch_job_validating( + self, + func: "Callable[[V2CoreBatchJobValidatingEventNotification, StripeClient], None]", + ): + """ + Registers a callback for the `V2CoreBatchJobValidatingEvent` (`v2.core.batch_job.validating`) event notification. + """ + self._register( + "v2.core.batch_job.validating", + func, + ) + return func + + def on_v2_core_batch_job_validation_failed( + self, + func: "Callable[[V2CoreBatchJobValidationFailedEventNotification, StripeClient], None]", + ): + """ + Registers a callback for the `V2CoreBatchJobValidationFailedEvent` (`v2.core.batch_job.validation_failed`) event notification. + """ + self._register( + "v2.core.batch_job.validation_failed", + func, + ) + return func + def on_v2_core_event_destination_ping( self, func: "Callable[[V2CoreEventDestinationPingEventNotification, StripeClient], None]", diff --git a/stripe/_exchange_rate.py b/stripe/_exchange_rate.py index 1414c522f..0c43be5b0 100644 --- a/stripe/_exchange_rate.py +++ b/stripe/_exchange_rate.py @@ -2,9 +2,8 @@ # File generated from our OpenAPI spec from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource -from stripe._util import deprecated from typing import ClassVar, Dict -from typing_extensions import Literal, Unpack, TYPE_CHECKING +from typing_extensions import Literal, Unpack, deprecated, TYPE_CHECKING if TYPE_CHECKING: from stripe.params._exchange_rate_list_params import ExchangeRateListParams diff --git a/stripe/_file_link.py b/stripe/_file_link.py index 620bede1d..5dcbf652f 100644 --- a/stripe/_file_link.py +++ b/stripe/_file_link.py @@ -51,7 +51,7 @@ class FileLink( """ livemode: bool """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ metadata: Dict[str, str] """ diff --git a/stripe/_funding_instructions.py b/stripe/_funding_instructions.py index 5e7841e77..11a50543c 100644 --- a/stripe/_funding_instructions.py +++ b/stripe/_funding_instructions.py @@ -573,7 +573,7 @@ class BankAddress(StripeObject): """ livemode: bool """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ object: Literal["funding_instructions"] """ diff --git a/stripe/_invoice.py b/stripe/_invoice.py index 8d5c96180..342f322c7 100644 --- a/stripe/_invoice.py +++ b/stripe/_invoice.py @@ -604,6 +604,7 @@ class LastFinalizationError(StripeObject): "secret_key_required", "sensitive_data_access_expired", "sepa_unsupported_account", + "service_period_coupon_with_metered_tiered_item_unsupported", "setup_attempt_failed", "setup_intent_authentication_failure", "setup_intent_invalid_parameter", @@ -749,7 +750,7 @@ class PauseCollection(StripeObject): Literal["keep_as_draft", "mark_uncollectible", "void"] ] """ - The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`. + The payment collection behavior for this subscription while paused. """ resumes_at: Optional[int] """ @@ -806,7 +807,7 @@ class MandateOptions(StripeObject): Literal["automatic", "instant", "microdeposits"] ] """ - Bank account verification method. + Bank account verification method. The default value is `automatic`. """ _inner_class_types = {"mandate_options": MandateOptions} @@ -897,6 +898,10 @@ class Pix(StripeObject): """ Determines if the amount includes the IOF tax. """ + expires_after_seconds: Optional[int] + """ + The number of seconds (between 10 and 1209600) after which Pix payment will expire. Defaults to 86400 seconds. + """ class SepaDebit(StripeObject): pass @@ -971,7 +976,7 @@ class Filters(StripeObject): Literal["automatic", "instant", "microdeposits"] ] """ - Bank account verification method. + Bank account verification method. The default value is `automatic`. """ _inner_class_types = { "financial_connections": FinancialConnections, @@ -1581,7 +1586,7 @@ class TaxRateDetails(StripeObject): """ livemode: bool """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ metadata: Optional[Dict[str, str]] """ @@ -1748,7 +1753,7 @@ def add_lines( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/invoices/{invoice}/add_lines".format( - invoice=sanitize_id(self.get("id")) + invoice=sanitize_id(self._data.get("id")) ), params=params, ), @@ -1803,7 +1808,7 @@ async def add_lines_async( # pyright: ignore[reportGeneralTypeIssues] await self._request_async( "post", "/v1/invoices/{invoice}/add_lines".format( - invoice=sanitize_id(self.get("id")) + invoice=sanitize_id(self._data.get("id")) ), params=params, ), @@ -1894,7 +1899,7 @@ def attach_payment( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/invoices/{invoice}/attach_payment".format( - invoice=sanitize_id(self.get("id")) + invoice=sanitize_id(self._data.get("id")) ), params=params, ), @@ -1985,7 +1990,7 @@ async def attach_payment_async( # pyright: ignore[reportGeneralTypeIssues] await self._request_async( "post", "/v1/invoices/{invoice}/attach_payment".format( - invoice=sanitize_id(self.get("id")) + invoice=sanitize_id(self._data.get("id")) ), params=params, ), @@ -1994,7 +1999,7 @@ async def attach_payment_async( # pyright: ignore[reportGeneralTypeIssues] @classmethod def create(cls, **params: Unpack["InvoiceCreateParams"]) -> "Invoice": """ - This endpoint creates a draft invoice for a given customer. The invoice remains a draft until you [finalize the invoice, which allows you to [pay](https://docs.stripe.com/api#finalize_invoice) or send](https://docs.stripe.com/api/invoices/pay) the invoice to your customers. + This endpoint creates a draft invoice for a given customer. The invoice remains a draft until you [finalize the invoice, which allows you to [pay](/api/invoices/pay) or send](https://docs.stripe.com/api/invoices/finalize) the invoice to your customers. """ return cast( "Invoice", @@ -2010,7 +2015,7 @@ async def create_async( cls, **params: Unpack["InvoiceCreateParams"] ) -> "Invoice": """ - This endpoint creates a draft invoice for a given customer. The invoice remains a draft until you [finalize the invoice, which allows you to [pay](https://docs.stripe.com/api#finalize_invoice) or send](https://docs.stripe.com/api/invoices/pay) the invoice to your customers. + This endpoint creates a draft invoice for a given customer. The invoice remains a draft until you [finalize the invoice, which allows you to [pay](/api/invoices/pay) or send](https://docs.stripe.com/api/invoices/finalize) the invoice to your customers. """ return cast( "Invoice", @@ -2074,7 +2079,7 @@ def _cls_delete( cls, sid: str, **params: Unpack["InvoiceDeleteParams"] ) -> "Invoice": """ - Permanently deletes a one-off invoice draft. This cannot be undone. Attempts to delete invoices that are no longer in a draft state will fail; once an invoice has been finalized or if an invoice is for a subscription, it must be [voided](https://docs.stripe.com/api#void_invoice). + Permanently deletes a one-off invoice draft. This cannot be undone. Attempts to delete invoices that are no longer in a draft state will fail; once an invoice has been finalized or if an invoice is for a subscription, it must be [voided](https://docs.stripe.com/api/invoices/void). """ url = "%s/%s" % (cls.class_url(), sanitize_id(sid)) return cast( @@ -2090,14 +2095,14 @@ def _cls_delete( @staticmethod def delete(sid: str, **params: Unpack["InvoiceDeleteParams"]) -> "Invoice": """ - Permanently deletes a one-off invoice draft. This cannot be undone. Attempts to delete invoices that are no longer in a draft state will fail; once an invoice has been finalized or if an invoice is for a subscription, it must be [voided](https://docs.stripe.com/api#void_invoice). + Permanently deletes a one-off invoice draft. This cannot be undone. Attempts to delete invoices that are no longer in a draft state will fail; once an invoice has been finalized or if an invoice is for a subscription, it must be [voided](https://docs.stripe.com/api/invoices/void). """ ... @overload def delete(self, **params: Unpack["InvoiceDeleteParams"]) -> "Invoice": """ - Permanently deletes a one-off invoice draft. This cannot be undone. Attempts to delete invoices that are no longer in a draft state will fail; once an invoice has been finalized or if an invoice is for a subscription, it must be [voided](https://docs.stripe.com/api#void_invoice). + Permanently deletes a one-off invoice draft. This cannot be undone. Attempts to delete invoices that are no longer in a draft state will fail; once an invoice has been finalized or if an invoice is for a subscription, it must be [voided](https://docs.stripe.com/api/invoices/void). """ ... @@ -2106,7 +2111,7 @@ def delete( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["InvoiceDeleteParams"] ) -> "Invoice": """ - Permanently deletes a one-off invoice draft. This cannot be undone. Attempts to delete invoices that are no longer in a draft state will fail; once an invoice has been finalized or if an invoice is for a subscription, it must be [voided](https://docs.stripe.com/api#void_invoice). + Permanently deletes a one-off invoice draft. This cannot be undone. Attempts to delete invoices that are no longer in a draft state will fail; once an invoice has been finalized or if an invoice is for a subscription, it must be [voided](https://docs.stripe.com/api/invoices/void). """ return self._request_and_refresh( "delete", @@ -2119,7 +2124,7 @@ async def _cls_delete_async( cls, sid: str, **params: Unpack["InvoiceDeleteParams"] ) -> "Invoice": """ - Permanently deletes a one-off invoice draft. This cannot be undone. Attempts to delete invoices that are no longer in a draft state will fail; once an invoice has been finalized or if an invoice is for a subscription, it must be [voided](https://docs.stripe.com/api#void_invoice). + Permanently deletes a one-off invoice draft. This cannot be undone. Attempts to delete invoices that are no longer in a draft state will fail; once an invoice has been finalized or if an invoice is for a subscription, it must be [voided](https://docs.stripe.com/api/invoices/void). """ url = "%s/%s" % (cls.class_url(), sanitize_id(sid)) return cast( @@ -2137,7 +2142,7 @@ async def delete_async( sid: str, **params: Unpack["InvoiceDeleteParams"] ) -> "Invoice": """ - Permanently deletes a one-off invoice draft. This cannot be undone. Attempts to delete invoices that are no longer in a draft state will fail; once an invoice has been finalized or if an invoice is for a subscription, it must be [voided](https://docs.stripe.com/api#void_invoice). + Permanently deletes a one-off invoice draft. This cannot be undone. Attempts to delete invoices that are no longer in a draft state will fail; once an invoice has been finalized or if an invoice is for a subscription, it must be [voided](https://docs.stripe.com/api/invoices/void). """ ... @@ -2146,7 +2151,7 @@ async def delete_async( self, **params: Unpack["InvoiceDeleteParams"] ) -> "Invoice": """ - Permanently deletes a one-off invoice draft. This cannot be undone. Attempts to delete invoices that are no longer in a draft state will fail; once an invoice has been finalized or if an invoice is for a subscription, it must be [voided](https://docs.stripe.com/api#void_invoice). + Permanently deletes a one-off invoice draft. This cannot be undone. Attempts to delete invoices that are no longer in a draft state will fail; once an invoice has been finalized or if an invoice is for a subscription, it must be [voided](https://docs.stripe.com/api/invoices/void). """ ... @@ -2155,7 +2160,7 @@ async def delete_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["InvoiceDeleteParams"] ) -> "Invoice": """ - Permanently deletes a one-off invoice draft. This cannot be undone. Attempts to delete invoices that are no longer in a draft state will fail; once an invoice has been finalized or if an invoice is for a subscription, it must be [voided](https://docs.stripe.com/api#void_invoice). + Permanently deletes a one-off invoice draft. This cannot be undone. Attempts to delete invoices that are no longer in a draft state will fail; once an invoice has been finalized or if an invoice is for a subscription, it must be [voided](https://docs.stripe.com/api/invoices/void). """ return await self._request_and_refresh_async( "delete", @@ -2212,7 +2217,7 @@ def detach_payment( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/invoices/{invoice}/detach_payment".format( - invoice=sanitize_id(self.get("id")) + invoice=sanitize_id(self._data.get("id")) ), params=params, ), @@ -2267,7 +2272,7 @@ async def detach_payment_async( # pyright: ignore[reportGeneralTypeIssues] await self._request_async( "post", "/v1/invoices/{invoice}/detach_payment".format( - invoice=sanitize_id(self.get("id")) + invoice=sanitize_id(self._data.get("id")) ), params=params, ), @@ -2322,7 +2327,7 @@ def finalize_invoice( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/invoices/{invoice}/finalize".format( - invoice=sanitize_id(self.get("id")) + invoice=sanitize_id(self._data.get("id")) ), params=params, ), @@ -2377,7 +2382,7 @@ async def finalize_invoice_async( # pyright: ignore[reportGeneralTypeIssues] await self._request_async( "post", "/v1/invoices/{invoice}/finalize".format( - invoice=sanitize_id(self.get("id")) + invoice=sanitize_id(self._data.get("id")) ), params=params, ), @@ -2472,7 +2477,7 @@ def mark_uncollectible( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/invoices/{invoice}/mark_uncollectible".format( - invoice=sanitize_id(self.get("id")) + invoice=sanitize_id(self._data.get("id")) ), params=params, ), @@ -2527,7 +2532,7 @@ async def mark_uncollectible_async( # pyright: ignore[reportGeneralTypeIssues] await self._request_async( "post", "/v1/invoices/{invoice}/mark_uncollectible".format( - invoice=sanitize_id(self.get("id")) + invoice=sanitize_id(self._data.get("id")) ), params=params, ), @@ -2622,7 +2627,7 @@ def pay( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/invoices/{invoice}/pay".format( - invoice=sanitize_id(self.get("id")) + invoice=sanitize_id(self._data.get("id")) ), params=params, ), @@ -2677,7 +2682,7 @@ async def pay_async( # pyright: ignore[reportGeneralTypeIssues] await self._request_async( "post", "/v1/invoices/{invoice}/pay".format( - invoice=sanitize_id(self.get("id")) + invoice=sanitize_id(self._data.get("id")) ), params=params, ), @@ -2732,7 +2737,7 @@ def remove_lines( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/invoices/{invoice}/remove_lines".format( - invoice=sanitize_id(self.get("id")) + invoice=sanitize_id(self._data.get("id")) ), params=params, ), @@ -2787,7 +2792,7 @@ async def remove_lines_async( # pyright: ignore[reportGeneralTypeIssues] await self._request_async( "post", "/v1/invoices/{invoice}/remove_lines".format( - invoice=sanitize_id(self.get("id")) + invoice=sanitize_id(self._data.get("id")) ), params=params, ), @@ -2872,7 +2877,7 @@ def send_invoice( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/invoices/{invoice}/send".format( - invoice=sanitize_id(self.get("id")) + invoice=sanitize_id(self._data.get("id")) ), params=params, ), @@ -2935,7 +2940,7 @@ async def send_invoice_async( # pyright: ignore[reportGeneralTypeIssues] await self._request_async( "post", "/v1/invoices/{invoice}/send".format( - invoice=sanitize_id(self.get("id")) + invoice=sanitize_id(self._data.get("id")) ), params=params, ), @@ -2990,7 +2995,7 @@ def update_lines( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/invoices/{invoice}/update_lines".format( - invoice=sanitize_id(self.get("id")) + invoice=sanitize_id(self._data.get("id")) ), params=params, ), @@ -3045,7 +3050,7 @@ async def update_lines_async( # pyright: ignore[reportGeneralTypeIssues] await self._request_async( "post", "/v1/invoices/{invoice}/update_lines".format( - invoice=sanitize_id(self.get("id")) + invoice=sanitize_id(self._data.get("id")) ), params=params, ), @@ -3056,9 +3061,9 @@ def _cls_void_invoice( cls, invoice: str, **params: Unpack["InvoiceVoidInvoiceParams"] ) -> "Invoice": """ - Mark a finalized invoice as void. This cannot be undone. Voiding an invoice is similar to [deletion](https://docs.stripe.com/api#delete_invoice), however it only applies to finalized invoices and maintains a papertrail where the invoice can still be found. + Mark a finalized invoice as void. This cannot be undone. Voiding an invoice is similar to [deletion](https://docs.stripe.com/api/invoices/delete), however it only applies to finalized invoices and maintains a papertrail where the invoice can still be found. - Consult with local regulations to determine whether and how an invoice might be amended, canceled, or voided in the jurisdiction you're doing business in. You might need to [issue another invoice or credit note](https://docs.stripe.com/api#create_invoice) instead. Stripe recommends that you consult with your legal counsel for advice specific to your business. + Consult with local regulations to determine whether and how an invoice might be amended, canceled, or voided in the jurisdiction you're doing business in. You might need to [issue another invoice or credit note](https://docs.stripe.com/api/invoices/create) instead. Stripe recommends that you consult with your legal counsel for advice specific to your business. """ return cast( "Invoice", @@ -3077,9 +3082,9 @@ def void_invoice( invoice: str, **params: Unpack["InvoiceVoidInvoiceParams"] ) -> "Invoice": """ - Mark a finalized invoice as void. This cannot be undone. Voiding an invoice is similar to [deletion](https://docs.stripe.com/api#delete_invoice), however it only applies to finalized invoices and maintains a papertrail where the invoice can still be found. + Mark a finalized invoice as void. This cannot be undone. Voiding an invoice is similar to [deletion](https://docs.stripe.com/api/invoices/delete), however it only applies to finalized invoices and maintains a papertrail where the invoice can still be found. - Consult with local regulations to determine whether and how an invoice might be amended, canceled, or voided in the jurisdiction you're doing business in. You might need to [issue another invoice or credit note](https://docs.stripe.com/api#create_invoice) instead. Stripe recommends that you consult with your legal counsel for advice specific to your business. + Consult with local regulations to determine whether and how an invoice might be amended, canceled, or voided in the jurisdiction you're doing business in. You might need to [issue another invoice or credit note](https://docs.stripe.com/api/invoices/create) instead. Stripe recommends that you consult with your legal counsel for advice specific to your business. """ ... @@ -3088,9 +3093,9 @@ def void_invoice( self, **params: Unpack["InvoiceVoidInvoiceParams"] ) -> "Invoice": """ - Mark a finalized invoice as void. This cannot be undone. Voiding an invoice is similar to [deletion](https://docs.stripe.com/api#delete_invoice), however it only applies to finalized invoices and maintains a papertrail where the invoice can still be found. + Mark a finalized invoice as void. This cannot be undone. Voiding an invoice is similar to [deletion](https://docs.stripe.com/api/invoices/delete), however it only applies to finalized invoices and maintains a papertrail where the invoice can still be found. - Consult with local regulations to determine whether and how an invoice might be amended, canceled, or voided in the jurisdiction you're doing business in. You might need to [issue another invoice or credit note](https://docs.stripe.com/api#create_invoice) instead. Stripe recommends that you consult with your legal counsel for advice specific to your business. + Consult with local regulations to determine whether and how an invoice might be amended, canceled, or voided in the jurisdiction you're doing business in. You might need to [issue another invoice or credit note](https://docs.stripe.com/api/invoices/create) instead. Stripe recommends that you consult with your legal counsel for advice specific to your business. """ ... @@ -3099,16 +3104,16 @@ def void_invoice( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["InvoiceVoidInvoiceParams"] ) -> "Invoice": """ - Mark a finalized invoice as void. This cannot be undone. Voiding an invoice is similar to [deletion](https://docs.stripe.com/api#delete_invoice), however it only applies to finalized invoices and maintains a papertrail where the invoice can still be found. + Mark a finalized invoice as void. This cannot be undone. Voiding an invoice is similar to [deletion](https://docs.stripe.com/api/invoices/delete), however it only applies to finalized invoices and maintains a papertrail where the invoice can still be found. - Consult with local regulations to determine whether and how an invoice might be amended, canceled, or voided in the jurisdiction you're doing business in. You might need to [issue another invoice or credit note](https://docs.stripe.com/api#create_invoice) instead. Stripe recommends that you consult with your legal counsel for advice specific to your business. + Consult with local regulations to determine whether and how an invoice might be amended, canceled, or voided in the jurisdiction you're doing business in. You might need to [issue another invoice or credit note](https://docs.stripe.com/api/invoices/create) instead. Stripe recommends that you consult with your legal counsel for advice specific to your business. """ return cast( "Invoice", self._request( "post", "/v1/invoices/{invoice}/void".format( - invoice=sanitize_id(self.get("id")) + invoice=sanitize_id(self._data.get("id")) ), params=params, ), @@ -3119,9 +3124,9 @@ async def _cls_void_invoice_async( cls, invoice: str, **params: Unpack["InvoiceVoidInvoiceParams"] ) -> "Invoice": """ - Mark a finalized invoice as void. This cannot be undone. Voiding an invoice is similar to [deletion](https://docs.stripe.com/api#delete_invoice), however it only applies to finalized invoices and maintains a papertrail where the invoice can still be found. + Mark a finalized invoice as void. This cannot be undone. Voiding an invoice is similar to [deletion](https://docs.stripe.com/api/invoices/delete), however it only applies to finalized invoices and maintains a papertrail where the invoice can still be found. - Consult with local regulations to determine whether and how an invoice might be amended, canceled, or voided in the jurisdiction you're doing business in. You might need to [issue another invoice or credit note](https://docs.stripe.com/api#create_invoice) instead. Stripe recommends that you consult with your legal counsel for advice specific to your business. + Consult with local regulations to determine whether and how an invoice might be amended, canceled, or voided in the jurisdiction you're doing business in. You might need to [issue another invoice or credit note](https://docs.stripe.com/api/invoices/create) instead. Stripe recommends that you consult with your legal counsel for advice specific to your business. """ return cast( "Invoice", @@ -3140,9 +3145,9 @@ async def void_invoice_async( invoice: str, **params: Unpack["InvoiceVoidInvoiceParams"] ) -> "Invoice": """ - Mark a finalized invoice as void. This cannot be undone. Voiding an invoice is similar to [deletion](https://docs.stripe.com/api#delete_invoice), however it only applies to finalized invoices and maintains a papertrail where the invoice can still be found. + Mark a finalized invoice as void. This cannot be undone. Voiding an invoice is similar to [deletion](https://docs.stripe.com/api/invoices/delete), however it only applies to finalized invoices and maintains a papertrail where the invoice can still be found. - Consult with local regulations to determine whether and how an invoice might be amended, canceled, or voided in the jurisdiction you're doing business in. You might need to [issue another invoice or credit note](https://docs.stripe.com/api#create_invoice) instead. Stripe recommends that you consult with your legal counsel for advice specific to your business. + Consult with local regulations to determine whether and how an invoice might be amended, canceled, or voided in the jurisdiction you're doing business in. You might need to [issue another invoice or credit note](https://docs.stripe.com/api/invoices/create) instead. Stripe recommends that you consult with your legal counsel for advice specific to your business. """ ... @@ -3151,9 +3156,9 @@ async def void_invoice_async( self, **params: Unpack["InvoiceVoidInvoiceParams"] ) -> "Invoice": """ - Mark a finalized invoice as void. This cannot be undone. Voiding an invoice is similar to [deletion](https://docs.stripe.com/api#delete_invoice), however it only applies to finalized invoices and maintains a papertrail where the invoice can still be found. + Mark a finalized invoice as void. This cannot be undone. Voiding an invoice is similar to [deletion](https://docs.stripe.com/api/invoices/delete), however it only applies to finalized invoices and maintains a papertrail where the invoice can still be found. - Consult with local regulations to determine whether and how an invoice might be amended, canceled, or voided in the jurisdiction you're doing business in. You might need to [issue another invoice or credit note](https://docs.stripe.com/api#create_invoice) instead. Stripe recommends that you consult with your legal counsel for advice specific to your business. + Consult with local regulations to determine whether and how an invoice might be amended, canceled, or voided in the jurisdiction you're doing business in. You might need to [issue another invoice or credit note](https://docs.stripe.com/api/invoices/create) instead. Stripe recommends that you consult with your legal counsel for advice specific to your business. """ ... @@ -3162,16 +3167,16 @@ async def void_invoice_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["InvoiceVoidInvoiceParams"] ) -> "Invoice": """ - Mark a finalized invoice as void. This cannot be undone. Voiding an invoice is similar to [deletion](https://docs.stripe.com/api#delete_invoice), however it only applies to finalized invoices and maintains a papertrail where the invoice can still be found. + Mark a finalized invoice as void. This cannot be undone. Voiding an invoice is similar to [deletion](https://docs.stripe.com/api/invoices/delete), however it only applies to finalized invoices and maintains a papertrail where the invoice can still be found. - Consult with local regulations to determine whether and how an invoice might be amended, canceled, or voided in the jurisdiction you're doing business in. You might need to [issue another invoice or credit note](https://docs.stripe.com/api#create_invoice) instead. Stripe recommends that you consult with your legal counsel for advice specific to your business. + Consult with local regulations to determine whether and how an invoice might be amended, canceled, or voided in the jurisdiction you're doing business in. You might need to [issue another invoice or credit note](https://docs.stripe.com/api/invoices/create) instead. Stripe recommends that you consult with your legal counsel for advice specific to your business. """ return cast( "Invoice", await self._request_async( "post", "/v1/invoices/{invoice}/void".format( - invoice=sanitize_id(self.get("id")) + invoice=sanitize_id(self._data.get("id")) ), params=params, ), diff --git a/stripe/_invoice_item.py b/stripe/_invoice_item.py index e97100c56..06b0efa50 100644 --- a/stripe/_invoice_item.py +++ b/stripe/_invoice_item.py @@ -169,7 +169,7 @@ class DiscountAmount(StripeObject): """ livemode: bool """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ margins: Optional[List[ExpandableField["Margin"]]] """ @@ -203,7 +203,11 @@ class DiscountAmount(StripeObject): proration_details: Optional[ProrationDetails] quantity: int """ - Quantity of units for the invoice item. If the invoice item is a proration, the quantity of the subscription that the proration was computed for. + Quantity of units for the invoice item in integer format, with any decimal precision truncated. For the item's full-precision decimal quantity, use `quantity_decimal`. This field will be deprecated in favor of `quantity_decimal` in a future version. If the invoice item is a proration, the quantity of the subscription that the proration was computed for. + """ + quantity_decimal: str + """ + Non-negative decimal with at most 12 decimal places. The quantity of units for the invoice item. """ tax_rates: Optional[List["TaxRate"]] """ diff --git a/stripe/_invoice_line_item.py b/stripe/_invoice_line_item.py index 94255477c..c98a4b3ed 100644 --- a/stripe/_invoice_line_item.py +++ b/stripe/_invoice_line_item.py @@ -290,7 +290,7 @@ class TaxRateDetails(StripeObject): """ livemode: bool """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ margin_amounts: Optional[List[MarginAmount]] """ @@ -323,7 +323,11 @@ class TaxRateDetails(StripeObject): """ quantity: Optional[int] """ - The quantity of the subscription, if the line item is a subscription or a proration. + Quantity of units for the invoice line item in integer format, with any decimal precision truncated. For the line item's full-precision decimal quantity, use `quantity_decimal`. This field will be deprecated in favor of `quantity_decimal` in a future version. If the line item is a proration or subscription, the quantity of the subscription that the proration was computed for. + """ + quantity_decimal: Optional[str] + """ + Non-negative decimal with at most 12 decimal places. The quantity of units for the line item. """ subscription: Optional[ExpandableField["Subscription"]] subtotal: int diff --git a/stripe/_invoice_payment.py b/stripe/_invoice_payment.py index 2ae5a43a2..f88523c6f 100644 --- a/stripe/_invoice_payment.py +++ b/stripe/_invoice_payment.py @@ -92,7 +92,7 @@ class StatusTransitions(StripeObject): """ livemode: bool """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ object: Literal["invoice_payment"] """ diff --git a/stripe/_invoice_rendering_template.py b/stripe/_invoice_rendering_template.py index 3991ec483..85faba21b 100644 --- a/stripe/_invoice_rendering_template.py +++ b/stripe/_invoice_rendering_template.py @@ -42,7 +42,7 @@ class InvoiceRenderingTemplate( """ livemode: bool """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ metadata: Optional[Dict[str, str]] """ @@ -117,7 +117,7 @@ def archive( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/invoice_rendering_templates/{template}/archive".format( - template=sanitize_id(self.get("id")) + template=sanitize_id(self._data.get("id")) ), params=params, ), @@ -175,7 +175,7 @@ async def archive_async( # pyright: ignore[reportGeneralTypeIssues] await self._request_async( "post", "/v1/invoice_rendering_templates/{template}/archive".format( - template=sanitize_id(self.get("id")) + template=sanitize_id(self._data.get("id")) ), params=params, ), @@ -299,7 +299,7 @@ def unarchive( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/invoice_rendering_templates/{template}/unarchive".format( - template=sanitize_id(self.get("id")) + template=sanitize_id(self._data.get("id")) ), params=params, ), @@ -357,7 +357,7 @@ async def unarchive_async( # pyright: ignore[reportGeneralTypeIssues] await self._request_async( "post", "/v1/invoice_rendering_templates/{template}/unarchive".format( - template=sanitize_id(self.get("id")) + template=sanitize_id(self._data.get("id")) ), params=params, ), diff --git a/stripe/_invoice_service.py b/stripe/_invoice_service.py index e3c93e6c5..db1d71393 100644 --- a/stripe/_invoice_service.py +++ b/stripe/_invoice_service.py @@ -85,7 +85,7 @@ def delete( options: Optional["RequestOptions"] = None, ) -> "Invoice": """ - Permanently deletes a one-off invoice draft. This cannot be undone. Attempts to delete invoices that are no longer in a draft state will fail; once an invoice has been finalized or if an invoice is for a subscription, it must be [voided](https://docs.stripe.com/api#void_invoice). + Permanently deletes a one-off invoice draft. This cannot be undone. Attempts to delete invoices that are no longer in a draft state will fail; once an invoice has been finalized or if an invoice is for a subscription, it must be [voided](https://docs.stripe.com/api/invoices/void). """ return cast( "Invoice", @@ -105,7 +105,7 @@ async def delete_async( options: Optional["RequestOptions"] = None, ) -> "Invoice": """ - Permanently deletes a one-off invoice draft. This cannot be undone. Attempts to delete invoices that are no longer in a draft state will fail; once an invoice has been finalized or if an invoice is for a subscription, it must be [voided](https://docs.stripe.com/api#void_invoice). + Permanently deletes a one-off invoice draft. This cannot be undone. Attempts to delete invoices that are no longer in a draft state will fail; once an invoice has been finalized or if an invoice is for a subscription, it must be [voided](https://docs.stripe.com/api/invoices/void). """ return cast( "Invoice", @@ -252,7 +252,7 @@ def create( options: Optional["RequestOptions"] = None, ) -> "Invoice": """ - This endpoint creates a draft invoice for a given customer. The invoice remains a draft until you [finalize the invoice, which allows you to [pay](https://docs.stripe.com/api#finalize_invoice) or send](https://docs.stripe.com/api/invoices/pay) the invoice to your customers. + This endpoint creates a draft invoice for a given customer. The invoice remains a draft until you [finalize the invoice, which allows you to [pay](/api/invoices/pay) or send](https://docs.stripe.com/api/invoices/finalize) the invoice to your customers. """ return cast( "Invoice", @@ -271,7 +271,7 @@ async def create_async( options: Optional["RequestOptions"] = None, ) -> "Invoice": """ - This endpoint creates a draft invoice for a given customer. The invoice remains a draft until you [finalize the invoice, which allows you to [pay](https://docs.stripe.com/api#finalize_invoice) or send](https://docs.stripe.com/api/invoices/pay) the invoice to your customers. + This endpoint creates a draft invoice for a given customer. The invoice remains a draft until you [finalize the invoice, which allows you to [pay](/api/invoices/pay) or send](https://docs.stripe.com/api/invoices/finalize) the invoice to your customers. """ return cast( "Invoice", @@ -753,9 +753,9 @@ def void_invoice( options: Optional["RequestOptions"] = None, ) -> "Invoice": """ - Mark a finalized invoice as void. This cannot be undone. Voiding an invoice is similar to [deletion](https://docs.stripe.com/api#delete_invoice), however it only applies to finalized invoices and maintains a papertrail where the invoice can still be found. + Mark a finalized invoice as void. This cannot be undone. Voiding an invoice is similar to [deletion](https://docs.stripe.com/api/invoices/delete), however it only applies to finalized invoices and maintains a papertrail where the invoice can still be found. - Consult with local regulations to determine whether and how an invoice might be amended, canceled, or voided in the jurisdiction you're doing business in. You might need to [issue another invoice or credit note](https://docs.stripe.com/api#create_invoice) instead. Stripe recommends that you consult with your legal counsel for advice specific to your business. + Consult with local regulations to determine whether and how an invoice might be amended, canceled, or voided in the jurisdiction you're doing business in. You might need to [issue another invoice or credit note](https://docs.stripe.com/api/invoices/create) instead. Stripe recommends that you consult with your legal counsel for advice specific to your business. """ return cast( "Invoice", @@ -777,9 +777,9 @@ async def void_invoice_async( options: Optional["RequestOptions"] = None, ) -> "Invoice": """ - Mark a finalized invoice as void. This cannot be undone. Voiding an invoice is similar to [deletion](https://docs.stripe.com/api#delete_invoice), however it only applies to finalized invoices and maintains a papertrail where the invoice can still be found. + Mark a finalized invoice as void. This cannot be undone. Voiding an invoice is similar to [deletion](https://docs.stripe.com/api/invoices/delete), however it only applies to finalized invoices and maintains a papertrail where the invoice can still be found. - Consult with local regulations to determine whether and how an invoice might be amended, canceled, or voided in the jurisdiction you're doing business in. You might need to [issue another invoice or credit note](https://docs.stripe.com/api#create_invoice) instead. Stripe recommends that you consult with your legal counsel for advice specific to your business. + Consult with local regulations to determine whether and how an invoice might be amended, canceled, or voided in the jurisdiction you're doing business in. You might need to [issue another invoice or credit note](https://docs.stripe.com/api/invoices/create) instead. Stripe recommends that you consult with your legal counsel for advice specific to your business. """ return cast( "Invoice", diff --git a/stripe/_list_object.py b/stripe/_list_object.py index d2daa3b5d..c88e7e078 100644 --- a/stripe/_list_object.py +++ b/stripe/_list_object.py @@ -33,7 +33,7 @@ class ListObject(StripeObject, Generic[T]): url: str def _get_url_for_list(self) -> str: - url = self.get("url") + url = self._data.get("url") if not isinstance(url, str): raise ValueError( 'Cannot call .list on a list object without a string "url" property' @@ -63,7 +63,7 @@ async def list_async(self, **params: Mapping[str, Any]) -> Self: ) def create(self, **params: Mapping[str, Any]) -> T: - url = self.get("url") + url = self._data.get("url") if not isinstance(url, str): raise ValueError( 'Cannot call .create on a list object for the collection of an object without a string "url" property' @@ -79,13 +79,13 @@ def create(self, **params: Mapping[str, Any]) -> T: ) def retrieve(self, id: str, **params: Mapping[str, Any]): - url = self.get("url") + url = self._data.get("url") if not isinstance(url, str): raise ValueError( 'Cannot call .retrieve on a list object for the collection of an object without a string "url" property' ) - url = "%s/%s" % (self.get("url"), quote_plus(id)) + url = "%s/%s" % (url, quote_plus(id)) return cast( T, self._request( @@ -98,7 +98,7 @@ def retrieve(self, id: str, **params: Mapping[str, Any]): def __getitem__(self, k: str) -> T: if isinstance(k, str): # pyright: ignore - return super(ListObject, self).__getitem__(k) + return super().__getitem__(k) else: raise KeyError( "You tried to access the %s index, but ListObject types only " @@ -107,18 +107,13 @@ def __getitem__(self, k: str) -> T: ".data[%s])" % (repr(k), repr(k)) ) - # Pyright doesn't like this because ListObject inherits from StripeObject inherits from Dict[str, Any] - # and so it wants the type of __iter__ to agree with __iter__ from Dict[str, Any] - # But we are iterating through "data", which is a List[T]. - def __iter__( # pyright: ignore - self, - ) -> Iterator[T]: + def __iter__(self) -> Iterator[T]: return getattr(self, "data", []).__iter__() def __len__(self) -> int: return getattr(self, "data", []).__len__() - def __reversed__(self) -> Iterator[T]: # pyright: ignore (see above) + def __reversed__(self) -> Iterator[T]: return getattr(self, "data", []).__reversed__() def auto_paging_iter(self) -> AnyIterator[T]: diff --git a/stripe/_mandate.py b/stripe/_mandate.py index 072c7113b..3ff6a317f 100644 --- a/stripe/_mandate.py +++ b/stripe/_mandate.py @@ -259,6 +259,24 @@ class SepaDebit(StripeObject): The URL of the mandate. This URL generally contains sensitive information about the customer and should be shared with them exclusively. """ + class Upi(StripeObject): + amount: Optional[int] + """ + Amount to be charged for future payments. + """ + amount_type: Optional[Literal["fixed", "maximum"]] + """ + One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param. + """ + description: Optional[str] + """ + A description of the mandate or subscription that is meant to be displayed to the customer. + """ + end_date: Optional[int] + """ + End date of the mandate or subscription. + """ + class UsBankAccount(StripeObject): collection_method: Optional[Literal["paper"]] """ @@ -286,6 +304,7 @@ class UsBankAccount(StripeObject): """ This mandate corresponds with a specific payment method type. The `payment_method_details` includes an additional hash with the same name and contains mandate information that's specific to that payment method. """ + upi: Optional[Upi] us_bank_account: Optional[UsBankAccount] _inner_class_types = { "acss_debit": AcssDebit, @@ -305,6 +324,7 @@ class UsBankAccount(StripeObject): "pix": Pix, "revolut_pay": RevolutPay, "sepa_debit": SepaDebit, + "upi": Upi, "us_bank_account": UsBankAccount, } @@ -325,7 +345,7 @@ class SingleUse(StripeObject): """ livemode: bool """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ multi_use: Optional[MultiUse] object: Literal["mandate"] diff --git a/stripe/_margin.py b/stripe/_margin.py index 4274d6974..13b898edf 100644 --- a/stripe/_margin.py +++ b/stripe/_margin.py @@ -40,7 +40,7 @@ class Margin( """ livemode: bool """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ metadata: Optional[Dict[str, str]] """ diff --git a/stripe/_object_classes.py b/stripe/_object_classes.py index 759410ddf..5c98ea973 100644 --- a/stripe/_object_classes.py +++ b/stripe/_object_classes.py @@ -246,6 +246,10 @@ "RedactionJobValidationError", ), "product": ("stripe._product", "Product"), + "product_catalog.trial_offer": ( + "stripe.product_catalog._trial_offer", + "TrialOffer", + ), "product_feature": ("stripe._product_feature", "ProductFeature"), "promotion_code": ("stripe._promotion_code", "PromotionCode"), "quote": ("stripe._quote", "Quote"), @@ -309,6 +313,7 @@ "CalculationLineItem", ), "tax.form": ("stripe.tax._form", "Form"), + "tax.location": ("stripe.tax._location", "Location"), "tax.registration": ("stripe.tax._registration", "Registration"), "tax.settings": ("stripe.tax._settings", "Settings"), "tax.transaction": ("stripe.tax._transaction", "Transaction"), @@ -433,6 +438,7 @@ "AccountPersonToken", ), "v2.core.account_token": ("stripe.v2.core._account_token", "AccountToken"), + "v2.core.batch_job": ("stripe.v2.core._batch_job", "BatchJob"), "v2.core.event": ("stripe.v2.core._event", "Event"), "v2.core.event_destination": ( "stripe.v2.core._event_destination", diff --git a/stripe/_order.py b/stripe/_order.py index 3bb569e80..5019e3abb 100644 --- a/stripe/_order.py +++ b/stripe/_order.py @@ -151,7 +151,7 @@ class MandateOptions(StripeObject): Literal["automatic", "instant", "microdeposits"] ] """ - Bank account verification method. + Bank account verification method. The default value is `automatic`. """ _inner_class_types = {"mandate_options": MandateOptions} @@ -1034,7 +1034,7 @@ class Tax(StripeObject): """ livemode: bool """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ metadata: Optional[Dict[str, str]] """ @@ -1225,7 +1225,7 @@ def submit( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/orders/{id}/submit".format( - id=sanitize_id(self.get("id")) + id=sanitize_id(self._data.get("id")) ), params=params, ), @@ -1278,7 +1278,7 @@ async def submit_async( # pyright: ignore[reportGeneralTypeIssues] await self._request_async( "post", "/v1/orders/{id}/submit".format( - id=sanitize_id(self.get("id")) + id=sanitize_id(self._data.get("id")) ), params=params, ), diff --git a/stripe/_payment_attempt_record.py b/stripe/_payment_attempt_record.py index 04dd142b7..d10e7eabc 100644 --- a/stripe/_payment_attempt_record.py +++ b/stripe/_payment_attempt_record.py @@ -487,6 +487,24 @@ class ThreeDSecure(StripeObject): """ For authenticated transactions: Indicates how the issuing bank authenticated the customer. """ + cryptogram: Optional[str] + """ + The 3D Secure cryptogram, also known as the "authentication value" (AAV, CAVV or AEVV). + """ + electronic_commerce_indicator: Optional[ + Literal["01", "02", "03", "04", "05", "06", "07"] + ] + """ + The Electronic Commerce Indicator (ECI). A protocol-level field indicating what degree of authentication was performed. + """ + exemption_indicator: Optional[Literal["low_risk", "none"]] + """ + The exemption requested via 3DS and accepted by the issuer at authentication time. + """ + exemption_indicator_applied: Optional[bool] + """ + Whether Stripe requested the value of `exemption_indicator` in the transaction. This will depend on the outcome of Stripe's internal risk assessment. + """ result: Optional[ Literal[ "attempt_acknowledged", @@ -548,19 +566,21 @@ class GooglePay(StripeObject): """ The authorization code of the payment. """ - brand: Literal[ - "amex", - "cartes_bancaires", - "diners", - "discover", - "eftpos_au", - "interac", - "jcb", - "link", - "mastercard", - "unionpay", - "unknown", - "visa", + brand: Optional[ + Literal[ + "amex", + "cartes_bancaires", + "diners", + "discover", + "eftpos_au", + "interac", + "jcb", + "link", + "mastercard", + "unionpay", + "unknown", + "visa", + ] ] """ Card brand. Can be `amex`, `cartes_bancaires`, `diners`, `discover`, `eftpos_au`, `jcb`, `link`, `mastercard`, `unionpay`, `visa` or `unknown`. @@ -581,11 +601,11 @@ class GooglePay(StripeObject): """ A high-level description of the type of cards issued in this range. """ - exp_month: int + exp_month: Optional[int] """ Two-digit number representing the card's expiration month. """ - exp_year: int + exp_year: Optional[int] """ Four-digit number representing the card's expiration year. """ @@ -595,7 +615,7 @@ class GooglePay(StripeObject): *As of May 1, 2021, card fingerprint in India for Connect changed to allow two fingerprints for the same card---one for India and one for the rest of the world.* """ - funding: Literal["credit", "debit", "prepaid", "unknown"] + funding: Optional[Literal["credit", "debit", "prepaid", "unknown"]] """ Card funding type. Can be `credit`, `debit`, `prepaid`, or `unknown`. """ @@ -611,7 +631,7 @@ class GooglePay(StripeObject): """ The name of the card's issuing bank. """ - last4: str + last4: Optional[str] """ The last four digits of the card. """ @@ -875,7 +895,9 @@ class Crypto(StripeObject): """ The wallet address of the customer. """ - network: Optional[Literal["base", "ethereum", "polygon", "solana"]] + network: Optional[ + Literal["base", "ethereum", "polygon", "solana", "tempo"] + ] """ The blockchain network that the transaction was sent on. """ @@ -1104,8 +1126,7 @@ class Ideal(StripeObject): """ verified_name: Optional[str] """ - Owner's verified full name. Values are verified or provided by iDEAL directly - (if supported) at the time of authorization or settlement. They cannot be set or mutated. + Owner's verified full name. Values are verified or provided by iDEAL directly (if supported) at the time of authorization or settlement. They cannot be set or mutated. """ class InteracPresent(StripeObject): @@ -1815,13 +1836,11 @@ class Sofort(StripeObject): Literal["de", "en", "es", "fr", "it", "nl", "pl"] ] """ - Preferred language of the SOFORT authorization page that the customer is redirected to. - Can be one of `de`, `en`, `es`, `fr`, `it`, `nl`, or `pl` + Preferred language of the SOFORT authorization page that the customer is redirected to. Can be one of `de`, `en`, `es`, `fr`, `it`, `nl`, or `pl` """ verified_name: Optional[str] """ - Owner's verified full name. Values are verified or provided by SOFORT directly - (if supported) at the time of authorization or settlement. They cannot be set or mutated. + Owner's verified full name. Values are verified or provided by SOFORT directly (if supported) at the time of authorization or settlement. They cannot be set or mutated. """ class StripeAccount(StripeObject): @@ -1832,10 +1851,6 @@ class StripeBalance(StripeObject): """ The connected account ID whose Stripe balance to use as the source of payment """ - source_type: Optional[Literal["bank_account", "card", "fpx"]] - """ - The [source_type](https://docs.stripe.com/api/balance/balance_object#balance_object-available-source_types) of the balance - """ class Swish(StripeObject): fingerprint: Optional[str] @@ -1854,6 +1869,12 @@ class Swish(StripeObject): class Twint(StripeObject): pass + class Upi(StripeObject): + vpa: Optional[str] + """ + Customer's unique Virtual Payment Address. + """ + class UsBankAccount(StripeObject): account_holder_type: Optional[Literal["company", "individual"]] """ @@ -1999,6 +2020,7 @@ class Zip(StripeObject): An additional hash is included on `payment_method_details` with a name matching this value. It contains information specific to the payment method. """ + upi: Optional[Upi] us_bank_account: Optional[UsBankAccount] wechat: Optional[Wechat] wechat_pay: Optional[WechatPay] @@ -2066,6 +2088,7 @@ class Zip(StripeObject): "stripe_balance": StripeBalance, "swish": Swish, "twint": Twint, + "upi": Upi, "us_bank_account": UsBankAccount, "wechat": Wechat, "wechat_pay": WechatPay, @@ -2186,7 +2209,7 @@ class Address(StripeObject): """ livemode: bool """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ metadata: Dict[str, str] """ diff --git a/stripe/_payment_intent.py b/stripe/_payment_intent.py index f56731516..3d89c7e93 100644 --- a/stripe/_payment_intent.py +++ b/stripe/_payment_intent.py @@ -135,6 +135,26 @@ class Shipping(StripeObject): If a physical good is being shipped, the postal code of where it is being shipped to. At most 10 alphanumeric characters long, hyphens are allowed. """ + class Surcharge(StripeObject): + amount: Optional[int] + """ + Portion of the amount that corresponds to a surcharge. + """ + enforce_validation: Optional[ + Literal["automatic", "disabled", "enabled"] + ] + """ + Indicate whether to enforce validations on the surcharge amount. + """ + maximum_amount: Optional[int] + """ + The maximum amount allowed for the surcharge. + """ + status: Optional[str] + """ + The status of the surcharge. + """ + class Tax(StripeObject): total_tax_amount: Optional[int] """ @@ -161,11 +181,13 @@ class Tip(StripeObject): A list of line items, each containing information about a product in the PaymentIntent. There is a maximum of 200 line items. """ shipping: Optional[Shipping] + surcharge: Optional[Surcharge] tax: Optional[Tax] tip: Optional[Tip] _inner_class_types = { "error": Error, "shipping": Shipping, + "surcharge": Surcharge, "tax": Tax, "tip": Tip, } @@ -375,6 +397,7 @@ class LastPaymentError(StripeObject): "secret_key_required", "sensitive_data_access_expired", "sepa_unsupported_account", + "service_period_coupon_with_metered_tiered_item_unsupported", "setup_attempt_failed", "setup_intent_authentication_failure", "setup_intent_invalid_parameter", @@ -1350,6 +1373,28 @@ class QrCode(StripeObject): qr_code: QrCode _inner_class_types = {"qr_code": QrCode} + class UpiHandleRedirectOrDisplayQrCode(StripeObject): + class QrCode(StripeObject): + expires_at: int + """ + The date (unix timestamp) when the QR code expires. + """ + image_url_png: str + """ + The image_url_png string used to render QR code + """ + image_url_svg: str + """ + The image_url_svg string used to render QR code + """ + + hosted_instructions_url: str + """ + The URL to the hosted UPI instructions page, which allows customers to view the QR code. + """ + qr_code: QrCode + _inner_class_types = {"qr_code": QrCode} + class VerifyWithMicrodeposits(StripeObject): arrival_date: int """ @@ -1445,6 +1490,9 @@ class WechatPayRedirectToIosApp(StripeObject): """ Type of the next action to perform. Refer to the other child attributes under `next_action` for available values. Examples include: `redirect_to_url`, `use_stripe_sdk`, `alipay_handle_redirect`, `oxxo_display_details`, or `verify_with_microdeposits`. """ + upi_handle_redirect_or_display_qr_code: Optional[ + UpiHandleRedirectOrDisplayQrCode + ] use_stripe_sdk: Optional[Dict[str, Any]] """ When confirming a PaymentIntent with Stripe.js, Stripe.js depends on the contents of this dictionary to invoke authentication flows. The shape of the contents is subject to change and is only intended to be used by Stripe.js. @@ -1469,6 +1517,7 @@ class WechatPayRedirectToIosApp(StripeObject): "promptpay_display_qr_code": PromptpayDisplayQrCode, "redirect_to_url": RedirectToUrl, "swish_handle_redirect_or_display_qr_code": SwishHandleRedirectOrDisplayQrCode, + "upi_handle_redirect_or_display_qr_code": UpiHandleRedirectOrDisplayQrCode, "verify_with_microdeposits": VerifyWithMicrodeposits, "wechat_pay_display_qr_code": WechatPayDisplayQrCode, "wechat_pay_redirect_to_android_app": WechatPayRedirectToAndroidApp, @@ -2800,7 +2849,7 @@ class MandateOptions(StripeObject): Literal["automatic", "instant", "microdeposits"] ] """ - Bank account verification method. + Bank account verification method. The default value is `automatic`. """ _inner_class_types = {"mandate_options": MandateOptions} @@ -3027,7 +3076,7 @@ class Plan(StripeObject): class MandateOptions(StripeObject): amount: int """ - Amount to be charged for future payments. + Amount to be charged for future payments, specified in the presentment currency. """ amount_type: Literal["fixed", "maximum"] """ @@ -3999,6 +4048,18 @@ class Twint(StripeObject): 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 Upi(StripeObject): + setup_future_usage: Optional[Literal["off_session", "on_session"]] + """ + 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 UsBankAccount(StripeObject): class FinancialConnections(StripeObject): class Filters(StripeObject): @@ -4064,12 +4125,6 @@ class MandateOptions(StripeObject): financial_connections: Optional[FinancialConnections] mandate_options: Optional[MandateOptions] - preferred_settlement_speed: Optional[ - Literal["fastest", "standard"] - ] - """ - Preferred transaction settlement speed - """ setup_future_usage: Optional[ Literal["none", "off_session", "on_session"] ] @@ -4096,7 +4151,7 @@ class MandateOptions(StripeObject): Literal["automatic", "instant", "microdeposits"] ] """ - Bank account verification method. + Bank account verification method. The default value is `automatic`. """ _inner_class_types = { "financial_connections": FinancialConnections, @@ -4191,6 +4246,7 @@ class Zip(StripeObject): stripe_balance: Optional[StripeBalance] swish: Optional[Swish] twint: Optional[Twint] + upi: Optional[Upi] us_bank_account: Optional[UsBankAccount] wechat_pay: Optional[WechatPay] zip: Optional[Zip] @@ -4251,6 +4307,7 @@ class Zip(StripeObject): "stripe_balance": StripeBalance, "swish": Swish, "twint": Twint, + "upi": Upi, "us_bank_account": UsBankAccount, "wechat_pay": WechatPay, "zip": Zip, @@ -4493,6 +4550,7 @@ class TransferData(StripeObject): "stripe_balance", "swish", "twint", + "upi", "us_bank_account", "wechat_pay", "zip", @@ -4521,7 +4579,7 @@ class TransferData(StripeObject): """ livemode: bool """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ managed_payments: Optional[ManagedPayments] """ @@ -4685,7 +4743,7 @@ def apply_customer_balance( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/payment_intents/{intent}/apply_customer_balance".format( - intent=sanitize_id(self.get("id")) + intent=sanitize_id(self._data.get("id")) ), params=params, ), @@ -4743,7 +4801,7 @@ async def apply_customer_balance_async( # pyright: ignore[reportGeneralTypeIssu await self._request_async( "post", "/v1/payment_intents/{intent}/apply_customer_balance".format( - intent=sanitize_id(self.get("id")) + intent=sanitize_id(self._data.get("id")) ), params=params, ), @@ -4758,7 +4816,7 @@ def _cls_cancel( After it's canceled, no additional charges are made by the PaymentIntent and any operations on the PaymentIntent fail with an error. For PaymentIntents with a status of requires_capture, the remaining amount_capturable is automatically refunded. - You can't cancel the PaymentIntent for a Checkout Session. [Expire the Checkout Session](https://docs.stripe.com/docs/api/checkout/sessions/expire) instead. + You can directly cancel the PaymentIntent for a Checkout Session only when the PaymentIntent has a status of requires_capture. Otherwise, you must [expire the Checkout Session](https://docs.stripe.com/docs/api/checkout/sessions/expire). """ return cast( "PaymentIntent", @@ -4781,7 +4839,7 @@ def cancel( After it's canceled, no additional charges are made by the PaymentIntent and any operations on the PaymentIntent fail with an error. For PaymentIntents with a status of requires_capture, the remaining amount_capturable is automatically refunded. - You can't cancel the PaymentIntent for a Checkout Session. [Expire the Checkout Session](https://docs.stripe.com/docs/api/checkout/sessions/expire) instead. + You can directly cancel the PaymentIntent for a Checkout Session only when the PaymentIntent has a status of requires_capture. Otherwise, you must [expire the Checkout Session](https://docs.stripe.com/docs/api/checkout/sessions/expire). """ ... @@ -4794,7 +4852,7 @@ def cancel( After it's canceled, no additional charges are made by the PaymentIntent and any operations on the PaymentIntent fail with an error. For PaymentIntents with a status of requires_capture, the remaining amount_capturable is automatically refunded. - You can't cancel the PaymentIntent for a Checkout Session. [Expire the Checkout Session](https://docs.stripe.com/docs/api/checkout/sessions/expire) instead. + You can directly cancel the PaymentIntent for a Checkout Session only when the PaymentIntent has a status of requires_capture. Otherwise, you must [expire the Checkout Session](https://docs.stripe.com/docs/api/checkout/sessions/expire). """ ... @@ -4807,14 +4865,14 @@ def cancel( # pyright: ignore[reportGeneralTypeIssues] After it's canceled, no additional charges are made by the PaymentIntent and any operations on the PaymentIntent fail with an error. For PaymentIntents with a status of requires_capture, the remaining amount_capturable is automatically refunded. - You can't cancel the PaymentIntent for a Checkout Session. [Expire the Checkout Session](https://docs.stripe.com/docs/api/checkout/sessions/expire) instead. + You can directly cancel the PaymentIntent for a Checkout Session only when the PaymentIntent has a status of requires_capture. Otherwise, you must [expire the Checkout Session](https://docs.stripe.com/docs/api/checkout/sessions/expire). """ return cast( "PaymentIntent", self._request( "post", "/v1/payment_intents/{intent}/cancel".format( - intent=sanitize_id(self.get("id")) + intent=sanitize_id(self._data.get("id")) ), params=params, ), @@ -4829,7 +4887,7 @@ async def _cls_cancel_async( After it's canceled, no additional charges are made by the PaymentIntent and any operations on the PaymentIntent fail with an error. For PaymentIntents with a status of requires_capture, the remaining amount_capturable is automatically refunded. - You can't cancel the PaymentIntent for a Checkout Session. [Expire the Checkout Session](https://docs.stripe.com/docs/api/checkout/sessions/expire) instead. + You can directly cancel the PaymentIntent for a Checkout Session only when the PaymentIntent has a status of requires_capture. Otherwise, you must [expire the Checkout Session](https://docs.stripe.com/docs/api/checkout/sessions/expire). """ return cast( "PaymentIntent", @@ -4852,7 +4910,7 @@ async def cancel_async( After it's canceled, no additional charges are made by the PaymentIntent and any operations on the PaymentIntent fail with an error. For PaymentIntents with a status of requires_capture, the remaining amount_capturable is automatically refunded. - You can't cancel the PaymentIntent for a Checkout Session. [Expire the Checkout Session](https://docs.stripe.com/docs/api/checkout/sessions/expire) instead. + You can directly cancel the PaymentIntent for a Checkout Session only when the PaymentIntent has a status of requires_capture. Otherwise, you must [expire the Checkout Session](https://docs.stripe.com/docs/api/checkout/sessions/expire). """ ... @@ -4865,7 +4923,7 @@ async def cancel_async( After it's canceled, no additional charges are made by the PaymentIntent and any operations on the PaymentIntent fail with an error. For PaymentIntents with a status of requires_capture, the remaining amount_capturable is automatically refunded. - You can't cancel the PaymentIntent for a Checkout Session. [Expire the Checkout Session](https://docs.stripe.com/docs/api/checkout/sessions/expire) instead. + You can directly cancel the PaymentIntent for a Checkout Session only when the PaymentIntent has a status of requires_capture. Otherwise, you must [expire the Checkout Session](https://docs.stripe.com/docs/api/checkout/sessions/expire). """ ... @@ -4878,14 +4936,14 @@ async def cancel_async( # pyright: ignore[reportGeneralTypeIssues] After it's canceled, no additional charges are made by the PaymentIntent and any operations on the PaymentIntent fail with an error. For PaymentIntents with a status of requires_capture, the remaining amount_capturable is automatically refunded. - You can't cancel the PaymentIntent for a Checkout Session. [Expire the Checkout Session](https://docs.stripe.com/docs/api/checkout/sessions/expire) instead. + You can directly cancel the PaymentIntent for a Checkout Session only when the PaymentIntent has a status of requires_capture. Otherwise, you must [expire the Checkout Session](https://docs.stripe.com/docs/api/checkout/sessions/expire). """ return cast( "PaymentIntent", await self._request_async( "post", "/v1/payment_intents/{intent}/cancel".format( - intent=sanitize_id(self.get("id")) + intent=sanitize_id(self._data.get("id")) ), params=params, ), @@ -4956,7 +5014,7 @@ def capture( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/payment_intents/{intent}/capture".format( - intent=sanitize_id(self.get("id")) + intent=sanitize_id(self._data.get("id")) ), params=params, ), @@ -5027,7 +5085,7 @@ async def capture_async( # pyright: ignore[reportGeneralTypeIssues] await self._request_async( "post", "/v1/payment_intents/{intent}/capture".format( - intent=sanitize_id(self.get("id")) + intent=sanitize_id(self._data.get("id")) ), params=params, ), @@ -5198,7 +5256,7 @@ def confirm( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/payment_intents/{intent}/confirm".format( - intent=sanitize_id(self.get("id")) + intent=sanitize_id(self._data.get("id")) ), params=params, ), @@ -5369,7 +5427,7 @@ async def confirm_async( # pyright: ignore[reportGeneralTypeIssues] await self._request_async( "post", "/v1/payment_intents/{intent}/confirm".format( - intent=sanitize_id(self.get("id")) + intent=sanitize_id(self._data.get("id")) ), params=params, ), @@ -5537,7 +5595,7 @@ def decrement_authorization( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/payment_intents/{intent}/decrement_authorization".format( - intent=sanitize_id(self.get("id")) + intent=sanitize_id(self._data.get("id")) ), params=params, ), @@ -5655,7 +5713,7 @@ async def decrement_authorization_async( # pyright: ignore[reportGeneralTypeIss await self._request_async( "post", "/v1/payment_intents/{intent}/decrement_authorization".format( - intent=sanitize_id(self.get("id")) + intent=sanitize_id(self._data.get("id")) ), params=params, ), @@ -5805,7 +5863,7 @@ def increment_authorization( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/payment_intents/{intent}/increment_authorization".format( - intent=sanitize_id(self.get("id")) + intent=sanitize_id(self._data.get("id")) ), params=params, ), @@ -5955,7 +6013,7 @@ async def increment_authorization_async( # pyright: ignore[reportGeneralTypeIss await self._request_async( "post", "/v1/payment_intents/{intent}/increment_authorization".format( - intent=sanitize_id(self.get("id")) + intent=sanitize_id(self._data.get("id")) ), params=params, ), @@ -6126,7 +6184,7 @@ def trigger_action( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/test/payment_intents/{intent}/trigger_action".format( - intent=sanitize_id(self.get("id")) + intent=sanitize_id(self._data.get("id")) ), params=params, ), @@ -6181,7 +6239,7 @@ async def trigger_action_async( # pyright: ignore[reportGeneralTypeIssues] await self._request_async( "post", "/v1/test/payment_intents/{intent}/trigger_action".format( - intent=sanitize_id(self.get("id")) + intent=sanitize_id(self._data.get("id")) ), params=params, ), @@ -6238,7 +6296,7 @@ def verify_microdeposits( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/payment_intents/{intent}/verify_microdeposits".format( - intent=sanitize_id(self.get("id")) + intent=sanitize_id(self._data.get("id")) ), params=params, ), @@ -6295,7 +6353,7 @@ async def verify_microdeposits_async( # pyright: ignore[reportGeneralTypeIssues await self._request_async( "post", "/v1/payment_intents/{intent}/verify_microdeposits".format( - intent=sanitize_id(self.get("id")) + intent=sanitize_id(self._data.get("id")) ), params=params, ), diff --git a/stripe/_payment_intent_service.py b/stripe/_payment_intent_service.py index a0830c214..0085ea28a 100644 --- a/stripe/_payment_intent_service.py +++ b/stripe/_payment_intent_service.py @@ -385,7 +385,7 @@ def cancel( After it's canceled, no additional charges are made by the PaymentIntent and any operations on the PaymentIntent fail with an error. For PaymentIntents with a status of requires_capture, the remaining amount_capturable is automatically refunded. - You can't cancel the PaymentIntent for a Checkout Session. [Expire the Checkout Session](https://docs.stripe.com/docs/api/checkout/sessions/expire) instead. + You can directly cancel the PaymentIntent for a Checkout Session only when the PaymentIntent has a status of requires_capture. Otherwise, you must [expire the Checkout Session](https://docs.stripe.com/docs/api/checkout/sessions/expire). """ return cast( "PaymentIntent", @@ -411,7 +411,7 @@ async def cancel_async( After it's canceled, no additional charges are made by the PaymentIntent and any operations on the PaymentIntent fail with an error. For PaymentIntents with a status of requires_capture, the remaining amount_capturable is automatically refunded. - You can't cancel the PaymentIntent for a Checkout Session. [Expire the Checkout Session](https://docs.stripe.com/docs/api/checkout/sessions/expire) instead. + You can directly cancel the PaymentIntent for a Checkout Session only when the PaymentIntent has a status of requires_capture. Otherwise, you must [expire the Checkout Session](https://docs.stripe.com/docs/api/checkout/sessions/expire). """ return cast( "PaymentIntent", diff --git a/stripe/_payment_link.py b/stripe/_payment_link.py index a2003441f..49fa9f656 100644 --- a/stripe/_payment_link.py +++ b/stripe/_payment_link.py @@ -323,6 +323,12 @@ class RenderingOptions(StripeObject): """ _inner_class_types = {"invoice_data": InvoiceData} + class ManagedPayments(StripeObject): + enabled: bool + """ + Set to `true` to enable [Managed Payments](https://docs.stripe.com/payments/managed-payments), Stripe's merchant of record solution, for this session. + """ + class NameCollection(StripeObject): class Business(StripeObject): enabled: bool @@ -807,7 +813,11 @@ class TransferData(StripeObject): """ livemode: bool """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. + """ + managed_payments: Optional[ManagedPayments] + """ + Settings for Managed Payments for this Payment Link and resulting [CheckoutSessions](https://docs.stripe.com/api/checkout/sessions/object), [PaymentIntents](https://docs.stripe.com/api/payment_intents/object), [Invoices](https://docs.stripe.com/api/invoices/object), and [Subscriptions](https://docs.stripe.com/api/subscriptions/object). """ metadata: Dict[str, str] """ @@ -878,6 +888,7 @@ class TransferData(StripeObject): "sofort", "swish", "twint", + "upi", "us_bank_account", "wechat_pay", "zip", @@ -1041,7 +1052,7 @@ def list_line_items( # pyright: ignore[reportGeneralTypeIssues] self._request( "get", "/v1/payment_links/{payment_link}/line_items".format( - payment_link=sanitize_id(self.get("id")) + payment_link=sanitize_id(self._data.get("id")) ), params=params, ), @@ -1098,7 +1109,7 @@ async def list_line_items_async( # pyright: ignore[reportGeneralTypeIssues] await self._request_async( "get", "/v1/payment_links/{payment_link}/line_items".format( - payment_link=sanitize_id(self.get("id")) + payment_link=sanitize_id(self._data.get("id")) ), params=params, ), @@ -1167,6 +1178,7 @@ async def retrieve_async( "custom_fields": CustomField, "custom_text": CustomText, "invoice_creation": InvoiceCreation, + "managed_payments": ManagedPayments, "name_collection": NameCollection, "optional_items": OptionalItem, "payment_intent_data": PaymentIntentData, diff --git a/stripe/_payment_method.py b/stripe/_payment_method.py index 0c386c03e..486d0a09e 100644 --- a/stripe/_payment_method.py +++ b/stripe/_payment_method.py @@ -1362,10 +1362,6 @@ class StripeBalance(StripeObject): """ The connected account ID whose Stripe balance to use as the source of payment """ - source_type: Optional[Literal["bank_account", "card", "fpx"]] - """ - The [source_type](https://docs.stripe.com/api/balance/balance_object#balance_object-available-source_types) of the balance - """ class Swish(StripeObject): pass @@ -1373,6 +1369,12 @@ class Swish(StripeObject): class Twint(StripeObject): pass + class Upi(StripeObject): + vpa: Optional[str] + """ + Customer's unique Virtual Payment Address + """ + class UsBankAccount(StripeObject): class Networks(StripeObject): preferred: Optional[str] @@ -1529,7 +1531,7 @@ class Zip(StripeObject): link: Optional[Link] livemode: bool """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ mb_way: Optional[MbWay] metadata: Optional[Dict[str, str]] @@ -1627,6 +1629,7 @@ class Zip(StripeObject): "stripe_balance", "swish", "twint", + "upi", "us_bank_account", "wechat_pay", "zip", @@ -1634,6 +1637,7 @@ class Zip(StripeObject): """ 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. """ + upi: Optional[Upi] us_bank_account: Optional[UsBankAccount] wechat_pay: Optional[WechatPay] zip: Optional[Zip] @@ -1735,7 +1739,7 @@ def attach( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/payment_methods/{payment_method}/attach".format( - payment_method=sanitize_id(self.get("id")) + payment_method=sanitize_id(self._data.get("id")) ), params=params, ), @@ -1838,7 +1842,7 @@ async def attach_async( # pyright: ignore[reportGeneralTypeIssues] await self._request_async( "post", "/v1/payment_methods/{payment_method}/attach".format( - payment_method=sanitize_id(self.get("id")) + payment_method=sanitize_id(self._data.get("id")) ), params=params, ), @@ -1929,7 +1933,7 @@ def detach( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/payment_methods/{payment_method}/detach".format( - payment_method=sanitize_id(self.get("id")) + payment_method=sanitize_id(self._data.get("id")) ), params=params, ), @@ -1984,7 +1988,7 @@ async def detach_async( # pyright: ignore[reportGeneralTypeIssues] await self._request_async( "post", "/v1/payment_methods/{payment_method}/detach".format( - payment_method=sanitize_id(self.get("id")) + payment_method=sanitize_id(self._data.get("id")) ), params=params, ), @@ -2146,6 +2150,7 @@ async def retrieve_async( "stripe_balance": StripeBalance, "swish": Swish, "twint": Twint, + "upi": Upi, "us_bank_account": UsBankAccount, "wechat_pay": WechatPay, "zip": Zip, diff --git a/stripe/_payment_method_configuration.py b/stripe/_payment_method_configuration.py index 3dfffb0de..1383d1f66 100644 --- a/stripe/_payment_method_configuration.py +++ b/stripe/_payment_method_configuration.py @@ -1282,6 +1282,28 @@ class DisplayPreference(StripeObject): display_preference: DisplayPreference _inner_class_types = {"display_preference": DisplayPreference} + class Upi(StripeObject): + class DisplayPreference(StripeObject): + overridable: Optional[bool] + """ + For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. + """ + preference: Literal["none", "off", "on"] + """ + The account's display preference. + """ + value: Literal["off", "on"] + """ + The effective display preference value. + """ + + available: bool + """ + Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. + """ + display_preference: DisplayPreference + _inner_class_types = {"display_preference": DisplayPreference} + class UsBankAccount(StripeObject): class DisplayPreference(StripeObject): overridable: Optional[bool] @@ -1398,7 +1420,7 @@ class DisplayPreference(StripeObject): link: Optional[Link] livemode: bool """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ mb_way: Optional[MbWay] mobilepay: Optional[Mobilepay] @@ -1436,6 +1458,7 @@ class DisplayPreference(StripeObject): sofort: Optional[Sofort] swish: Optional[Swish] twint: Optional[Twint] + upi: Optional[Upi] us_bank_account: Optional[UsBankAccount] wechat_pay: Optional[WechatPay] zip: Optional[Zip] @@ -1633,6 +1656,7 @@ async def retrieve_async( "sofort": Sofort, "swish": Swish, "twint": Twint, + "upi": Upi, "us_bank_account": UsBankAccount, "wechat_pay": WechatPay, "zip": Zip, diff --git a/stripe/_payment_method_domain.py b/stripe/_payment_method_domain.py index c60a1c116..2921bcdb3 100644 --- a/stripe/_payment_method_domain.py +++ b/stripe/_payment_method_domain.py @@ -183,7 +183,7 @@ class StatusDetails(StripeObject): """ livemode: bool """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ object: Literal["payment_method_domain"] """ @@ -394,7 +394,7 @@ def validate( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/payment_method_domains/{payment_method_domain}/validate".format( - payment_method_domain=sanitize_id(self.get("id")) + payment_method_domain=sanitize_id(self._data.get("id")) ), params=params, ), @@ -472,7 +472,7 @@ async def validate_async( # pyright: ignore[reportGeneralTypeIssues] await self._request_async( "post", "/v1/payment_method_domains/{payment_method_domain}/validate".format( - payment_method_domain=sanitize_id(self.get("id")) + payment_method_domain=sanitize_id(self._data.get("id")) ), params=params, ), diff --git a/stripe/_payment_record.py b/stripe/_payment_record.py index 20e88100e..8c668286c 100644 --- a/stripe/_payment_record.py +++ b/stripe/_payment_record.py @@ -503,6 +503,24 @@ class ThreeDSecure(StripeObject): """ For authenticated transactions: Indicates how the issuing bank authenticated the customer. """ + cryptogram: Optional[str] + """ + The 3D Secure cryptogram, also known as the "authentication value" (AAV, CAVV or AEVV). + """ + electronic_commerce_indicator: Optional[ + Literal["01", "02", "03", "04", "05", "06", "07"] + ] + """ + The Electronic Commerce Indicator (ECI). A protocol-level field indicating what degree of authentication was performed. + """ + exemption_indicator: Optional[Literal["low_risk", "none"]] + """ + The exemption requested via 3DS and accepted by the issuer at authentication time. + """ + exemption_indicator_applied: Optional[bool] + """ + Whether Stripe requested the value of `exemption_indicator` in the transaction. This will depend on the outcome of Stripe's internal risk assessment. + """ result: Optional[ Literal[ "attempt_acknowledged", @@ -564,19 +582,21 @@ class GooglePay(StripeObject): """ The authorization code of the payment. """ - brand: Literal[ - "amex", - "cartes_bancaires", - "diners", - "discover", - "eftpos_au", - "interac", - "jcb", - "link", - "mastercard", - "unionpay", - "unknown", - "visa", + brand: Optional[ + Literal[ + "amex", + "cartes_bancaires", + "diners", + "discover", + "eftpos_au", + "interac", + "jcb", + "link", + "mastercard", + "unionpay", + "unknown", + "visa", + ] ] """ Card brand. Can be `amex`, `cartes_bancaires`, `diners`, `discover`, `eftpos_au`, `jcb`, `link`, `mastercard`, `unionpay`, `visa` or `unknown`. @@ -597,11 +617,11 @@ class GooglePay(StripeObject): """ A high-level description of the type of cards issued in this range. """ - exp_month: int + exp_month: Optional[int] """ Two-digit number representing the card's expiration month. """ - exp_year: int + exp_year: Optional[int] """ Four-digit number representing the card's expiration year. """ @@ -611,7 +631,7 @@ class GooglePay(StripeObject): *As of May 1, 2021, card fingerprint in India for Connect changed to allow two fingerprints for the same card---one for India and one for the rest of the world.* """ - funding: Literal["credit", "debit", "prepaid", "unknown"] + funding: Optional[Literal["credit", "debit", "prepaid", "unknown"]] """ Card funding type. Can be `credit`, `debit`, `prepaid`, or `unknown`. """ @@ -627,7 +647,7 @@ class GooglePay(StripeObject): """ The name of the card's issuing bank. """ - last4: str + last4: Optional[str] """ The last four digits of the card. """ @@ -891,7 +911,9 @@ class Crypto(StripeObject): """ The wallet address of the customer. """ - network: Optional[Literal["base", "ethereum", "polygon", "solana"]] + network: Optional[ + Literal["base", "ethereum", "polygon", "solana", "tempo"] + ] """ The blockchain network that the transaction was sent on. """ @@ -1120,8 +1142,7 @@ class Ideal(StripeObject): """ verified_name: Optional[str] """ - Owner's verified full name. Values are verified or provided by iDEAL directly - (if supported) at the time of authorization or settlement. They cannot be set or mutated. + Owner's verified full name. Values are verified or provided by iDEAL directly (if supported) at the time of authorization or settlement. They cannot be set or mutated. """ class InteracPresent(StripeObject): @@ -1831,13 +1852,11 @@ class Sofort(StripeObject): Literal["de", "en", "es", "fr", "it", "nl", "pl"] ] """ - Preferred language of the SOFORT authorization page that the customer is redirected to. - Can be one of `de`, `en`, `es`, `fr`, `it`, `nl`, or `pl` + Preferred language of the SOFORT authorization page that the customer is redirected to. Can be one of `de`, `en`, `es`, `fr`, `it`, `nl`, or `pl` """ verified_name: Optional[str] """ - Owner's verified full name. Values are verified or provided by SOFORT directly - (if supported) at the time of authorization or settlement. They cannot be set or mutated. + Owner's verified full name. Values are verified or provided by SOFORT directly (if supported) at the time of authorization or settlement. They cannot be set or mutated. """ class StripeAccount(StripeObject): @@ -1848,10 +1867,6 @@ class StripeBalance(StripeObject): """ The connected account ID whose Stripe balance to use as the source of payment """ - source_type: Optional[Literal["bank_account", "card", "fpx"]] - """ - The [source_type](https://docs.stripe.com/api/balance/balance_object#balance_object-available-source_types) of the balance - """ class Swish(StripeObject): fingerprint: Optional[str] @@ -1870,6 +1885,12 @@ class Swish(StripeObject): class Twint(StripeObject): pass + class Upi(StripeObject): + vpa: Optional[str] + """ + Customer's unique Virtual Payment Address. + """ + class UsBankAccount(StripeObject): account_holder_type: Optional[Literal["company", "individual"]] """ @@ -2015,6 +2036,7 @@ class Zip(StripeObject): An additional hash is included on `payment_method_details` with a name matching this value. It contains information specific to the payment method. """ + upi: Optional[Upi] us_bank_account: Optional[UsBankAccount] wechat: Optional[Wechat] wechat_pay: Optional[WechatPay] @@ -2082,6 +2104,7 @@ class Zip(StripeObject): "stripe_balance": StripeBalance, "swish": Swish, "twint": Twint, + "upi": Upi, "us_bank_account": UsBankAccount, "wechat": Wechat, "wechat_pay": WechatPay, @@ -2206,7 +2229,7 @@ class Address(StripeObject): """ livemode: bool """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ metadata: Dict[str, str] """ @@ -2324,7 +2347,7 @@ def report_payment_attempt( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/payment_records/{id}/report_payment_attempt".format( - id=sanitize_id(self.get("id")) + id=sanitize_id(self._data.get("id")) ), params=params, ), @@ -2385,7 +2408,7 @@ async def report_payment_attempt_async( # pyright: ignore[reportGeneralTypeIssu await self._request_async( "post", "/v1/payment_records/{id}/report_payment_attempt".format( - id=sanitize_id(self.get("id")) + id=sanitize_id(self._data.get("id")) ), params=params, ), @@ -2449,7 +2472,7 @@ def report_payment_attempt_canceled( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/payment_records/{id}/report_payment_attempt_canceled".format( - id=sanitize_id(self.get("id")) + id=sanitize_id(self._data.get("id")) ), params=params, ), @@ -2513,7 +2536,7 @@ async def report_payment_attempt_canceled_async( # pyright: ignore[reportGenera await self._request_async( "post", "/v1/payment_records/{id}/report_payment_attempt_canceled".format( - id=sanitize_id(self.get("id")) + id=sanitize_id(self._data.get("id")) ), params=params, ), @@ -2575,7 +2598,7 @@ def report_payment_attempt_failed( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/payment_records/{id}/report_payment_attempt_failed".format( - id=sanitize_id(self.get("id")) + id=sanitize_id(self._data.get("id")) ), params=params, ), @@ -2637,7 +2660,7 @@ async def report_payment_attempt_failed_async( # pyright: ignore[reportGeneralT await self._request_async( "post", "/v1/payment_records/{id}/report_payment_attempt_failed".format( - id=sanitize_id(self.get("id")) + id=sanitize_id(self._data.get("id")) ), params=params, ), @@ -2701,7 +2724,7 @@ def report_payment_attempt_guaranteed( # pyright: ignore[reportGeneralTypeIssue self._request( "post", "/v1/payment_records/{id}/report_payment_attempt_guaranteed".format( - id=sanitize_id(self.get("id")) + id=sanitize_id(self._data.get("id")) ), params=params, ), @@ -2765,7 +2788,7 @@ async def report_payment_attempt_guaranteed_async( # pyright: ignore[reportGene await self._request_async( "post", "/v1/payment_records/{id}/report_payment_attempt_guaranteed".format( - id=sanitize_id(self.get("id")) + id=sanitize_id(self._data.get("id")) ), params=params, ), @@ -2833,7 +2856,7 @@ def report_payment_attempt_informational( # pyright: ignore[reportGeneralTypeIs self._request( "post", "/v1/payment_records/{id}/report_payment_attempt_informational".format( - id=sanitize_id(self.get("id")) + id=sanitize_id(self._data.get("id")) ), params=params, ), @@ -2901,7 +2924,7 @@ async def report_payment_attempt_informational_async( # pyright: ignore[reportG await self._request_async( "post", "/v1/payment_records/{id}/report_payment_attempt_informational".format( - id=sanitize_id(self.get("id")) + id=sanitize_id(self._data.get("id")) ), params=params, ), @@ -2960,7 +2983,7 @@ def report_refund( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/payment_records/{id}/report_refund".format( - id=sanitize_id(self.get("id")) + id=sanitize_id(self._data.get("id")) ), params=params, ), @@ -3019,7 +3042,7 @@ async def report_refund_async( # pyright: ignore[reportGeneralTypeIssues] await self._request_async( "post", "/v1/payment_records/{id}/report_refund".format( - id=sanitize_id(self.get("id")) + id=sanitize_id(self._data.get("id")) ), params=params, ), diff --git a/stripe/_payout.py b/stripe/_payout.py index 93d1652cb..a4fc03b15 100644 --- a/stripe/_payout.py +++ b/stripe/_payout.py @@ -111,7 +111,7 @@ class TraceId(StripeObject): """ livemode: bool """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ metadata: Optional[Dict[str, str]] """ @@ -211,7 +211,7 @@ def cancel( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/payouts/{payout}/cancel".format( - payout=sanitize_id(self.get("id")) + payout=sanitize_id(self._data.get("id")) ), params=params, ), @@ -266,7 +266,7 @@ async def cancel_async( # pyright: ignore[reportGeneralTypeIssues] await self._request_async( "post", "/v1/payouts/{payout}/cancel".format( - payout=sanitize_id(self.get("id")) + payout=sanitize_id(self._data.get("id")) ), params=params, ), @@ -279,7 +279,7 @@ def create(cls, **params: Unpack["PayoutCreateParams"]) -> "Payout": If your API key is in test mode, money won't actually be sent, though every other action occurs as if you're in live mode. - If you create a manual payout on a Stripe account that uses multiple payment source types, you need to specify the source type balance that the payout draws from. The [balance object](https://docs.stripe.com/api#balance_object) details available and pending amounts by source type. + If you create a manual payout on a Stripe account that uses multiple payment source types, you need to specify the source type balance that the payout draws from. The [balance object](https://docs.stripe.com/api/balances/object) details available and pending amounts by source type. """ return cast( "Payout", @@ -299,7 +299,7 @@ async def create_async( If your API key is in test mode, money won't actually be sent, though every other action occurs as if you're in live mode. - If you create a manual payout on a Stripe account that uses multiple payment source types, you need to specify the source type balance that the payout draws from. The [balance object](https://docs.stripe.com/api#balance_object) details available and pending amounts by source type. + If you create a manual payout on a Stripe account that uses multiple payment source types, you need to specify the source type balance that the payout draws from. The [balance object](https://docs.stripe.com/api/balances/object) details available and pending amounts by source type. """ return cast( "Payout", @@ -461,7 +461,7 @@ def reverse( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/payouts/{payout}/reverse".format( - payout=sanitize_id(self.get("id")) + payout=sanitize_id(self._data.get("id")) ), params=params, ), @@ -524,7 +524,7 @@ async def reverse_async( # pyright: ignore[reportGeneralTypeIssues] await self._request_async( "post", "/v1/payouts/{payout}/reverse".format( - payout=sanitize_id(self.get("id")) + payout=sanitize_id(self._data.get("id")) ), params=params, ), diff --git a/stripe/_payout_service.py b/stripe/_payout_service.py index db8177c53..14920cc3a 100644 --- a/stripe/_payout_service.py +++ b/stripe/_payout_service.py @@ -66,7 +66,7 @@ def create( If your API key is in test mode, money won't actually be sent, though every other action occurs as if you're in live mode. - If you create a manual payout on a Stripe account that uses multiple payment source types, you need to specify the source type balance that the payout draws from. The [balance object](https://docs.stripe.com/api#balance_object) details available and pending amounts by source type. + If you create a manual payout on a Stripe account that uses multiple payment source types, you need to specify the source type balance that the payout draws from. The [balance object](https://docs.stripe.com/api/balances/object) details available and pending amounts by source type. """ return cast( "Payout", @@ -89,7 +89,7 @@ async def create_async( If your API key is in test mode, money won't actually be sent, though every other action occurs as if you're in live mode. - If you create a manual payout on a Stripe account that uses multiple payment source types, you need to specify the source type balance that the payout draws from. The [balance object](https://docs.stripe.com/api#balance_object) details available and pending amounts by source type. + If you create a manual payout on a Stripe account that uses multiple payment source types, you need to specify the source type balance that the payout draws from. The [balance object](https://docs.stripe.com/api/balances/object) details available and pending amounts by source type. """ return cast( "Payout", diff --git a/stripe/_plan.py b/stripe/_plan.py index 27ac67046..fbf1c59e2 100644 --- a/stripe/_plan.py +++ b/stripe/_plan.py @@ -113,7 +113,7 @@ class TransformUsage(StripeObject): """ livemode: bool """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ metadata: Optional[Dict[str, str]] """ diff --git a/stripe/_price.py b/stripe/_price.py index accb94295..bc50261e8 100644 --- a/stripe/_price.py +++ b/stripe/_price.py @@ -226,7 +226,7 @@ class TransformQuantity(StripeObject): """ livemode: bool """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ lookup_key: Optional[str] """ diff --git a/stripe/_product.py b/stripe/_product.py index 3eac066e0..9ebec26fe 100644 --- a/stripe/_product.py +++ b/stripe/_product.py @@ -122,7 +122,7 @@ class PackageDimensions(StripeObject): """ livemode: bool """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ marketing_features: List[MarketingFeature] """ diff --git a/stripe/_product_catalog_service.py b/stripe/_product_catalog_service.py new file mode 100644 index 000000000..dd7561b5d --- /dev/null +++ b/stripe/_product_catalog_service.py @@ -0,0 +1,38 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_service import StripeService +from importlib import import_module +from typing_extensions import TYPE_CHECKING + +if TYPE_CHECKING: + from stripe.product_catalog._trial_offer_service import TrialOfferService + +_subservices = { + "trial_offers": [ + "stripe.product_catalog._trial_offer_service", + "TrialOfferService", + ], +} + + +class ProductCatalogService(StripeService): + trial_offers: "TrialOfferService" + + def __init__(self, requestor): + super().__init__(requestor) + + def __getattr__(self, name): + try: + import_from, service = _subservices[name] + service_class = getattr( + import_module(import_from), + service, + ) + setattr( + self, + name, + service_class(self._requestor), + ) + return getattr(self, name) + except KeyError: + raise AttributeError() diff --git a/stripe/_product_feature.py b/stripe/_product_feature.py index 322a8367e..580ede870 100644 --- a/stripe/_product_feature.py +++ b/stripe/_product_feature.py @@ -30,7 +30,7 @@ class ProductFeature(StripeObject): """ livemode: bool """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ object: Literal["product_feature"] """ diff --git a/stripe/_promotion_code.py b/stripe/_promotion_code.py index 54dc7c5d0..73c9dc48a 100644 --- a/stripe/_promotion_code.py +++ b/stripe/_promotion_code.py @@ -108,7 +108,7 @@ class CurrencyOptions(StripeObject): """ livemode: bool """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ max_redemptions: Optional[int] """ diff --git a/stripe/_quote.py b/stripe/_quote.py index d8f30f474..fb878865a 100644 --- a/stripe/_quote.py +++ b/stripe/_quote.py @@ -1026,7 +1026,7 @@ class TransferData(StripeObject): """ livemode: bool """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ metadata: Dict[str, str] """ @@ -1127,7 +1127,7 @@ def accept( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/quotes/{quote}/accept".format( - quote=sanitize_id(self.get("id")) + quote=sanitize_id(self._data.get("id")) ), params=params, ), @@ -1180,7 +1180,7 @@ async def accept_async( # pyright: ignore[reportGeneralTypeIssues] await self._request_async( "post", "/v1/quotes/{quote}/accept".format( - quote=sanitize_id(self.get("id")) + quote=sanitize_id(self._data.get("id")) ), params=params, ), @@ -1229,7 +1229,7 @@ def cancel( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/quotes/{quote}/cancel".format( - quote=sanitize_id(self.get("id")) + quote=sanitize_id(self._data.get("id")) ), params=params, ), @@ -1282,7 +1282,7 @@ async def cancel_async( # pyright: ignore[reportGeneralTypeIssues] await self._request_async( "post", "/v1/quotes/{quote}/cancel".format( - quote=sanitize_id(self.get("id")) + quote=sanitize_id(self._data.get("id")) ), params=params, ), @@ -1365,7 +1365,7 @@ def finalize_quote( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/quotes/{quote}/finalize".format( - quote=sanitize_id(self.get("id")) + quote=sanitize_id(self._data.get("id")) ), params=params, ), @@ -1418,7 +1418,7 @@ async def finalize_quote_async( # pyright: ignore[reportGeneralTypeIssues] await self._request_async( "post", "/v1/quotes/{quote}/finalize".format( - quote=sanitize_id(self.get("id")) + quote=sanitize_id(self._data.get("id")) ), params=params, ), @@ -1513,7 +1513,7 @@ def list_computed_upfront_line_items( # pyright: ignore[reportGeneralTypeIssues self._request( "get", "/v1/quotes/{quote}/computed_upfront_line_items".format( - quote=sanitize_id(self.get("id")) + quote=sanitize_id(self._data.get("id")) ), params=params, ), @@ -1570,7 +1570,7 @@ async def list_computed_upfront_line_items_async( # pyright: ignore[reportGener await self._request_async( "get", "/v1/quotes/{quote}/computed_upfront_line_items".format( - quote=sanitize_id(self.get("id")) + quote=sanitize_id(self._data.get("id")) ), params=params, ), @@ -1625,7 +1625,7 @@ def list_line_items( # pyright: ignore[reportGeneralTypeIssues] self._request( "get", "/v1/quotes/{quote}/line_items".format( - quote=sanitize_id(self.get("id")) + quote=sanitize_id(self._data.get("id")) ), params=params, ), @@ -1680,7 +1680,7 @@ async def list_line_items_async( # pyright: ignore[reportGeneralTypeIssues] await self._request_async( "get", "/v1/quotes/{quote}/line_items".format( - quote=sanitize_id(self.get("id")) + quote=sanitize_id(self._data.get("id")) ), params=params, ), @@ -1733,7 +1733,7 @@ def list_lines( # pyright: ignore[reportGeneralTypeIssues] self._request( "get", "/v1/quotes/{quote}/lines".format( - quote=sanitize_id(self.get("id")) + quote=sanitize_id(self._data.get("id")) ), params=params, ), @@ -1786,7 +1786,7 @@ async def list_lines_async( # pyright: ignore[reportGeneralTypeIssues] await self._request_async( "get", "/v1/quotes/{quote}/lines".format( - quote=sanitize_id(self.get("id")) + quote=sanitize_id(self._data.get("id")) ), params=params, ), @@ -1851,7 +1851,7 @@ def list_preview_invoice_lines( # pyright: ignore[reportGeneralTypeIssues] self._request( "get", "/v1/quotes/{quote}/preview_invoices/{preview_invoice}/lines".format( - quote=sanitize_id(self.get("id")), + quote=sanitize_id(self._data.get("id")), preview_invoice=sanitize_id(preview_invoice), ), params=params, @@ -1917,7 +1917,7 @@ async def list_preview_invoice_lines_async( # pyright: ignore[reportGeneralType await self._request_async( "get", "/v1/quotes/{quote}/preview_invoices/{preview_invoice}/lines".format( - quote=sanitize_id(self.get("id")), + quote=sanitize_id(self._data.get("id")), preview_invoice=sanitize_id(preview_invoice), ), params=params, @@ -1971,7 +1971,7 @@ def mark_draft( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/quotes/{quote}/mark_draft".format( - quote=sanitize_id(self.get("id")) + quote=sanitize_id(self._data.get("id")) ), params=params, ), @@ -2026,7 +2026,7 @@ async def mark_draft_async( # pyright: ignore[reportGeneralTypeIssues] await self._request_async( "post", "/v1/quotes/{quote}/mark_draft".format( - quote=sanitize_id(self.get("id")) + quote=sanitize_id(self._data.get("id")) ), params=params, ), @@ -2079,7 +2079,7 @@ def mark_stale( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/quotes/{quote}/mark_stale".format( - quote=sanitize_id(self.get("id")) + quote=sanitize_id(self._data.get("id")) ), params=params, ), @@ -2134,7 +2134,7 @@ async def mark_stale_async( # pyright: ignore[reportGeneralTypeIssues] await self._request_async( "post", "/v1/quotes/{quote}/mark_stale".format( - quote=sanitize_id(self.get("id")) + quote=sanitize_id(self._data.get("id")) ), params=params, ), @@ -2214,7 +2214,7 @@ def pdf( # pyright: ignore[reportGeneralTypeIssues] self._request_stream( "get", "/v1/quotes/{quote}/pdf".format( - quote=sanitize_id(self.get("id")) + quote=sanitize_id(self._data.get("id")) ), params=params, base_address="files", @@ -2265,7 +2265,7 @@ async def pdf_async( # pyright: ignore[reportGeneralTypeIssues] await self._request_stream_async( "get", "/v1/quotes/{quote}/pdf".format( - quote=sanitize_id(self.get("id")) + quote=sanitize_id(self._data.get("id")) ), params=params, base_address="files", @@ -2319,7 +2319,7 @@ def reestimate( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/quotes/{quote}/reestimate".format( - quote=sanitize_id(self.get("id")) + quote=sanitize_id(self._data.get("id")) ), params=params, ), @@ -2374,7 +2374,7 @@ async def reestimate_async( # pyright: ignore[reportGeneralTypeIssues] await self._request_async( "post", "/v1/quotes/{quote}/reestimate".format( - quote=sanitize_id(self.get("id")) + quote=sanitize_id(self._data.get("id")) ), params=params, ), diff --git a/stripe/_quote_line.py b/stripe/_quote_line.py index ab6e08c99..7b1b9a190 100644 --- a/stripe/_quote_line.py +++ b/stripe/_quote_line.py @@ -114,6 +114,10 @@ class Trial(StripeObject): """ Options that configure the trial on the subscription item. """ + trial_offer: Optional[str] + """ + The ID of the trial offer to apply to the configuration item. + """ _inner_class_types = {"discounts": Discount, "trial": Trial} class RemoveDiscount(StripeObject): @@ -244,6 +248,10 @@ class Trial(StripeObject): """ Options that configure the trial on the subscription item. """ + trial_offer: Optional[str] + """ + The ID of the trial offer to apply to the configuration item. + """ _inner_class_types = {"discounts": Discount, "trial": Trial} add_discount: Optional[AddDiscount] @@ -389,7 +397,7 @@ class SetPauseCollection(StripeObject): class Set(StripeObject): behavior: Literal["keep_as_draft", "mark_uncollectible", "void"] """ - The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`. + The payment collection behavior for this subscription while paused. """ set: Optional[Set] diff --git a/stripe/_quote_preview_invoice.py b/stripe/_quote_preview_invoice.py index 27cc57fc0..ea19e08b1 100644 --- a/stripe/_quote_preview_invoice.py +++ b/stripe/_quote_preview_invoice.py @@ -559,6 +559,7 @@ class LastFinalizationError(StripeObject): "secret_key_required", "sensitive_data_access_expired", "sepa_unsupported_account", + "service_period_coupon_with_metered_tiered_item_unsupported", "setup_attempt_failed", "setup_intent_authentication_failure", "setup_intent_invalid_parameter", @@ -704,7 +705,7 @@ class PauseCollection(StripeObject): Literal["keep_as_draft", "mark_uncollectible", "void"] ] """ - The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`. + The payment collection behavior for this subscription while paused. """ resumes_at: Optional[int] """ @@ -761,7 +762,7 @@ class MandateOptions(StripeObject): Literal["automatic", "instant", "microdeposits"] ] """ - Bank account verification method. + Bank account verification method. The default value is `automatic`. """ _inner_class_types = {"mandate_options": MandateOptions} @@ -852,6 +853,10 @@ class Pix(StripeObject): """ Determines if the amount includes the IOF tax. """ + expires_after_seconds: Optional[int] + """ + The number of seconds (between 10 and 1209600) after which Pix payment will expire. Defaults to 86400 seconds. + """ class SepaDebit(StripeObject): pass @@ -926,7 +931,7 @@ class Filters(StripeObject): Literal["automatic", "instant", "microdeposits"] ] """ - Bank account verification method. + Bank account verification method. The default value is `automatic`. """ _inner_class_types = { "financial_connections": FinancialConnections, @@ -1517,7 +1522,7 @@ class TaxRateDetails(StripeObject): """ livemode: bool """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ metadata: Optional[Dict[str, str]] """ diff --git a/stripe/_quote_preview_subscription_schedule.py b/stripe/_quote_preview_subscription_schedule.py index 2ec6331b8..0ae07e4b1 100644 --- a/stripe/_quote_preview_subscription_schedule.py +++ b/stripe/_quote_preview_subscription_schedule.py @@ -458,6 +458,10 @@ class Trial(StripeObject): """ Options that configure the trial on the subscription item. """ + trial_offer: Optional[str] + """ + The ID of the trial offer to apply to the configuration item. + """ _inner_class_types = { "billing_thresholds": BillingThresholds, "discounts": Discount, @@ -467,7 +471,7 @@ class Trial(StripeObject): class PauseCollection(StripeObject): behavior: Literal["keep_as_draft", "mark_uncollectible", "void"] """ - The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`. + The payment collection behavior for this subscription while paused. """ class TransferData(StripeObject): @@ -670,7 +674,7 @@ class Prebilling(StripeObject): """ livemode: bool """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ metadata: Optional[Dict[str, str]] """ diff --git a/stripe/_refund.py b/stripe/_refund.py index d865c06af..23602b98e 100644 --- a/stripe/_refund.py +++ b/stripe/_refund.py @@ -529,7 +529,7 @@ def cancel( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/refunds/{refund}/cancel".format( - refund=sanitize_id(self.get("id")) + refund=sanitize_id(self._data.get("id")) ), params=params, ), @@ -592,7 +592,7 @@ async def cancel_async( # pyright: ignore[reportGeneralTypeIssues] await self._request_async( "post", "/v1/refunds/{refund}/cancel".format( - refund=sanitize_id(self.get("id")) + refund=sanitize_id(self._data.get("id")) ), params=params, ), @@ -798,7 +798,7 @@ def expire( # pyright: ignore[reportGeneralTypeIssues] self.resource._request( "post", "/v1/test_helpers/refunds/{refund}/expire".format( - refund=sanitize_id(self.resource.get("id")) + refund=sanitize_id(self.resource._data.get("id")) ), params=params, ), @@ -853,7 +853,7 @@ async def expire_async( # pyright: ignore[reportGeneralTypeIssues] await self.resource._request_async( "post", "/v1/test_helpers/refunds/{refund}/expire".format( - refund=sanitize_id(self.resource.get("id")) + refund=sanitize_id(self.resource._data.get("id")) ), params=params, ), diff --git a/stripe/_review.py b/stripe/_review.py index 13a14b9d4..64125061a 100644 --- a/stripe/_review.py +++ b/stripe/_review.py @@ -107,7 +107,7 @@ class Session(StripeObject): """ livemode: bool """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ object: Literal["review"] """ @@ -181,7 +181,7 @@ def approve( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/reviews/{review}/approve".format( - review=sanitize_id(self.get("id")) + review=sanitize_id(self._data.get("id")) ), params=params, ), @@ -236,7 +236,7 @@ async def approve_async( # pyright: ignore[reportGeneralTypeIssues] await self._request_async( "post", "/v1/reviews/{review}/approve".format( - review=sanitize_id(self.get("id")) + review=sanitize_id(self._data.get("id")) ), params=params, ), diff --git a/stripe/_search_result_object.py b/stripe/_search_result_object.py index 3397d439b..75dc941d2 100644 --- a/stripe/_search_result_object.py +++ b/stripe/_search_result_object.py @@ -1,5 +1,5 @@ # pyright: strict -from typing_extensions import Self, Unpack +from typing_extensions import Self, Unpack, deprecated from typing import ( Generic, List, @@ -16,7 +16,6 @@ _APIRequestor, # pyright: ignore[reportPrivateUsage] ) from stripe._stripe_object import StripeObject -from stripe import _util import warnings from stripe._request_options import RequestOptions, extract_options_from_dict from stripe._any_iterator import AnyIterator @@ -38,14 +37,14 @@ def _search(self, **params: Mapping[str, Any]) -> Self: ) def _get_url_for_search(self) -> str: - url = self.get("url") + url = self._data.get("url") if not isinstance(url, str): raise ValueError( 'Cannot call .list on a list object without a string "url" property' ) return url - @_util.deprecated( + @deprecated( "This will be removed in a future version of stripe-python. Please call the `search` method on the corresponding resource directly, instead of the generic search on SearchResultObject." ) def search(self, **params: Mapping[str, Any]) -> Self: @@ -72,7 +71,7 @@ async def _search_async(self, **params: Mapping[str, Any]) -> Self: def __getitem__(self, k: str) -> T: if isinstance(k, str): # pyright: ignore - return super(SearchResultObject, self).__getitem__(k) + return super().__getitem__(k) else: raise KeyError( "You tried to access the %s index, but SearchResultObject types " @@ -81,10 +80,7 @@ def __getitem__(self, k: str) -> T: "call .data[%s])" % (repr(k), repr(k)) ) - # Pyright doesn't like this because SearchResultObject inherits from StripeObject inherits from Dict[str, Any] - # and so it wants the type of __iter__ to agree with __iter__ from Dict[str, Any] - # But we are iterating through "data", which is a List[T]. - def __iter__(self) -> Iterator[T]: # pyright: ignore + def __iter__(self) -> Iterator[T]: return getattr(self, "data", []).__iter__() def __len__(self) -> int: diff --git a/stripe/_setup_attempt.py b/stripe/_setup_attempt.py index 174e146a5..af92db374 100644 --- a/stripe/_setup_attempt.py +++ b/stripe/_setup_attempt.py @@ -426,6 +426,9 @@ class Sofort(StripeObject): class StripeBalance(StripeObject): pass + class Upi(StripeObject): + pass + class UsBankAccount(StripeObject): pass @@ -457,6 +460,7 @@ class UsBankAccount(StripeObject): """ The type of the payment method used in the SetupIntent (e.g., `card`). An additional hash is included on `payment_method_details` with a name matching this value. It contains confirmation-specific information for the payment method. """ + upi: Optional[Upi] us_bank_account: Optional[UsBankAccount] _inner_class_types = { "acss_debit": AcssDebit, @@ -483,6 +487,7 @@ class UsBankAccount(StripeObject): "sepa_debit": SepaDebit, "sofort": Sofort, "stripe_balance": StripeBalance, + "upi": Upi, "us_bank_account": UsBankAccount, } @@ -651,6 +656,7 @@ class SetupError(StripeObject): "secret_key_required", "sensitive_data_access_expired", "sepa_unsupported_account", + "service_period_coupon_with_metered_tiered_item_unsupported", "setup_attempt_failed", "setup_intent_authentication_failure", "setup_intent_invalid_parameter", @@ -817,7 +823,7 @@ class SetupError(StripeObject): """ livemode: bool """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ object: Literal["setup_attempt"] """ diff --git a/stripe/_setup_intent.py b/stripe/_setup_intent.py index 9dd0ce1c0..64392d963 100644 --- a/stripe/_setup_intent.py +++ b/stripe/_setup_intent.py @@ -250,6 +250,7 @@ class LastSetupError(StripeObject): "secret_key_required", "sensitive_data_access_expired", "sepa_unsupported_account", + "service_period_coupon_with_metered_tiered_item_unsupported", "setup_attempt_failed", "setup_intent_authentication_failure", "setup_intent_invalid_parameter", @@ -447,6 +448,28 @@ class RedirectToUrl(StripeObject): The URL you must redirect your customer to in order to authenticate. """ + class UpiHandleRedirectOrDisplayQrCode(StripeObject): + class QrCode(StripeObject): + expires_at: int + """ + The date (unix timestamp) when the QR code expires. + """ + image_url_png: str + """ + The image_url_png string used to render QR code + """ + image_url_svg: str + """ + The image_url_svg string used to render QR code + """ + + hosted_instructions_url: str + """ + The URL to the hosted UPI instructions page, which allows customers to view the QR code. + """ + qr_code: QrCode + _inner_class_types = {"qr_code": QrCode} + class VerifyWithMicrodeposits(StripeObject): arrival_date: int """ @@ -470,6 +493,9 @@ class VerifyWithMicrodeposits(StripeObject): """ Type of the next action to perform. Refer to the other child attributes under `next_action` for available values. Examples include: `redirect_to_url`, `use_stripe_sdk`, `alipay_handle_redirect`, `oxxo_display_details`, or `verify_with_microdeposits`. """ + upi_handle_redirect_or_display_qr_code: Optional[ + UpiHandleRedirectOrDisplayQrCode + ] use_stripe_sdk: Optional[Dict[str, Any]] """ When confirming a SetupIntent with Stripe.js, Stripe.js depends on the contents of this dictionary to invoke authentication flows. The shape of the contents is subject to change and is only intended to be used by Stripe.js. @@ -479,6 +505,7 @@ class VerifyWithMicrodeposits(StripeObject): "cashapp_handle_redirect_or_display_qr_code": CashappHandleRedirectOrDisplayQrCode, "pix_display_qr_code": PixDisplayQrCode, "redirect_to_url": RedirectToUrl, + "upi_handle_redirect_or_display_qr_code": UpiHandleRedirectOrDisplayQrCode, "verify_with_microdeposits": VerifyWithMicrodeposits, } @@ -527,7 +554,7 @@ class MandateOptions(StripeObject): Literal["automatic", "instant", "microdeposits"] ] """ - Bank account verification method. + Bank account verification method. The default value is `automatic`. """ _inner_class_types = {"mandate_options": MandateOptions} @@ -548,7 +575,7 @@ class Card(StripeObject): class MandateOptions(StripeObject): amount: int """ - Amount to be charged for future payments. + Amount to be charged for future payments, specified in the presentment currency. """ amount_type: Literal["fixed", "maximum"] """ @@ -767,6 +794,28 @@ class MandateOptions(StripeObject): mandate_options: Optional[MandateOptions] _inner_class_types = {"mandate_options": MandateOptions} + class Upi(StripeObject): + class MandateOptions(StripeObject): + amount: Optional[int] + """ + Amount to be charged for future payments. + """ + amount_type: Optional[Literal["fixed", "maximum"]] + """ + One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param. + """ + description: Optional[str] + """ + A description of the mandate or subscription that is meant to be displayed to the customer. + """ + end_date: Optional[int] + """ + End date of the mandate or subscription. + """ + + mandate_options: Optional[MandateOptions] + _inner_class_types = {"mandate_options": MandateOptions} + class UsBankAccount(StripeObject): class FinancialConnections(StripeObject): class Filters(StripeObject): @@ -836,7 +885,7 @@ class MandateOptions(StripeObject): Literal["automatic", "instant", "microdeposits"] ] """ - Bank account verification method. + Bank account verification method. The default value is `automatic`. """ _inner_class_types = { "financial_connections": FinancialConnections, @@ -854,6 +903,7 @@ class MandateOptions(StripeObject): payto: Optional[Payto] pix: Optional[Pix] sepa_debit: Optional[SepaDebit] + upi: Optional[Upi] us_bank_account: Optional[UsBankAccount] _inner_class_types = { "acss_debit": AcssDebit, @@ -867,6 +917,7 @@ class MandateOptions(StripeObject): "payto": Payto, "pix": Pix, "sepa_debit": SepaDebit, + "upi": Upi, "us_bank_account": UsBankAccount, } @@ -972,6 +1023,7 @@ class MandateOptions(StripeObject): "stripe_balance", "swish", "twint", + "upi", "us_bank_account", "wechat_pay", "zip", @@ -1001,7 +1053,7 @@ class MandateOptions(StripeObject): """ livemode: bool """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ managed_payments: Optional[ManagedPayments] mandate: Optional[ExpandableField["Mandate"]] @@ -1121,7 +1173,7 @@ def cancel( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/setup_intents/{intent}/cancel".format( - intent=sanitize_id(self.get("id")) + intent=sanitize_id(self._data.get("id")) ), params=params, ), @@ -1184,7 +1236,7 @@ async def cancel_async( # pyright: ignore[reportGeneralTypeIssues] await self._request_async( "post", "/v1/setup_intents/{intent}/cancel".format( - intent=sanitize_id(self.get("id")) + intent=sanitize_id(self._data.get("id")) ), params=params, ), @@ -1291,7 +1343,7 @@ def confirm( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/setup_intents/{intent}/confirm".format( - intent=sanitize_id(self.get("id")) + intent=sanitize_id(self._data.get("id")) ), params=params, ), @@ -1398,7 +1450,7 @@ async def confirm_async( # pyright: ignore[reportGeneralTypeIssues] await self._request_async( "post", "/v1/setup_intents/{intent}/confirm".format( - intent=sanitize_id(self.get("id")) + intent=sanitize_id(self._data.get("id")) ), params=params, ), @@ -1597,7 +1649,7 @@ def verify_microdeposits( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/setup_intents/{intent}/verify_microdeposits".format( - intent=sanitize_id(self.get("id")) + intent=sanitize_id(self._data.get("id")) ), params=params, ), @@ -1654,7 +1706,7 @@ async def verify_microdeposits_async( # pyright: ignore[reportGeneralTypeIssues await self._request_async( "post", "/v1/setup_intents/{intent}/verify_microdeposits".format( - intent=sanitize_id(self.get("id")) + intent=sanitize_id(self._data.get("id")) ), params=params, ), diff --git a/stripe/_shipping_rate.py b/stripe/_shipping_rate.py index d62ef0b46..f3118d93d 100644 --- a/stripe/_shipping_rate.py +++ b/stripe/_shipping_rate.py @@ -116,7 +116,7 @@ class CurrencyOptions(StripeObject): """ livemode: bool """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ metadata: Dict[str, str] """ diff --git a/stripe/_source.py b/stripe/_source.py index b032e7d85..ca6216aa4 100644 --- a/stripe/_source.py +++ b/stripe/_source.py @@ -546,7 +546,7 @@ class Wechat(StripeObject): klarna: Optional[Klarna] livemode: bool """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ metadata: Optional[Dict[str, str]] """ @@ -690,7 +690,7 @@ def list_source_transactions( # pyright: ignore[reportGeneralTypeIssues] self._request( "get", "/v1/sources/{source}/source_transactions".format( - source=sanitize_id(self.get("id")) + source=sanitize_id(self._data.get("id")) ), params=params, ), @@ -747,7 +747,7 @@ async def list_source_transactions_async( # pyright: ignore[reportGeneralTypeIs await self._request_async( "get", "/v1/sources/{source}/source_transactions".format( - source=sanitize_id(self.get("id")) + source=sanitize_id(self._data.get("id")) ), params=params, ), @@ -860,7 +860,7 @@ def verify( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/sources/{source}/verify".format( - source=sanitize_id(self.get("id")) + source=sanitize_id(self._data.get("id")) ), params=params, ), @@ -915,7 +915,7 @@ async def verify_async( # pyright: ignore[reportGeneralTypeIssues] await self._request_async( "post", "/v1/sources/{source}/verify".format( - source=sanitize_id(self.get("id")) + source=sanitize_id(self._data.get("id")) ), params=params, ), diff --git a/stripe/_source_mandate_notification.py b/stripe/_source_mandate_notification.py index 4d99bffe1..3f5fbae43 100644 --- a/stripe/_source_mandate_notification.py +++ b/stripe/_source_mandate_notification.py @@ -61,7 +61,7 @@ class SepaDebit(StripeObject): """ livemode: bool """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ object: Literal["source_mandate_notification"] """ diff --git a/stripe/_source_transaction.py b/stripe/_source_transaction.py index c1aa0d013..52a4fc278 100644 --- a/stripe/_source_transaction.py +++ b/stripe/_source_transaction.py @@ -130,7 +130,7 @@ class SepaCreditTransfer(StripeObject): """ livemode: bool """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ object: Literal["source_transaction"] """ diff --git a/stripe/_stripe_client.py b/stripe/_stripe_client.py index 2b1e6c6ae..1ed541700 100644 --- a/stripe/_stripe_client.py +++ b/stripe/_stripe_client.py @@ -26,13 +26,13 @@ from stripe._api_version import _ApiVersion from stripe._stripe_object import StripeObject from stripe._stripe_response import StripeResponse -from stripe._util import _convert_to_stripe_object, get_api_mode, deprecated # noqa: F401 +from stripe._util import _convert_to_stripe_object, get_api_mode from stripe._webhook import Webhook, WebhookSignature from stripe._event import Event from stripe.v2.core._event import EventNotification from typing import Any, Dict, Optional, Union, cast -from typing_extensions import TYPE_CHECKING +from typing_extensions import TYPE_CHECKING, deprecated if TYPE_CHECKING: from stripe._stripe_context import StripeContext @@ -110,6 +110,7 @@ from stripe._price_service import PriceService from stripe._privacy_service import PrivacyService from stripe._product_service import ProductService + from stripe._product_catalog_service import ProductCatalogService from stripe._promotion_code_service import PromotionCodeService from stripe._quote_service import QuoteService from stripe._radar_service import RadarService @@ -960,6 +961,17 @@ def privacy(self) -> "PrivacyService": def products(self) -> "ProductService": return self.v1.products + @property + @deprecated( + """ + StripeClient.product_catalog is deprecated, use StripeClient.v1.product_catalog instead. + All functionality under it has been copied over to StripeClient.v1.product_catalog. + See [migration guide](https://github.com/stripe/stripe-python/wiki/v1-namespace-in-StripeClient) for more on this and tips on migrating to the new v1 namespace. + """, + ) + def product_catalog(self) -> "ProductCatalogService": + return self.v1.product_catalog + @property @deprecated( """ diff --git a/stripe/_stripe_object.py b/stripe/_stripe_object.py index 6ce504aa6..5109cdb29 100644 --- a/stripe/_stripe_object.py +++ b/stripe/_stripe_object.py @@ -2,7 +2,7 @@ import datetime import json from copy import deepcopy -from typing_extensions import TYPE_CHECKING, Type, Literal, Self +from typing_extensions import TYPE_CHECKING, Type, Literal, Self, deprecated from typing import ( Any, Dict, @@ -27,6 +27,7 @@ StripeStreamResponseAsync, ) from stripe._encode import _encode_datetime # pyright: ignore +from stripe._encode import _coerce_int64_string # pyright: ignore from stripe._request_options import ( PERSISTENT_OPTIONS_KEYS, extract_options_from_dict, @@ -80,7 +81,7 @@ def _serialize_list( return params -class StripeObject(Dict[str, Any]): +class StripeObject: class _ReprJSONEncoder(json.JSONEncoder): def default(self, o: Any) -> Any: if isinstance(o, datetime.datetime): @@ -102,8 +103,7 @@ def __init__( # TODO: is a more specific type possible here? **params: Any, ): - super(StripeObject, self).__init__() - + self._data: Dict[str, Any] = {} self._unsaved_values: Set[str] = set() self._transient_values: Set[str] = set() self._last_response = last_response @@ -142,15 +142,11 @@ def stripe_version(self): def last_response(self) -> Optional[StripeResponse]: return self._last_response - # StripeObject inherits from `dict` which has an update method, and this doesn't quite match - # the full signature of the update method in MutableMapping. But we ignore. - def update( # pyright: ignore - self, update_dict: Mapping[str, Any] - ) -> None: + def update(self, update_dict: Mapping[str, Any]) -> None: for k in update_dict: self._unsaved_values.add(k) - return super(StripeObject, self).update(update_dict) + self._data.update(update_dict) if not TYPE_CHECKING: @@ -197,14 +193,16 @@ def __setitem__(self, k: str, v: Any) -> None: # Allows for unpickling in Python 3.x if not hasattr(self, "_unsaved_values"): self._unsaved_values = set() + if not hasattr(self, "_data"): + self._data = {} self._unsaved_values.add(k) - super(StripeObject, self).__setitem__(k, v) + self._data[k] = v def __getitem__(self, k: str) -> Any: try: - return super(StripeObject, self).__getitem__(k) + return self._data[k] except KeyError as err: if k in self._transient_values: raise KeyError( @@ -213,7 +211,7 @@ def __getitem__(self, k: str) -> Any: "the result returned by Stripe's API, probably as a " "result of a save(). The attributes currently " "available on this object are: %s" - % (k, k, ", ".join(list(self.keys()))) + % (k, k, ", ".join(list(self._data.keys()))) ) else: from stripe._invoice import Invoice @@ -228,17 +226,26 @@ def __getitem__(self, k: str) -> Any: raise err def __delitem__(self, k: str) -> None: - super(StripeObject, self).__delitem__(k) + del self._data[k] # Allows for unpickling in Python 3.x if hasattr(self, "_unsaved_values") and k in self._unsaved_values: self._unsaved_values.remove(k) - # Custom unpickling method that uses `update` to update the dictionary + def __contains__(self, k: object) -> bool: + return k in self._data + + def __eq__(self, other: object) -> bool: + if isinstance(other, StripeObject): + return type(self) is type(other) and self._data == other._data + return NotImplemented + + # Custom unpickling method that updates _data directly # without calling __setitem__, which would fail if any value is an empty # string def __setstate__(self, state: Dict[str, Any]) -> None: - self.update(state) + self._data.update(state) + self._unsaved_values.update(state.keys()) # Custom pickling method to ensure the instance is pickled as a custom # class and not as a dict, otherwise __setstate__ would not be called when @@ -247,12 +254,12 @@ def __reduce__(self) -> Tuple[Any, ...]: reduce_value = ( type(self), # callable ( # args - self.get("id", None), + getattr(self, "id", None), self.api_key, self.stripe_version, self.stripe_account, ), - dict(self), # state + self._data.copy(), # state ) return reduce_value @@ -284,13 +291,14 @@ def construct_from( def _construct_from( cls, *, - values: Dict[str, Any], + values: "Union[Dict[str, Any], StripeObject]", last_response: Optional[StripeResponse] = None, requestor: "_APIRequestor", api_mode: ApiMode, ) -> Self: + raw = values._data if isinstance(values, StripeObject) else values instance = cls( - values.get("id"), + raw.get("id"), last_response=last_response, _requestor=requestor, ) @@ -330,7 +338,7 @@ def refresh_from( def _refresh_from( self, *, - values: Dict[str, Any], + values: "Union[Dict[str, Any], StripeObject]", partial: Optional[bool] = False, last_response: Optional[StripeResponse] = None, requestor: Optional["_APIRequestor"] = None, @@ -341,20 +349,26 @@ def _refresh_from( values, "_last_response", None ) + # When called from APIResource._request, values may be a StripeObject + if isinstance(values, StripeObject): + values = values._data + # Wipe old state before setting new. This is useful for e.g. # updating a customer, where there is no persistent card # parameter. Mark those values which don't persist as transient if partial: self._unsaved_values = self._unsaved_values - set(values) else: - removed = set(self.keys()) - set(values) + removed = set(self._data.keys()) - set(values) self._transient_values = self._transient_values | removed self._unsaved_values = set() - self.clear() + self._data.clear() self._transient_values = self._transient_values - set(values) 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) is_dict = self._get_inner_class_is_beneath_dict(k) if is_dict: @@ -384,13 +398,11 @@ def _refresh_from( api_mode=api_mode, ), ) - super(StripeObject, self).__setitem__(k, obj) + self._data[k] = obj self._previous = values - @_util.deprecated( - "This will be removed in a future version of stripe-python." - ) + @deprecated("This will be removed in a future version of stripe-python.") def request( self, method: Literal["get", "post", "delete"], @@ -496,12 +508,13 @@ async def _request_stream_async( def __repr__(self) -> str: ident_parts = [type(self).__name__] - obj_str = self.get("object") + obj_str = getattr(self, "object", None) if isinstance(obj_str, str): ident_parts.append(obj_str) - if isinstance(self.get("id"), str): - ident_parts.append("id=%s" % (self.get("id"),)) + obj_id = getattr(self, "id", None) + if isinstance(obj_id, str): + ident_parts.append("id=%s" % (obj_id,)) unicode_repr = "<%s at %s> JSON: %s" % ( " ".join(ident_parts), @@ -518,13 +531,21 @@ def __str__(self) -> str: cls=self._ReprJSONEncoder, ) - @_util.deprecated( - "Deprecated. The public interface will be removed in a future version." - ) - def to_dict(self) -> Dict[str, Any]: - return dict(self) + def to_dict(self, recursive: bool = True) -> Dict[str, Any]: + """ + Dump the object's backing data. Recurses by default, but you can opt-out of that behavior by passing `recursive=False` + """ + if recursive: + return self._to_dict_recursive() + + # shallow copy, so nested objects will be shared + return self._data.copy() def _to_dict_recursive(self) -> Dict[str, Any]: + """ + used by __str__ to serialize the whole object + """ + def maybe_to_dict_recursive( value: Optional[Union[StripeObject, Dict[str, Any]]], ) -> Optional[Dict[str, Any]]: @@ -539,42 +560,32 @@ def maybe_to_dict_recursive( key: list(map(maybe_to_dict_recursive, cast(List[Any], value))) if isinstance(value, list) else maybe_to_dict_recursive(value) - for key, value in dict(self).items() + for key, value in self._data.items() } - @_util.deprecated( - "For internal stripe-python use only. The public interface will be removed in a future version." - ) - def to_dict_recursive(self) -> Dict[str, Any]: - return self._to_dict_recursive() - - @property - @_util.deprecated( - "For internal stripe-python use only. The public interface will be removed in a future version." - ) - def stripe_id(self) -> Optional[str]: - return getattr(self, "id") - def serialize( self, previous: Optional[Mapping[str, Any]] ) -> Dict[str, Any]: params: Dict[str, Any] = {} unsaved_keys = self._unsaved_values or set() - previous = previous or self._previous or {} + previous_raw = previous or self._previous or {} + if isinstance(previous_raw, StripeObject): + previous_raw = previous_raw._data + prev: Dict[str, Any] = dict(previous_raw) - for k, v in self.items(): + for k, v in self._data.items(): if k == "id" or k.startswith("_"): continue elif isinstance(v, stripe.APIResource): continue elif hasattr(v, "serialize"): - child = v.serialize(previous.get(k, None)) + child = v.serialize(prev.get(k, None)) if child != {}: params[k] = child elif k in unsaved_keys: - params[k] = _compute_diff(v, previous.get(k, None)) + params[k] = _compute_diff(v, prev.get(k, None)) elif k == "additional_owners" and v is not None: - params[k] = _serialize_list(v, previous.get(k, None)) + params[k] = _serialize_list(v, prev.get(k, None)) return params @@ -585,7 +596,7 @@ def serialize( # arguments so that we can bypass these possible exceptions on __setitem__. def __copy__(self) -> "StripeObject": copied = StripeObject( - self.get("id"), + getattr(self, "id", None), self.api_key, stripe_version=self.stripe_version, stripe_account=self.stripe_account, @@ -593,10 +604,10 @@ def __copy__(self) -> "StripeObject": copied._retrieve_params = self._retrieve_params - for k, v in self.items(): - # Call parent's __setitem__ to avoid checks that we've added in the - # overridden version that can throw exceptions. - super(StripeObject, copied).__setitem__(k, v) + for k, v in self._data.items(): + # Write to _data directly to avoid checks that we've added in the + # overridden __setitem__ that can throw exceptions. + copied._data[k] = v return copied @@ -609,10 +620,10 @@ def __deepcopy__(self, memo: Dict[int, Any]) -> "StripeObject": copied = self.__copy__() memo[id(self)] = copied - for k, v in self.items(): - # Call parent's __setitem__ to avoid checks that we've added in the - # overridden version that can throw exceptions. - super(StripeObject, copied).__setitem__(k, deepcopy(v, memo)) + for k, v in self._data.items(): + # Write to _data directly to avoid checks that we've added in the + # overridden __setitem__ that can throw exceptions. + copied._data[k] = deepcopy(v, memo) return copied @@ -620,6 +631,7 @@ def __deepcopy__(self, memo: Dict[int, Any]) -> "StripeObject": _inner_class_types: ClassVar[Dict[str, Type["StripeObject"]]] = {} _inner_class_dicts: ClassVar[List[str]] = [] + _field_encodings: ClassVar[Dict[str, str]] = {} def _get_inner_class_type( self, field_name: str @@ -628,3 +640,19 @@ def _get_inner_class_type( def _get_inner_class_is_beneath_dict(self, field_name: str): return field_name in self._inner_class_dicts + + def _coerce_field_value(self, field_name: str, value: Any) -> Any: + """ + Apply field encoding coercion based on _field_encodings metadata. + + For int64_string fields, converts string values from the API response + to native Python ints. + """ + encoding = self._field_encodings.get(field_name) + if encoding is None or value is None: + return value + + if encoding == "int64_string": + return _coerce_int64_string(value, encode=False) + + return value diff --git a/stripe/_stripe_service.py b/stripe/_stripe_service.py index e72279f41..174858968 100644 --- a/stripe/_stripe_service.py +++ b/stripe/_stripe_service.py @@ -9,7 +9,9 @@ from stripe._request_options import RequestOptions from stripe._base_address import BaseAddress -from typing import Any, Mapping, Optional +from typing import Any, Dict, Mapping, Optional + +from stripe._encode import _coerce_v2_params, _SchemaNode class StripeService(object): @@ -26,7 +28,10 @@ def _request( options: Optional[RequestOptions] = None, *, base_address: BaseAddress, + _param_encodings: Optional[Dict[str, _SchemaNode]] = None, ) -> StripeObject: + if _param_encodings: + params = _coerce_v2_params(params, _param_encodings) return self._requestor.request( method, url, @@ -44,7 +49,10 @@ async def _request_async( options: Optional[RequestOptions] = None, *, base_address: BaseAddress, + _param_encodings: Optional[Dict[str, _SchemaNode]] = None, ) -> StripeObject: + if _param_encodings: + params = _coerce_v2_params(params, _param_encodings) return await self._requestor.request_async( method, url, diff --git a/stripe/_subscription.py b/stripe/_subscription.py index a0ad8bcee..d373d8025 100644 --- a/stripe/_subscription.py +++ b/stripe/_subscription.py @@ -236,7 +236,10 @@ class CancellationDetails(StripeObject): """ reason: Optional[ Literal[ - "cancellation_requested", "payment_disputed", "payment_failed" + "canceled_by_retention_policy", + "cancellation_requested", + "payment_disputed", + "payment_failed", ] ] """ @@ -295,7 +298,7 @@ class ManagedPayments(StripeObject): class PauseCollection(StripeObject): behavior: Literal["keep_as_draft", "mark_uncollectible", "void"] """ - The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`. + The payment collection behavior for this subscription while paused. """ resumes_at: Optional[int] """ @@ -316,7 +319,7 @@ class MandateOptions(StripeObject): Literal["automatic", "instant", "microdeposits"] ] """ - Bank account verification method. + Bank account verification method. The default value is `automatic`. """ _inner_class_types = {"mandate_options": MandateOptions} @@ -330,7 +333,7 @@ class Card(StripeObject): class MandateOptions(StripeObject): amount: Optional[int] """ - Amount to be charged for future payments. + Amount to be charged for future payments, specified in the presentment currency. """ amount_type: Optional[Literal["fixed", "maximum"]] """ @@ -457,6 +460,10 @@ class MandateOptions(StripeObject): Schedule at which the future payments will be charged. """ + expires_after_seconds: Optional[int] + """ + The number of seconds (between 10 and 1209600) after which Pix payment will expire. Defaults to 86400 seconds. + """ mandate_options: Optional[MandateOptions] _inner_class_types = {"mandate_options": MandateOptions} @@ -533,7 +540,7 @@ class Filters(StripeObject): Literal["automatic", "instant", "microdeposits"] ] """ - Bank account verification method. + Bank account verification method. The default value is `automatic`. """ _inner_class_types = { "financial_connections": FinancialConnections, @@ -730,6 +737,10 @@ class TransferData(StripeObject): class TrialSettings(StripeObject): class EndBehavior(StripeObject): + billing_cycle_anchor: Optional[Literal["now", "unchanged"]] + """ + Indicates how the subscription's billing cycle anchor is reset when a trial ends. If not set, the default is `now`. + """ missing_payment_method: Literal[ "cancel", "create_invoice", "pause" ] @@ -859,7 +870,7 @@ class EndBehavior(StripeObject): """ livemode: bool """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ managed_payments: Optional[ManagedPayments] """ @@ -891,7 +902,7 @@ class EndBehavior(StripeObject): """ pending_invoice_item_interval: Optional[PendingInvoiceItemInterval] """ - Specifies an interval for how often to bill for any pending invoice items. It is analogous to calling [Create an invoice](https://docs.stripe.com/api#create_invoice) for the given subscription at the specified interval. + Specifies an interval for how often to bill for any pending invoice items. It is analogous to calling [Create an invoice](https://docs.stripe.com/api/invoices/create) for the given subscription at the specified interval. """ pending_setup_intent: Optional[ExpandableField["SetupIntent"]] """ @@ -966,7 +977,7 @@ def _cls_cancel( """ Cancels a customer's subscription immediately. The customer won't be charged again for the subscription. After it's canceled, you can no longer update the subscription or its [metadata](https://docs.stripe.com/metadata). - Any pending invoice items that you've created are still charged at the end of the period, unless manually [deleted](https://docs.stripe.com/api#delete_invoiceitem). If you've set the subscription to cancel at the end of the period, any pending prorations are also left in place and collected at the end of the period. But if the subscription is set to cancel immediately, pending prorations are removed if invoice_now and prorate are both set to true. + Any pending invoice items that you've created are still charged at the end of the period, unless manually [deleted](https://docs.stripe.com/api/invoiceitems/delete). If you've set the subscription to cancel at the end of the period, any pending prorations are also left in place and collected at the end of the period. But if the subscription is set to cancel immediately, pending prorations are removed if invoice_now and prorate are both set to true. By default, upon subscription cancellation, Stripe stops automatic collection of all finalized invoices for the customer. This is intended to prevent unexpected payment attempts after the customer has canceled a subscription. However, you can resume automatic collection of the invoices manually after subscription cancellation to have us proceed. Or, you could check for unpaid invoices before allowing the customer to cancel the subscription at all. """ @@ -992,7 +1003,7 @@ def cancel( """ Cancels a customer's subscription immediately. The customer won't be charged again for the subscription. After it's canceled, you can no longer update the subscription or its [metadata](https://docs.stripe.com/metadata). - Any pending invoice items that you've created are still charged at the end of the period, unless manually [deleted](https://docs.stripe.com/api#delete_invoiceitem). If you've set the subscription to cancel at the end of the period, any pending prorations are also left in place and collected at the end of the period. But if the subscription is set to cancel immediately, pending prorations are removed if invoice_now and prorate are both set to true. + Any pending invoice items that you've created are still charged at the end of the period, unless manually [deleted](https://docs.stripe.com/api/invoiceitems/delete). If you've set the subscription to cancel at the end of the period, any pending prorations are also left in place and collected at the end of the period. But if the subscription is set to cancel immediately, pending prorations are removed if invoice_now and prorate are both set to true. By default, upon subscription cancellation, Stripe stops automatic collection of all finalized invoices for the customer. This is intended to prevent unexpected payment attempts after the customer has canceled a subscription. However, you can resume automatic collection of the invoices manually after subscription cancellation to have us proceed. Or, you could check for unpaid invoices before allowing the customer to cancel the subscription at all. """ @@ -1005,7 +1016,7 @@ def cancel( """ Cancels a customer's subscription immediately. The customer won't be charged again for the subscription. After it's canceled, you can no longer update the subscription or its [metadata](https://docs.stripe.com/metadata). - Any pending invoice items that you've created are still charged at the end of the period, unless manually [deleted](https://docs.stripe.com/api#delete_invoiceitem). If you've set the subscription to cancel at the end of the period, any pending prorations are also left in place and collected at the end of the period. But if the subscription is set to cancel immediately, pending prorations are removed if invoice_now and prorate are both set to true. + Any pending invoice items that you've created are still charged at the end of the period, unless manually [deleted](https://docs.stripe.com/api/invoiceitems/delete). If you've set the subscription to cancel at the end of the period, any pending prorations are also left in place and collected at the end of the period. But if the subscription is set to cancel immediately, pending prorations are removed if invoice_now and prorate are both set to true. By default, upon subscription cancellation, Stripe stops automatic collection of all finalized invoices for the customer. This is intended to prevent unexpected payment attempts after the customer has canceled a subscription. However, you can resume automatic collection of the invoices manually after subscription cancellation to have us proceed. Or, you could check for unpaid invoices before allowing the customer to cancel the subscription at all. """ @@ -1018,7 +1029,7 @@ def cancel( # pyright: ignore[reportGeneralTypeIssues] """ Cancels a customer's subscription immediately. The customer won't be charged again for the subscription. After it's canceled, you can no longer update the subscription or its [metadata](https://docs.stripe.com/metadata). - Any pending invoice items that you've created are still charged at the end of the period, unless manually [deleted](https://docs.stripe.com/api#delete_invoiceitem). If you've set the subscription to cancel at the end of the period, any pending prorations are also left in place and collected at the end of the period. But if the subscription is set to cancel immediately, pending prorations are removed if invoice_now and prorate are both set to true. + Any pending invoice items that you've created are still charged at the end of the period, unless manually [deleted](https://docs.stripe.com/api/invoiceitems/delete). If you've set the subscription to cancel at the end of the period, any pending prorations are also left in place and collected at the end of the period. But if the subscription is set to cancel immediately, pending prorations are removed if invoice_now and prorate are both set to true. By default, upon subscription cancellation, Stripe stops automatic collection of all finalized invoices for the customer. This is intended to prevent unexpected payment attempts after the customer has canceled a subscription. However, you can resume automatic collection of the invoices manually after subscription cancellation to have us proceed. Or, you could check for unpaid invoices before allowing the customer to cancel the subscription at all. """ @@ -1027,7 +1038,7 @@ def cancel( # pyright: ignore[reportGeneralTypeIssues] self._request( "delete", "/v1/subscriptions/{subscription_exposed_id}".format( - subscription_exposed_id=sanitize_id(self.get("id")) + subscription_exposed_id=sanitize_id(self._data.get("id")) ), params=params, ), @@ -1042,7 +1053,7 @@ async def _cls_cancel_async( """ Cancels a customer's subscription immediately. The customer won't be charged again for the subscription. After it's canceled, you can no longer update the subscription or its [metadata](https://docs.stripe.com/metadata). - Any pending invoice items that you've created are still charged at the end of the period, unless manually [deleted](https://docs.stripe.com/api#delete_invoiceitem). If you've set the subscription to cancel at the end of the period, any pending prorations are also left in place and collected at the end of the period. But if the subscription is set to cancel immediately, pending prorations are removed if invoice_now and prorate are both set to true. + Any pending invoice items that you've created are still charged at the end of the period, unless manually [deleted](https://docs.stripe.com/api/invoiceitems/delete). If you've set the subscription to cancel at the end of the period, any pending prorations are also left in place and collected at the end of the period. But if the subscription is set to cancel immediately, pending prorations are removed if invoice_now and prorate are both set to true. By default, upon subscription cancellation, Stripe stops automatic collection of all finalized invoices for the customer. This is intended to prevent unexpected payment attempts after the customer has canceled a subscription. However, you can resume automatic collection of the invoices manually after subscription cancellation to have us proceed. Or, you could check for unpaid invoices before allowing the customer to cancel the subscription at all. """ @@ -1068,7 +1079,7 @@ async def cancel_async( """ Cancels a customer's subscription immediately. The customer won't be charged again for the subscription. After it's canceled, you can no longer update the subscription or its [metadata](https://docs.stripe.com/metadata). - Any pending invoice items that you've created are still charged at the end of the period, unless manually [deleted](https://docs.stripe.com/api#delete_invoiceitem). If you've set the subscription to cancel at the end of the period, any pending prorations are also left in place and collected at the end of the period. But if the subscription is set to cancel immediately, pending prorations are removed if invoice_now and prorate are both set to true. + Any pending invoice items that you've created are still charged at the end of the period, unless manually [deleted](https://docs.stripe.com/api/invoiceitems/delete). If you've set the subscription to cancel at the end of the period, any pending prorations are also left in place and collected at the end of the period. But if the subscription is set to cancel immediately, pending prorations are removed if invoice_now and prorate are both set to true. By default, upon subscription cancellation, Stripe stops automatic collection of all finalized invoices for the customer. This is intended to prevent unexpected payment attempts after the customer has canceled a subscription. However, you can resume automatic collection of the invoices manually after subscription cancellation to have us proceed. Or, you could check for unpaid invoices before allowing the customer to cancel the subscription at all. """ @@ -1081,7 +1092,7 @@ async def cancel_async( """ Cancels a customer's subscription immediately. The customer won't be charged again for the subscription. After it's canceled, you can no longer update the subscription or its [metadata](https://docs.stripe.com/metadata). - Any pending invoice items that you've created are still charged at the end of the period, unless manually [deleted](https://docs.stripe.com/api#delete_invoiceitem). If you've set the subscription to cancel at the end of the period, any pending prorations are also left in place and collected at the end of the period. But if the subscription is set to cancel immediately, pending prorations are removed if invoice_now and prorate are both set to true. + Any pending invoice items that you've created are still charged at the end of the period, unless manually [deleted](https://docs.stripe.com/api/invoiceitems/delete). If you've set the subscription to cancel at the end of the period, any pending prorations are also left in place and collected at the end of the period. But if the subscription is set to cancel immediately, pending prorations are removed if invoice_now and prorate are both set to true. By default, upon subscription cancellation, Stripe stops automatic collection of all finalized invoices for the customer. This is intended to prevent unexpected payment attempts after the customer has canceled a subscription. However, you can resume automatic collection of the invoices manually after subscription cancellation to have us proceed. Or, you could check for unpaid invoices before allowing the customer to cancel the subscription at all. """ @@ -1094,7 +1105,7 @@ async def cancel_async( # pyright: ignore[reportGeneralTypeIssues] """ Cancels a customer's subscription immediately. The customer won't be charged again for the subscription. After it's canceled, you can no longer update the subscription or its [metadata](https://docs.stripe.com/metadata). - Any pending invoice items that you've created are still charged at the end of the period, unless manually [deleted](https://docs.stripe.com/api#delete_invoiceitem). If you've set the subscription to cancel at the end of the period, any pending prorations are also left in place and collected at the end of the period. But if the subscription is set to cancel immediately, pending prorations are removed if invoice_now and prorate are both set to true. + Any pending invoice items that you've created are still charged at the end of the period, unless manually [deleted](https://docs.stripe.com/api/invoiceitems/delete). If you've set the subscription to cancel at the end of the period, any pending prorations are also left in place and collected at the end of the period. But if the subscription is set to cancel immediately, pending prorations are removed if invoice_now and prorate are both set to true. By default, upon subscription cancellation, Stripe stops automatic collection of all finalized invoices for the customer. This is intended to prevent unexpected payment attempts after the customer has canceled a subscription. However, you can resume automatic collection of the invoices manually after subscription cancellation to have us proceed. Or, you could check for unpaid invoices before allowing the customer to cancel the subscription at all. """ @@ -1103,7 +1114,7 @@ async def cancel_async( # pyright: ignore[reportGeneralTypeIssues] await self._request_async( "delete", "/v1/subscriptions/{subscription_exposed_id}".format( - subscription_exposed_id=sanitize_id(self.get("id")) + subscription_exposed_id=sanitize_id(self._data.get("id")) ), params=params, ), @@ -1207,7 +1218,7 @@ def delete_discount( # pyright: ignore[reportGeneralTypeIssues] self._request( "delete", "/v1/subscriptions/{subscription_exposed_id}/discount".format( - subscription_exposed_id=sanitize_id(self.get("id")) + subscription_exposed_id=sanitize_id(self._data.get("id")) ), params=params, ), @@ -1267,7 +1278,7 @@ async def delete_discount_async( # pyright: ignore[reportGeneralTypeIssues] await self._request_async( "delete", "/v1/subscriptions/{subscription_exposed_id}/discount".format( - subscription_exposed_id=sanitize_id(self.get("id")) + subscription_exposed_id=sanitize_id(self._data.get("id")) ), params=params, ), @@ -1362,7 +1373,7 @@ def migrate( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/subscriptions/{subscription}/migrate".format( - subscription=sanitize_id(self.get("id")) + subscription=sanitize_id(self._data.get("id")) ), params=params, ), @@ -1417,7 +1428,7 @@ async def migrate_async( # pyright: ignore[reportGeneralTypeIssues] await self._request_async( "post", "/v1/subscriptions/{subscription}/migrate".format( - subscription=sanitize_id(self.get("id")) + subscription=sanitize_id(self._data.get("id")) ), params=params, ), @@ -1546,7 +1557,7 @@ def resume( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/subscriptions/{subscription}/resume".format( - subscription=sanitize_id(self.get("id")) + subscription=sanitize_id(self._data.get("id")) ), params=params, ), @@ -1601,7 +1612,7 @@ async def resume_async( # pyright: ignore[reportGeneralTypeIssues] await self._request_async( "post", "/v1/subscriptions/{subscription}/resume".format( - subscription=sanitize_id(self.get("id")) + subscription=sanitize_id(self._data.get("id")) ), params=params, ), diff --git a/stripe/_subscription_item.py b/stripe/_subscription_item.py index e49df77b5..b4a8787a5 100644 --- a/stripe/_subscription_item.py +++ b/stripe/_subscription_item.py @@ -52,6 +52,11 @@ class BillingThresholds(StripeObject): Usage threshold that triggers the subscription to create an invoice """ + class CurrentTrial(StripeObject): + end_date: int + start_date: int + trial_offer: str + class Trial(StripeObject): converts_to: Optional[List[str]] """ @@ -82,6 +87,10 @@ class Trial(StripeObject): """ The start time of this subscription item's current billing period. """ + current_trial: Optional[CurrentTrial] + """ + The current trial that is applied to this subscription item. + """ deleted: Optional[Literal[True]] """ Always true for a deleted object @@ -367,5 +376,6 @@ async def retrieve_async( _inner_class_types = { "billing_thresholds": BillingThresholds, + "current_trial": CurrentTrial, "trial": Trial, } diff --git a/stripe/_subscription_schedule.py b/stripe/_subscription_schedule.py index 83107998e..e57f1c44c 100644 --- a/stripe/_subscription_schedule.py +++ b/stripe/_subscription_schedule.py @@ -480,6 +480,10 @@ class Trial(StripeObject): """ Options that configure the trial on the subscription item. """ + trial_offer: Optional[str] + """ + The ID of the trial offer to apply to the configuration item. + """ _inner_class_types = { "billing_thresholds": BillingThresholds, "discounts": Discount, @@ -489,7 +493,7 @@ class Trial(StripeObject): class PauseCollection(StripeObject): behavior: Literal["keep_as_draft", "mark_uncollectible", "void"] """ - The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`. + The payment collection behavior for this subscription while paused. """ class TransferData(StripeObject): @@ -691,7 +695,7 @@ class Prebilling(StripeObject): """ livemode: bool """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ metadata: Optional[Dict[str, str]] """ @@ -781,7 +785,7 @@ def amend( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/subscription_schedules/{schedule}/amend".format( - schedule=sanitize_id(self.get("id")) + schedule=sanitize_id(self._data.get("id")) ), params=params, ), @@ -836,7 +840,7 @@ async def amend_async( # pyright: ignore[reportGeneralTypeIssues] await self._request_async( "post", "/v1/subscription_schedules/{schedule}/amend".format( - schedule=sanitize_id(self.get("id")) + schedule=sanitize_id(self._data.get("id")) ), params=params, ), @@ -893,7 +897,7 @@ def cancel( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/subscription_schedules/{schedule}/cancel".format( - schedule=sanitize_id(self.get("id")) + schedule=sanitize_id(self._data.get("id")) ), params=params, ), @@ -950,7 +954,7 @@ async def cancel_async( # pyright: ignore[reportGeneralTypeIssues] await self._request_async( "post", "/v1/subscription_schedules/{schedule}/cancel".format( - schedule=sanitize_id(self.get("id")) + schedule=sanitize_id(self._data.get("id")) ), params=params, ), @@ -1113,7 +1117,7 @@ def release( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/subscription_schedules/{schedule}/release".format( - schedule=sanitize_id(self.get("id")) + schedule=sanitize_id(self._data.get("id")) ), params=params, ), @@ -1170,7 +1174,7 @@ async def release_async( # pyright: ignore[reportGeneralTypeIssues] await self._request_async( "post", "/v1/subscription_schedules/{schedule}/release".format( - schedule=sanitize_id(self.get("id")) + schedule=sanitize_id(self._data.get("id")) ), params=params, ), diff --git a/stripe/_subscription_service.py b/stripe/_subscription_service.py index 58e6a02bc..bd44c71ab 100644 --- a/stripe/_subscription_service.py +++ b/stripe/_subscription_service.py @@ -48,7 +48,7 @@ def cancel( """ Cancels a customer's subscription immediately. The customer won't be charged again for the subscription. After it's canceled, you can no longer update the subscription or its [metadata](https://docs.stripe.com/metadata). - Any pending invoice items that you've created are still charged at the end of the period, unless manually [deleted](https://docs.stripe.com/api#delete_invoiceitem). If you've set the subscription to cancel at the end of the period, any pending prorations are also left in place and collected at the end of the period. But if the subscription is set to cancel immediately, pending prorations are removed if invoice_now and prorate are both set to true. + Any pending invoice items that you've created are still charged at the end of the period, unless manually [deleted](https://docs.stripe.com/api/invoiceitems/delete). If you've set the subscription to cancel at the end of the period, any pending prorations are also left in place and collected at the end of the period. But if the subscription is set to cancel immediately, pending prorations are removed if invoice_now and prorate are both set to true. By default, upon subscription cancellation, Stripe stops automatic collection of all finalized invoices for the customer. This is intended to prevent unexpected payment attempts after the customer has canceled a subscription. However, you can resume automatic collection of the invoices manually after subscription cancellation to have us proceed. Or, you could check for unpaid invoices before allowing the customer to cancel the subscription at all. """ @@ -76,7 +76,7 @@ async def cancel_async( """ Cancels a customer's subscription immediately. The customer won't be charged again for the subscription. After it's canceled, you can no longer update the subscription or its [metadata](https://docs.stripe.com/metadata). - Any pending invoice items that you've created are still charged at the end of the period, unless manually [deleted](https://docs.stripe.com/api#delete_invoiceitem). If you've set the subscription to cancel at the end of the period, any pending prorations are also left in place and collected at the end of the period. But if the subscription is set to cancel immediately, pending prorations are removed if invoice_now and prorate are both set to true. + Any pending invoice items that you've created are still charged at the end of the period, unless manually [deleted](https://docs.stripe.com/api/invoiceitems/delete). If you've set the subscription to cancel at the end of the period, any pending prorations are also left in place and collected at the end of the period. But if the subscription is set to cancel immediately, pending prorations are removed if invoice_now and prorate are both set to true. By default, upon subscription cancellation, Stripe stops automatic collection of all finalized invoices for the customer. This is intended to prevent unexpected payment attempts after the customer has canceled a subscription. However, you can resume automatic collection of the invoices manually after subscription cancellation to have us proceed. Or, you could check for unpaid invoices before allowing the customer to cancel the subscription at all. """ diff --git a/stripe/_tax_code.py b/stripe/_tax_code.py index 281a4985a..3b570be5d 100644 --- a/stripe/_tax_code.py +++ b/stripe/_tax_code.py @@ -2,7 +2,8 @@ # File generated from our OpenAPI spec from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource -from typing import ClassVar +from stripe._stripe_object import StripeObject +from typing import ClassVar, Optional from typing_extensions import Literal, Unpack, TYPE_CHECKING if TYPE_CHECKING: @@ -16,6 +17,13 @@ class TaxCode(ListableAPIResource["TaxCode"]): """ OBJECT_NAME: ClassVar[Literal["tax_code"]] = "tax_code" + + class Requirements(StripeObject): + performance_location: Optional[Literal["optional", "required"]] + """ + Describes whether a performance location is required for a successful tax calculation with a tax code. + """ + description: str """ A detailed description of which types of products the tax code represents. @@ -32,6 +40,10 @@ class TaxCode(ListableAPIResource["TaxCode"]): """ String representing the object's type. Objects of the same type share the same value. """ + requirements: Optional[Requirements] + """ + An object that describes more information about the tax location required for this tax code. Some [tax codes](https://docs.stripe.com/tax/tax-for-tickets/integration-guide#types-of-products) require a tax location of type `performance` to calculate tax correctly. + """ @classmethod def list( @@ -94,3 +106,5 @@ async def retrieve_async( instance = cls(id, **params) await instance.refresh_async() return instance + + _inner_class_types = {"requirements": Requirements} diff --git a/stripe/_tax_id.py b/stripe/_tax_id.py index d53d614fc..c50ced8cc 100644 --- a/stripe/_tax_id.py +++ b/stripe/_tax_id.py @@ -96,7 +96,7 @@ class Verification(StripeObject): """ livemode: bool """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ object: Literal["tax_id"] """ diff --git a/stripe/_tax_rate.py b/stripe/_tax_rate.py index 017cbf94f..16c407bb0 100644 --- a/stripe/_tax_rate.py +++ b/stripe/_tax_rate.py @@ -89,7 +89,7 @@ class FlatAmount(StripeObject): """ livemode: bool """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ metadata: Optional[Dict[str, str]] """ diff --git a/stripe/_tax_service.py b/stripe/_tax_service.py index cc3d8626f..970381939 100644 --- a/stripe/_tax_service.py +++ b/stripe/_tax_service.py @@ -8,6 +8,7 @@ from stripe.tax._association_service import AssociationService from stripe.tax._calculation_service import CalculationService from stripe.tax._form_service import FormService + from stripe.tax._location_service import LocationService from stripe.tax._registration_service import RegistrationService from stripe.tax._settings_service import SettingsService from stripe.tax._transaction_service import TransactionService @@ -16,6 +17,7 @@ "associations": ["stripe.tax._association_service", "AssociationService"], "calculations": ["stripe.tax._calculation_service", "CalculationService"], "forms": ["stripe.tax._form_service", "FormService"], + "locations": ["stripe.tax._location_service", "LocationService"], "registrations": [ "stripe.tax._registration_service", "RegistrationService", @@ -29,6 +31,7 @@ class TaxService(StripeService): associations: "AssociationService" calculations: "CalculationService" forms: "FormService" + locations: "LocationService" registrations: "RegistrationService" settings: "SettingsService" transactions: "TransactionService" diff --git a/stripe/_token.py b/stripe/_token.py index 4415cb529..d316f43f5 100644 --- a/stripe/_token.py +++ b/stripe/_token.py @@ -68,7 +68,7 @@ class Token(CreateableAPIResource["Token"]): """ livemode: bool """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ object: Literal["token"] """ diff --git a/stripe/_topup.py b/stripe/_topup.py index dab41171d..6e14b33f9 100644 --- a/stripe/_topup.py +++ b/stripe/_topup.py @@ -59,7 +59,7 @@ class Topup( """ failure_code: Optional[str] """ - Error code explaining reason for top-up failure if available (see [the errors section](https://docs.stripe.com/api#errors) for a list of codes). + Error code explaining reason for top-up failure if available (see [the errors section](https://docs.stripe.com/api/errors) for a list of codes). """ failure_message: Optional[str] """ @@ -71,7 +71,7 @@ class Topup( """ livemode: bool """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ metadata: Dict[str, str] """ @@ -141,7 +141,7 @@ def cancel( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/topups/{topup}/cancel".format( - topup=sanitize_id(self.get("id")) + topup=sanitize_id(self._data.get("id")) ), params=params, ), @@ -194,7 +194,7 @@ async def cancel_async( # pyright: ignore[reportGeneralTypeIssues] await self._request_async( "post", "/v1/topups/{topup}/cancel".format( - topup=sanitize_id(self.get("id")) + topup=sanitize_id(self._data.get("id")) ), params=params, ), diff --git a/stripe/_transfer.py b/stripe/_transfer.py index 4c78864b7..5739c4730 100644 --- a/stripe/_transfer.py +++ b/stripe/_transfer.py @@ -95,7 +95,7 @@ class Transfer( """ livemode: bool """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ metadata: Dict[str, str] """ diff --git a/stripe/_updateable_api_resource.py b/stripe/_updateable_api_resource.py index 4088dc510..9f69deae5 100644 --- a/stripe/_updateable_api_resource.py +++ b/stripe/_updateable_api_resource.py @@ -3,6 +3,7 @@ from urllib.parse import quote_plus from typing import TypeVar, cast from stripe._stripe_object import StripeObject +from typing_extensions import deprecated T = TypeVar("T", bound=StripeObject) @@ -13,7 +14,7 @@ def modify(cls, sid, **params) -> T: url = "%s/%s" % (cls.class_url(), quote_plus(sid)) return cast(T, cls._static_request("post", url, params=params)) - @_util.deprecated( + @deprecated( "The `save` method is deprecated and will be removed in a future major version of the library. Use the class method `modify` on the resource instead." ) def save(self, idempotency_key=None): diff --git a/stripe/_util.py b/stripe/_util.py index 330e0e7e6..f1ec0b639 100644 --- a/stripe/_util.py +++ b/stripe/_util.py @@ -4,14 +4,12 @@ import sys import os import re -import warnings from stripe._api_mode import ApiMode from urllib.parse import quote_plus from typing_extensions import Type, TYPE_CHECKING from typing import ( - Callable, TypeVar, Union, overload, @@ -22,7 +20,6 @@ Optional, Mapping, ) -import typing_extensions # Used for global variables @@ -37,65 +34,6 @@ logger: logging.Logger = logging.getLogger("stripe") -if TYPE_CHECKING: - deprecated = typing_extensions.deprecated -else: - _T = TypeVar("_T") - - # Copied from python/typing_extensions, as this was added in typing_extensions 4.5.0 which is incompatible with - # python 3.6. We still need `deprecated = typing_extensions.deprecated` in addition to this fallback, as - # IDEs (pylance) specially detect references to symbols defined in `typing_extensions` - # - # https://github.com/python/typing_extensions/blob/5d20e9eed31de88667542ba5a6f66e6dc439b681/src/typing_extensions.py#L2289-L2370 - def deprecated( - __msg: str, - *, - category: Optional[Type[Warning]] = DeprecationWarning, - stacklevel: int = 1, - ) -> Callable[[_T], _T]: - def decorator(__arg: _T) -> _T: - if category is None: - __arg.__deprecated__ = __msg - return __arg - elif isinstance(__arg, type): - original_new = __arg.__new__ - has_init = __arg.__init__ is not object.__init__ - - @functools.wraps(original_new) - def __new__(cls, *args, **kwargs): - warnings.warn( - __msg, category=category, stacklevel=stacklevel + 1 - ) - if original_new is not object.__new__: - return original_new(cls, *args, **kwargs) - # Mirrors a similar check in object.__new__. - elif not has_init and (args or kwargs): - raise TypeError(f"{cls.__name__}() takes no arguments") - else: - return original_new(cls) - - __arg.__new__ = staticmethod(__new__) - __arg.__deprecated__ = __new__.__deprecated__ = __msg - return __arg - elif callable(__arg): - - @functools.wraps(__arg) - def wrapper(*args, **kwargs): - warnings.warn( - __msg, category=category, stacklevel=stacklevel + 1 - ) - return __arg(*args, **kwargs) - - __arg.__deprecated__ = wrapper.__deprecated__ = __msg - return wrapper - else: - raise TypeError( - "@deprecated decorator with non-None category must be applied to " - f"a class or callable, not {__arg!r}" - ) - - return decorator - def is_appengine_dev(): return "APPENGINE_RUNTIME" in os.environ and "Dev" in os.environ.get( @@ -301,7 +239,7 @@ def _convert_to_stripe_object( ) for i in resp ] - elif isinstance(resp, dict) and not isinstance(resp, StripeObject): + elif isinstance(resp, dict): resp = resp.copy() klass_name = resp.get("object") if isinstance(klass_name, str): @@ -363,11 +301,12 @@ def convert_to_dict(obj): :returns: The StripeObject as a dict. """ + from stripe._stripe_object import StripeObject + if isinstance(obj, list): return [convert_to_dict(i) for i in obj] - # This works by virtue of the fact that StripeObjects _are_ dicts. The dict - # comprehension returns a regular dict and recursively applies the - # conversion to each value. + elif isinstance(obj, StripeObject): + return {k: convert_to_dict(v) for k, v in obj._data.items()} elif isinstance(obj, dict): return {k: convert_to_dict(v) for k, v in obj.items()} else: diff --git a/stripe/_v1_services.py b/stripe/_v1_services.py index 3f5b59c87..49ed4e245 100644 --- a/stripe/_v1_services.py +++ b/stripe/_v1_services.py @@ -68,6 +68,7 @@ from stripe._plan_service import PlanService from stripe._price_service import PriceService from stripe._privacy_service import PrivacyService + from stripe._product_catalog_service import ProductCatalogService from stripe._product_service import ProductService from stripe._promotion_code_service import PromotionCodeService from stripe._quote_service import QuoteService @@ -210,6 +211,10 @@ "prices": ["stripe._price_service", "PriceService"], "privacy": ["stripe._privacy_service", "PrivacyService"], "products": ["stripe._product_service", "ProductService"], + "product_catalog": [ + "stripe._product_catalog_service", + "ProductCatalogService", + ], "promotion_codes": [ "stripe._promotion_code_service", "PromotionCodeService", @@ -306,6 +311,7 @@ class V1Services(StripeService): prices: "PriceService" privacy: "PrivacyService" products: "ProductService" + product_catalog: "ProductCatalogService" promotion_codes: "PromotionCodeService" quotes: "QuoteService" radar: "RadarService" diff --git a/stripe/_webhook_endpoint.py b/stripe/_webhook_endpoint.py index 100640ce0..4ea07b9f8 100644 --- a/stripe/_webhook_endpoint.py +++ b/stripe/_webhook_endpoint.py @@ -74,7 +74,7 @@ class WebhookEndpoint( """ livemode: bool """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ metadata: Dict[str, str] """ diff --git a/stripe/apps/_secret.py b/stripe/apps/_secret.py index d258c4ddc..6a6a9e756 100644 --- a/stripe/apps/_secret.py +++ b/stripe/apps/_secret.py @@ -59,7 +59,7 @@ class Scope(StripeObject): """ livemode: bool """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ name: str """ diff --git a/stripe/billing/_alert.py b/stripe/billing/_alert.py index 3699c662c..832584644 100644 --- a/stripe/billing/_alert.py +++ b/stripe/billing/_alert.py @@ -69,7 +69,7 @@ class Filter(StripeObject): """ livemode: bool """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ object: Literal["billing.alert"] """ @@ -131,7 +131,7 @@ def activate( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/billing/alerts/{id}/activate".format( - id=sanitize_id(self.get("id")) + id=sanitize_id(self._data.get("id")) ), params=params, ), @@ -184,7 +184,7 @@ async def activate_async( # pyright: ignore[reportGeneralTypeIssues] await self._request_async( "post", "/v1/billing/alerts/{id}/activate".format( - id=sanitize_id(self.get("id")) + id=sanitize_id(self._data.get("id")) ), params=params, ), @@ -233,7 +233,7 @@ def archive( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/billing/alerts/{id}/archive".format( - id=sanitize_id(self.get("id")) + id=sanitize_id(self._data.get("id")) ), params=params, ), @@ -286,7 +286,7 @@ async def archive_async( # pyright: ignore[reportGeneralTypeIssues] await self._request_async( "post", "/v1/billing/alerts/{id}/archive".format( - id=sanitize_id(self.get("id")) + id=sanitize_id(self._data.get("id")) ), params=params, ), @@ -369,7 +369,7 @@ def deactivate( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/billing/alerts/{id}/deactivate".format( - id=sanitize_id(self.get("id")) + id=sanitize_id(self._data.get("id")) ), params=params, ), @@ -424,7 +424,7 @@ async def deactivate_async( # pyright: ignore[reportGeneralTypeIssues] await self._request_async( "post", "/v1/billing/alerts/{id}/deactivate".format( - id=sanitize_id(self.get("id")) + id=sanitize_id(self._data.get("id")) ), params=params, ), diff --git a/stripe/billing/_alert_triggered.py b/stripe/billing/_alert_triggered.py index beaed0065..99d2aea89 100644 --- a/stripe/billing/_alert_triggered.py +++ b/stripe/billing/_alert_triggered.py @@ -26,7 +26,7 @@ class AlertTriggered(StripeObject): """ livemode: bool """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ object: Literal["billing.alert_triggered"] """ diff --git a/stripe/billing/_credit_balance_summary.py b/stripe/billing/_credit_balance_summary.py index c7a5c9a18..c87a468b2 100644 --- a/stripe/billing/_credit_balance_summary.py +++ b/stripe/billing/_credit_balance_summary.py @@ -86,7 +86,7 @@ class Monetary(StripeObject): """ livemode: bool """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ object: Literal["billing.credit_balance_summary"] """ diff --git a/stripe/billing/_credit_balance_transaction.py b/stripe/billing/_credit_balance_transaction.py index f66eb7b02..667756fac 100644 --- a/stripe/billing/_credit_balance_transaction.py +++ b/stripe/billing/_credit_balance_transaction.py @@ -150,7 +150,7 @@ class CreditsApplied(StripeObject): """ livemode: bool """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ object: Literal["billing.credit_balance_transaction"] """ diff --git a/stripe/billing/_credit_grant.py b/stripe/billing/_credit_grant.py index 2c091e302..fe7198ddb 100644 --- a/stripe/billing/_credit_grant.py +++ b/stripe/billing/_credit_grant.py @@ -122,7 +122,7 @@ class Price(StripeObject): """ livemode: bool """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ metadata: Dict[str, str] """ @@ -234,7 +234,7 @@ def expire( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/billing/credit_grants/{id}/expire".format( - id=sanitize_id(self.get("id")) + id=sanitize_id(self._data.get("id")) ), params=params, ), @@ -289,7 +289,7 @@ async def expire_async( # pyright: ignore[reportGeneralTypeIssues] await self._request_async( "post", "/v1/billing/credit_grants/{id}/expire".format( - id=sanitize_id(self.get("id")) + id=sanitize_id(self._data.get("id")) ), params=params, ), @@ -440,7 +440,7 @@ def void_grant( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/billing/credit_grants/{id}/void".format( - id=sanitize_id(self.get("id")) + id=sanitize_id(self._data.get("id")) ), params=params, ), @@ -495,7 +495,7 @@ async def void_grant_async( # pyright: ignore[reportGeneralTypeIssues] await self._request_async( "post", "/v1/billing/credit_grants/{id}/void".format( - id=sanitize_id(self.get("id")) + id=sanitize_id(self._data.get("id")) ), params=params, ), diff --git a/stripe/billing/_meter.py b/stripe/billing/_meter.py index 5f7d7b114..c7efe8307 100644 --- a/stripe/billing/_meter.py +++ b/stripe/billing/_meter.py @@ -95,7 +95,7 @@ class ValueSettings(StripeObject): """ livemode: bool """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ object: Literal["billing.meter"] """ @@ -189,7 +189,7 @@ def deactivate( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/billing/meters/{id}/deactivate".format( - id=sanitize_id(self.get("id")) + id=sanitize_id(self._data.get("id")) ), params=params, ), @@ -244,7 +244,7 @@ async def deactivate_async( # pyright: ignore[reportGeneralTypeIssues] await self._request_async( "post", "/v1/billing/meters/{id}/deactivate".format( - id=sanitize_id(self.get("id")) + id=sanitize_id(self._data.get("id")) ), params=params, ), @@ -367,7 +367,7 @@ def reactivate( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/billing/meters/{id}/reactivate".format( - id=sanitize_id(self.get("id")) + id=sanitize_id(self._data.get("id")) ), params=params, ), @@ -422,7 +422,7 @@ async def reactivate_async( # pyright: ignore[reportGeneralTypeIssues] await self._request_async( "post", "/v1/billing/meters/{id}/reactivate".format( - id=sanitize_id(self.get("id")) + id=sanitize_id(self._data.get("id")) ), params=params, ), diff --git a/stripe/billing/_meter_event.py b/stripe/billing/_meter_event.py index 8fa8003d3..dd2abf576 100644 --- a/stripe/billing/_meter_event.py +++ b/stripe/billing/_meter_event.py @@ -32,7 +32,7 @@ class MeterEvent(CreateableAPIResource["MeterEvent"]): """ livemode: bool """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ object: Literal["billing.meter_event"] """ diff --git a/stripe/billing/_meter_event_adjustment.py b/stripe/billing/_meter_event_adjustment.py index be7a0b935..9e506e3ee 100644 --- a/stripe/billing/_meter_event_adjustment.py +++ b/stripe/billing/_meter_event_adjustment.py @@ -36,7 +36,7 @@ class Cancel(StripeObject): """ livemode: bool """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ object: Literal["billing.meter_event_adjustment"] """ diff --git a/stripe/billing/_meter_event_summary.py b/stripe/billing/_meter_event_summary.py index 823b330c3..76e123fb2 100644 --- a/stripe/billing/_meter_event_summary.py +++ b/stripe/billing/_meter_event_summary.py @@ -30,7 +30,7 @@ class MeterEventSummary(StripeObject): """ livemode: bool """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ meter: str """ diff --git a/stripe/billing/analytics/_meter_usage.py b/stripe/billing/analytics/_meter_usage.py index 0645528d7..5fa4a4510 100644 --- a/stripe/billing/analytics/_meter_usage.py +++ b/stripe/billing/analytics/_meter_usage.py @@ -22,7 +22,7 @@ class MeterUsage(SingletonAPIResource["MeterUsage"]): ) livemode: bool """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ object: Literal["billing.analytics.meter_usage"] """ diff --git a/stripe/billing_portal/_configuration.py b/stripe/billing_portal/_configuration.py index 3dc14ebc1..a51ecdb2f 100644 --- a/stripe/billing_portal/_configuration.py +++ b/stripe/billing_portal/_configuration.py @@ -254,7 +254,7 @@ class LoginPage(StripeObject): """ livemode: bool """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ login_page: LoginPage metadata: Optional[Dict[str, str]] diff --git a/stripe/billing_portal/_session.py b/stripe/billing_portal/_session.py index fe61bda62..ae74b82e8 100644 --- a/stripe/billing_portal/_session.py +++ b/stripe/billing_portal/_session.py @@ -194,7 +194,7 @@ class Item(StripeObject): """ livemode: bool """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ locale: Optional[ Literal[ diff --git a/stripe/capital/_financing_offer.py b/stripe/capital/_financing_offer.py index 3bdbfdc47..f582eae52 100644 --- a/stripe/capital/_financing_offer.py +++ b/stripe/capital/_financing_offer.py @@ -116,7 +116,7 @@ class OfferedTerms(StripeObject): """ livemode: bool """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ metadata: Optional[Dict[str, str]] """ @@ -260,7 +260,7 @@ def mark_delivered( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/capital/financing_offers/{financing_offer}/mark_delivered".format( - financing_offer=sanitize_id(self.get("id")) + financing_offer=sanitize_id(self._data.get("id")) ), params=params, ), @@ -322,7 +322,7 @@ async def mark_delivered_async( # pyright: ignore[reportGeneralTypeIssues] await self._request_async( "post", "/v1/capital/financing_offers/{financing_offer}/mark_delivered".format( - financing_offer=sanitize_id(self.get("id")) + financing_offer=sanitize_id(self._data.get("id")) ), params=params, ), diff --git a/stripe/capital/_financing_transaction.py b/stripe/capital/_financing_transaction.py index e8b8420b6..d89b0c233 100644 --- a/stripe/capital/_financing_transaction.py +++ b/stripe/capital/_financing_transaction.py @@ -109,7 +109,7 @@ class Transaction(StripeObject): """ livemode: bool """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ object: Literal["capital.financing_transaction"] """ diff --git a/stripe/checkout/_session.py b/stripe/checkout/_session.py index 3335a4d0d..4ae56f2e6 100644 --- a/stripe/checkout/_session.py +++ b/stripe/checkout/_session.py @@ -958,7 +958,7 @@ class MandateOptions(StripeObject): Literal["automatic", "instant", "microdeposits"] ] """ - Bank account verification method. + Bank account verification method. The default value is `automatic`. """ _inner_class_types = {"mandate_options": MandateOptions} @@ -1740,6 +1740,40 @@ class Twint(StripeObject): 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 Upi(StripeObject): + class MandateOptions(StripeObject): + amount: Optional[int] + """ + Amount to be charged for future payments. + """ + amount_type: Optional[Literal["fixed", "maximum"]] + """ + One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param. + """ + description: Optional[str] + """ + A description of the mandate or subscription that is meant to be displayed to the customer. + """ + end_date: Optional[int] + """ + End date of the mandate or subscription. + """ + + mandate_options: Optional[MandateOptions] + setup_future_usage: Optional[ + Literal["none", "off_session", "on_session"] + ] + """ + 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). + """ + _inner_class_types = {"mandate_options": MandateOptions} + class UsBankAccount(StripeObject): class FinancialConnections(StripeObject): class Filters(StripeObject): @@ -1816,7 +1850,7 @@ class ManualEntry(StripeObject): """ verification_method: Optional[Literal["automatic", "instant"]] """ - Bank account verification method. + Bank account verification method. The default value is `automatic`. """ _inner_class_types = { "financial_connections": FinancialConnections @@ -1863,6 +1897,7 @@ class ManualEntry(StripeObject): sofort: Optional[Sofort] swish: Optional[Swish] twint: Optional[Twint] + upi: Optional[Upi] us_bank_account: Optional[UsBankAccount] _inner_class_types = { "acss_debit": AcssDebit, @@ -1906,6 +1941,7 @@ class ManualEntry(StripeObject): "sofort": Sofort, "swish": Swish, "twint": Twint, + "upi": Upi, "us_bank_account": UsBankAccount, } @@ -2515,6 +2551,10 @@ class Link(StripeObject): """ Unique identifier for the object. """ + integration_identifier: Optional[str] + """ + The integration identifier for this Checkout Session. Multiple Checkout Sessions can have the same integration identifier. + """ invoice: Optional[ExpandableField["Invoice"]] """ ID of the invoice created by the Checkout Session, if it exists. @@ -2529,7 +2569,7 @@ class Link(StripeObject): """ livemode: bool """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ locale: Optional[ Literal[ @@ -2702,7 +2742,17 @@ class Link(StripeObject): """ Tax and discount details for the computed total amount. """ - ui_mode: Optional[Literal["custom", "embedded", "hosted"]] + ui_mode: Optional[ + Literal[ + "custom", + "elements", + "embedded", + "embedded_page", + "form", + "hosted", + "hosted_page", + ] + ] """ The UI mode of the Session. Defaults to `hosted`. """ @@ -2801,7 +2851,7 @@ def expire( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/checkout/sessions/{session}/expire".format( - session=sanitize_id(self.get("id")) + session=sanitize_id(self._data.get("id")) ), params=params, ), @@ -2864,7 +2914,7 @@ async def expire_async( # pyright: ignore[reportGeneralTypeIssues] await self._request_async( "post", "/v1/checkout/sessions/{session}/expire".format( - session=sanitize_id(self.get("id")) + session=sanitize_id(self._data.get("id")) ), params=params, ), @@ -2959,7 +3009,7 @@ def list_line_items( # pyright: ignore[reportGeneralTypeIssues] self._request( "get", "/v1/checkout/sessions/{session}/line_items".format( - session=sanitize_id(self.get("id")) + session=sanitize_id(self._data.get("id")) ), params=params, ), @@ -3014,7 +3064,7 @@ async def list_line_items_async( # pyright: ignore[reportGeneralTypeIssues] await self._request_async( "get", "/v1/checkout/sessions/{session}/line_items".format( - session=sanitize_id(self.get("id")) + session=sanitize_id(self._data.get("id")) ), params=params, ), diff --git a/stripe/climate/_order.py b/stripe/climate/_order.py index 2e92175f0..1f7acab6e 100644 --- a/stripe/climate/_order.py +++ b/stripe/climate/_order.py @@ -232,7 +232,7 @@ def cancel( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/climate/orders/{order}/cancel".format( - order=sanitize_id(self.get("id")) + order=sanitize_id(self._data.get("id")) ), params=params, ), @@ -299,7 +299,7 @@ async def cancel_async( # pyright: ignore[reportGeneralTypeIssues] await self._request_async( "post", "/v1/climate/orders/{order}/cancel".format( - order=sanitize_id(self.get("id")) + order=sanitize_id(self._data.get("id")) ), params=params, ), diff --git a/stripe/climate/_supplier.py b/stripe/climate/_supplier.py index d65e2100d..d1a4233e6 100644 --- a/stripe/climate/_supplier.py +++ b/stripe/climate/_supplier.py @@ -70,6 +70,7 @@ class Location(StripeObject): "biomass_carbon_removal_and_storage", "direct_air_capture", "enhanced_weathering", + "marine_carbon_removal", ] """ The scientific pathway used for carbon removal. diff --git a/stripe/entitlements/_active_entitlement.py b/stripe/entitlements/_active_entitlement.py index b9b6c4ead..a70757a74 100644 --- a/stripe/entitlements/_active_entitlement.py +++ b/stripe/entitlements/_active_entitlement.py @@ -34,7 +34,7 @@ class ActiveEntitlement(ListableAPIResource["ActiveEntitlement"]): """ livemode: bool """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ lookup_key: str """ diff --git a/stripe/entitlements/_active_entitlement_summary.py b/stripe/entitlements/_active_entitlement_summary.py index d6eb62bad..bc9b3036b 100644 --- a/stripe/entitlements/_active_entitlement_summary.py +++ b/stripe/entitlements/_active_entitlement_summary.py @@ -27,7 +27,7 @@ class ActiveEntitlementSummary(StripeObject): """ livemode: bool """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ object: Literal["entitlements.active_entitlement_summary"] """ diff --git a/stripe/entitlements/_feature.py b/stripe/entitlements/_feature.py index c9954ef1e..68a5ef7f7 100644 --- a/stripe/entitlements/_feature.py +++ b/stripe/entitlements/_feature.py @@ -46,7 +46,7 @@ class Feature( """ livemode: bool """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ lookup_key: str """ diff --git a/stripe/events/__init__.py b/stripe/events/__init__.py index d9bada65b..021864e71 100644 --- a/stripe/events/__init__.py +++ b/stripe/events/__init__.py @@ -97,6 +97,46 @@ V2CoreAccountUpdatedEvent as V2CoreAccountUpdatedEvent, V2CoreAccountUpdatedEventNotification as V2CoreAccountUpdatedEventNotification, ) + from stripe.events._v2_core_batch_job_batch_failed_event import ( + V2CoreBatchJobBatchFailedEvent as V2CoreBatchJobBatchFailedEvent, + V2CoreBatchJobBatchFailedEventNotification as V2CoreBatchJobBatchFailedEventNotification, + ) + from stripe.events._v2_core_batch_job_canceled_event import ( + V2CoreBatchJobCanceledEvent as V2CoreBatchJobCanceledEvent, + V2CoreBatchJobCanceledEventNotification as V2CoreBatchJobCanceledEventNotification, + ) + from stripe.events._v2_core_batch_job_completed_event import ( + V2CoreBatchJobCompletedEvent as V2CoreBatchJobCompletedEvent, + V2CoreBatchJobCompletedEventNotification as V2CoreBatchJobCompletedEventNotification, + ) + from stripe.events._v2_core_batch_job_created_event import ( + V2CoreBatchJobCreatedEvent as V2CoreBatchJobCreatedEvent, + V2CoreBatchJobCreatedEventNotification as V2CoreBatchJobCreatedEventNotification, + ) + from stripe.events._v2_core_batch_job_ready_for_upload_event import ( + V2CoreBatchJobReadyForUploadEvent as V2CoreBatchJobReadyForUploadEvent, + V2CoreBatchJobReadyForUploadEventNotification as V2CoreBatchJobReadyForUploadEventNotification, + ) + from stripe.events._v2_core_batch_job_timeout_event import ( + V2CoreBatchJobTimeoutEvent as V2CoreBatchJobTimeoutEvent, + V2CoreBatchJobTimeoutEventNotification as V2CoreBatchJobTimeoutEventNotification, + ) + from stripe.events._v2_core_batch_job_updated_event import ( + V2CoreBatchJobUpdatedEvent as V2CoreBatchJobUpdatedEvent, + V2CoreBatchJobUpdatedEventNotification as V2CoreBatchJobUpdatedEventNotification, + ) + from stripe.events._v2_core_batch_job_upload_timeout_event import ( + V2CoreBatchJobUploadTimeoutEvent as V2CoreBatchJobUploadTimeoutEvent, + V2CoreBatchJobUploadTimeoutEventNotification as V2CoreBatchJobUploadTimeoutEventNotification, + ) + from stripe.events._v2_core_batch_job_validating_event import ( + V2CoreBatchJobValidatingEvent as V2CoreBatchJobValidatingEvent, + V2CoreBatchJobValidatingEventNotification as V2CoreBatchJobValidatingEventNotification, + ) + from stripe.events._v2_core_batch_job_validation_failed_event import ( + V2CoreBatchJobValidationFailedEvent as V2CoreBatchJobValidationFailedEvent, + V2CoreBatchJobValidationFailedEventNotification as V2CoreBatchJobValidationFailedEventNotification, + ) from stripe.events._v2_core_event_destination_ping_event import ( V2CoreEventDestinationPingEvent as V2CoreEventDestinationPingEvent, V2CoreEventDestinationPingEventNotification as V2CoreEventDestinationPingEventNotification, @@ -421,6 +461,86 @@ "stripe.events._v2_core_account_updated_event", False, ), + "V2CoreBatchJobBatchFailedEvent": ( + "stripe.events._v2_core_batch_job_batch_failed_event", + False, + ), + "V2CoreBatchJobBatchFailedEventNotification": ( + "stripe.events._v2_core_batch_job_batch_failed_event", + False, + ), + "V2CoreBatchJobCanceledEvent": ( + "stripe.events._v2_core_batch_job_canceled_event", + False, + ), + "V2CoreBatchJobCanceledEventNotification": ( + "stripe.events._v2_core_batch_job_canceled_event", + False, + ), + "V2CoreBatchJobCompletedEvent": ( + "stripe.events._v2_core_batch_job_completed_event", + False, + ), + "V2CoreBatchJobCompletedEventNotification": ( + "stripe.events._v2_core_batch_job_completed_event", + False, + ), + "V2CoreBatchJobCreatedEvent": ( + "stripe.events._v2_core_batch_job_created_event", + False, + ), + "V2CoreBatchJobCreatedEventNotification": ( + "stripe.events._v2_core_batch_job_created_event", + False, + ), + "V2CoreBatchJobReadyForUploadEvent": ( + "stripe.events._v2_core_batch_job_ready_for_upload_event", + False, + ), + "V2CoreBatchJobReadyForUploadEventNotification": ( + "stripe.events._v2_core_batch_job_ready_for_upload_event", + False, + ), + "V2CoreBatchJobTimeoutEvent": ( + "stripe.events._v2_core_batch_job_timeout_event", + False, + ), + "V2CoreBatchJobTimeoutEventNotification": ( + "stripe.events._v2_core_batch_job_timeout_event", + False, + ), + "V2CoreBatchJobUpdatedEvent": ( + "stripe.events._v2_core_batch_job_updated_event", + False, + ), + "V2CoreBatchJobUpdatedEventNotification": ( + "stripe.events._v2_core_batch_job_updated_event", + False, + ), + "V2CoreBatchJobUploadTimeoutEvent": ( + "stripe.events._v2_core_batch_job_upload_timeout_event", + False, + ), + "V2CoreBatchJobUploadTimeoutEventNotification": ( + "stripe.events._v2_core_batch_job_upload_timeout_event", + False, + ), + "V2CoreBatchJobValidatingEvent": ( + "stripe.events._v2_core_batch_job_validating_event", + False, + ), + "V2CoreBatchJobValidatingEventNotification": ( + "stripe.events._v2_core_batch_job_validating_event", + False, + ), + "V2CoreBatchJobValidationFailedEvent": ( + "stripe.events._v2_core_batch_job_validation_failed_event", + False, + ), + "V2CoreBatchJobValidationFailedEventNotification": ( + "stripe.events._v2_core_batch_job_validation_failed_event", + False, + ), "V2CoreEventDestinationPingEvent": ( "stripe.events._v2_core_event_destination_ping_event", False, diff --git a/stripe/events/_event_classes.py b/stripe/events/_event_classes.py index 8f5dbbbf2..58729a23a 100644 --- a/stripe/events/_event_classes.py +++ b/stripe/events/_event_classes.py @@ -70,6 +70,36 @@ from stripe.events._v2_core_account_updated_event import ( V2CoreAccountUpdatedEventNotification, ) + from stripe.events._v2_core_batch_job_batch_failed_event import ( + V2CoreBatchJobBatchFailedEventNotification, + ) + from stripe.events._v2_core_batch_job_canceled_event import ( + V2CoreBatchJobCanceledEventNotification, + ) + from stripe.events._v2_core_batch_job_completed_event import ( + V2CoreBatchJobCompletedEventNotification, + ) + from stripe.events._v2_core_batch_job_created_event import ( + V2CoreBatchJobCreatedEventNotification, + ) + from stripe.events._v2_core_batch_job_ready_for_upload_event import ( + V2CoreBatchJobReadyForUploadEventNotification, + ) + from stripe.events._v2_core_batch_job_timeout_event import ( + V2CoreBatchJobTimeoutEventNotification, + ) + from stripe.events._v2_core_batch_job_updated_event import ( + V2CoreBatchJobUpdatedEventNotification, + ) + from stripe.events._v2_core_batch_job_upload_timeout_event import ( + V2CoreBatchJobUploadTimeoutEventNotification, + ) + from stripe.events._v2_core_batch_job_validating_event import ( + V2CoreBatchJobValidatingEventNotification, + ) + from stripe.events._v2_core_batch_job_validation_failed_event import ( + V2CoreBatchJobValidationFailedEventNotification, + ) from stripe.events._v2_core_event_destination_ping_event import ( V2CoreEventDestinationPingEventNotification, ) @@ -271,6 +301,46 @@ "stripe.events._v2_core_account_updated_event", "V2CoreAccountUpdatedEvent", ), + "v2.core.batch_job.batch_failed": ( + "stripe.events._v2_core_batch_job_batch_failed_event", + "V2CoreBatchJobBatchFailedEvent", + ), + "v2.core.batch_job.canceled": ( + "stripe.events._v2_core_batch_job_canceled_event", + "V2CoreBatchJobCanceledEvent", + ), + "v2.core.batch_job.completed": ( + "stripe.events._v2_core_batch_job_completed_event", + "V2CoreBatchJobCompletedEvent", + ), + "v2.core.batch_job.created": ( + "stripe.events._v2_core_batch_job_created_event", + "V2CoreBatchJobCreatedEvent", + ), + "v2.core.batch_job.ready_for_upload": ( + "stripe.events._v2_core_batch_job_ready_for_upload_event", + "V2CoreBatchJobReadyForUploadEvent", + ), + "v2.core.batch_job.timeout": ( + "stripe.events._v2_core_batch_job_timeout_event", + "V2CoreBatchJobTimeoutEvent", + ), + "v2.core.batch_job.updated": ( + "stripe.events._v2_core_batch_job_updated_event", + "V2CoreBatchJobUpdatedEvent", + ), + "v2.core.batch_job.upload_timeout": ( + "stripe.events._v2_core_batch_job_upload_timeout_event", + "V2CoreBatchJobUploadTimeoutEvent", + ), + "v2.core.batch_job.validating": ( + "stripe.events._v2_core_batch_job_validating_event", + "V2CoreBatchJobValidatingEvent", + ), + "v2.core.batch_job.validation_failed": ( + "stripe.events._v2_core_batch_job_validation_failed_event", + "V2CoreBatchJobValidationFailedEvent", + ), "v2.core.event_destination.ping": ( "stripe.events._v2_core_event_destination_ping_event", "V2CoreEventDestinationPingEvent", @@ -522,6 +592,46 @@ def get_v2_event_class(type_: str): "stripe.events._v2_core_account_updated_event", "V2CoreAccountUpdatedEventNotification", ), + "v2.core.batch_job.batch_failed": ( + "stripe.events._v2_core_batch_job_batch_failed_event", + "V2CoreBatchJobBatchFailedEventNotification", + ), + "v2.core.batch_job.canceled": ( + "stripe.events._v2_core_batch_job_canceled_event", + "V2CoreBatchJobCanceledEventNotification", + ), + "v2.core.batch_job.completed": ( + "stripe.events._v2_core_batch_job_completed_event", + "V2CoreBatchJobCompletedEventNotification", + ), + "v2.core.batch_job.created": ( + "stripe.events._v2_core_batch_job_created_event", + "V2CoreBatchJobCreatedEventNotification", + ), + "v2.core.batch_job.ready_for_upload": ( + "stripe.events._v2_core_batch_job_ready_for_upload_event", + "V2CoreBatchJobReadyForUploadEventNotification", + ), + "v2.core.batch_job.timeout": ( + "stripe.events._v2_core_batch_job_timeout_event", + "V2CoreBatchJobTimeoutEventNotification", + ), + "v2.core.batch_job.updated": ( + "stripe.events._v2_core_batch_job_updated_event", + "V2CoreBatchJobUpdatedEventNotification", + ), + "v2.core.batch_job.upload_timeout": ( + "stripe.events._v2_core_batch_job_upload_timeout_event", + "V2CoreBatchJobUploadTimeoutEventNotification", + ), + "v2.core.batch_job.validating": ( + "stripe.events._v2_core_batch_job_validating_event", + "V2CoreBatchJobValidatingEventNotification", + ), + "v2.core.batch_job.validation_failed": ( + "stripe.events._v2_core_batch_job_validation_failed_event", + "V2CoreBatchJobValidationFailedEventNotification", + ), "v2.core.event_destination.ping": ( "stripe.events._v2_core_event_destination_ping_event", "V2CoreEventDestinationPingEventNotification", @@ -710,6 +820,16 @@ def get_v2_event_notification_class(type_: str): "V2CoreAccountPersonDeletedEventNotification", "V2CoreAccountPersonUpdatedEventNotification", "V2CoreAccountUpdatedEventNotification", + "V2CoreBatchJobBatchFailedEventNotification", + "V2CoreBatchJobCanceledEventNotification", + "V2CoreBatchJobCompletedEventNotification", + "V2CoreBatchJobCreatedEventNotification", + "V2CoreBatchJobReadyForUploadEventNotification", + "V2CoreBatchJobTimeoutEventNotification", + "V2CoreBatchJobUpdatedEventNotification", + "V2CoreBatchJobUploadTimeoutEventNotification", + "V2CoreBatchJobValidatingEventNotification", + "V2CoreBatchJobValidationFailedEventNotification", "V2CoreEventDestinationPingEventNotification", "V2CoreHealthEventGenerationFailureResolvedEventNotification", "V2MoneyManagementAdjustmentCreatedEventNotification", diff --git a/stripe/events/_v2_core_account_including_configuration_storer_capability_status_updated_event.py b/stripe/events/_v2_core_account_including_configuration_storer_capability_status_updated_event.py index 1ce8ffd64..2b2ee4ef5 100644 --- a/stripe/events/_v2_core_account_including_configuration_storer_capability_status_updated_event.py +++ b/stripe/events/_v2_core_account_including_configuration_storer_capability_status_updated_event.py @@ -50,6 +50,7 @@ def fetch_related_object(self) -> "Account": "get", self.related_object.url, stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, usage=["fetch_related_object"], ) return cast( @@ -76,6 +77,7 @@ async def fetch_related_object_async(self) -> "Account": "get", self.related_object.url, stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, usage=["fetch_related_object"], ) return cast( @@ -180,6 +182,9 @@ def fetch_related_object(self) -> "Account": "get", self.related_object.url, base_address="api", - options={"stripe_context": self.context}, + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, ), ) diff --git a/stripe/events/_v2_core_account_including_configuration_storer_updated_event.py b/stripe/events/_v2_core_account_including_configuration_storer_updated_event.py index 2d086d16f..8d860ddc5 100644 --- a/stripe/events/_v2_core_account_including_configuration_storer_updated_event.py +++ b/stripe/events/_v2_core_account_including_configuration_storer_updated_event.py @@ -41,6 +41,7 @@ def fetch_related_object(self) -> "Account": "get", self.related_object.url, stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, usage=["fetch_related_object"], ) return cast( @@ -65,6 +66,7 @@ async def fetch_related_object_async(self) -> "Account": "get", self.related_object.url, stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, usage=["fetch_related_object"], ) return cast( @@ -109,6 +111,9 @@ def fetch_related_object(self) -> "Account": "get", self.related_object.url, base_address="api", - options={"stripe_context": self.context}, + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, ), ) diff --git a/stripe/events/_v2_core_batch_job_batch_failed_event.py b/stripe/events/_v2_core_batch_job_batch_failed_event.py new file mode 100644 index 000000000..770b286de --- /dev/null +++ b/stripe/events/_v2_core_batch_job_batch_failed_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._stripe_client import StripeClient + from stripe.v2.core._batch_job import BatchJob + + +class V2CoreBatchJobBatchFailedEventNotification(EventNotification): + LOOKUP_TYPE = "v2.core.batch_job.batch_failed" + type: Literal["v2.core.batch_job.batch_failed"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V2CoreBatchJobBatchFailedEvent": + return cast( + "V2CoreBatchJobBatchFailedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "BatchJob": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "BatchJob", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V2CoreBatchJobBatchFailedEvent": + return cast( + "V2CoreBatchJobBatchFailedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "BatchJob": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "BatchJob", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V2CoreBatchJobBatchFailedEvent(Event): + LOOKUP_TYPE = "v2.core.batch_job.batch_failed" + type: Literal["v2.core.batch_job.batch_failed"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "BatchJob": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "BatchJob", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v2_core_batch_job_canceled_event.py b/stripe/events/_v2_core_batch_job_canceled_event.py new file mode 100644 index 000000000..35aaa37cf --- /dev/null +++ b/stripe/events/_v2_core_batch_job_canceled_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._stripe_client import StripeClient + from stripe.v2.core._batch_job import BatchJob + + +class V2CoreBatchJobCanceledEventNotification(EventNotification): + LOOKUP_TYPE = "v2.core.batch_job.canceled" + type: Literal["v2.core.batch_job.canceled"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V2CoreBatchJobCanceledEvent": + return cast( + "V2CoreBatchJobCanceledEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "BatchJob": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "BatchJob", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V2CoreBatchJobCanceledEvent": + return cast( + "V2CoreBatchJobCanceledEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "BatchJob": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "BatchJob", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V2CoreBatchJobCanceledEvent(Event): + LOOKUP_TYPE = "v2.core.batch_job.canceled" + type: Literal["v2.core.batch_job.canceled"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "BatchJob": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "BatchJob", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v2_core_batch_job_completed_event.py b/stripe/events/_v2_core_batch_job_completed_event.py new file mode 100644 index 000000000..cdf0189a7 --- /dev/null +++ b/stripe/events/_v2_core_batch_job_completed_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._stripe_client import StripeClient + from stripe.v2.core._batch_job import BatchJob + + +class V2CoreBatchJobCompletedEventNotification(EventNotification): + LOOKUP_TYPE = "v2.core.batch_job.completed" + type: Literal["v2.core.batch_job.completed"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V2CoreBatchJobCompletedEvent": + return cast( + "V2CoreBatchJobCompletedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "BatchJob": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "BatchJob", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V2CoreBatchJobCompletedEvent": + return cast( + "V2CoreBatchJobCompletedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "BatchJob": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "BatchJob", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V2CoreBatchJobCompletedEvent(Event): + LOOKUP_TYPE = "v2.core.batch_job.completed" + type: Literal["v2.core.batch_job.completed"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "BatchJob": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "BatchJob", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v2_core_batch_job_created_event.py b/stripe/events/_v2_core_batch_job_created_event.py new file mode 100644 index 000000000..3c9cf6e2a --- /dev/null +++ b/stripe/events/_v2_core_batch_job_created_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._stripe_client import StripeClient + from stripe.v2.core._batch_job import BatchJob + + +class V2CoreBatchJobCreatedEventNotification(EventNotification): + LOOKUP_TYPE = "v2.core.batch_job.created" + type: Literal["v2.core.batch_job.created"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V2CoreBatchJobCreatedEvent": + return cast( + "V2CoreBatchJobCreatedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "BatchJob": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "BatchJob", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V2CoreBatchJobCreatedEvent": + return cast( + "V2CoreBatchJobCreatedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "BatchJob": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "BatchJob", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V2CoreBatchJobCreatedEvent(Event): + LOOKUP_TYPE = "v2.core.batch_job.created" + type: Literal["v2.core.batch_job.created"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "BatchJob": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "BatchJob", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v2_core_batch_job_ready_for_upload_event.py b/stripe/events/_v2_core_batch_job_ready_for_upload_event.py new file mode 100644 index 000000000..48bc78368 --- /dev/null +++ b/stripe/events/_v2_core_batch_job_ready_for_upload_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._stripe_client import StripeClient + from stripe.v2.core._batch_job import BatchJob + + +class V2CoreBatchJobReadyForUploadEventNotification(EventNotification): + LOOKUP_TYPE = "v2.core.batch_job.ready_for_upload" + type: Literal["v2.core.batch_job.ready_for_upload"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V2CoreBatchJobReadyForUploadEvent": + return cast( + "V2CoreBatchJobReadyForUploadEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "BatchJob": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "BatchJob", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V2CoreBatchJobReadyForUploadEvent": + return cast( + "V2CoreBatchJobReadyForUploadEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "BatchJob": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "BatchJob", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V2CoreBatchJobReadyForUploadEvent(Event): + LOOKUP_TYPE = "v2.core.batch_job.ready_for_upload" + type: Literal["v2.core.batch_job.ready_for_upload"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "BatchJob": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "BatchJob", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v2_core_batch_job_timeout_event.py b/stripe/events/_v2_core_batch_job_timeout_event.py new file mode 100644 index 000000000..b695242d4 --- /dev/null +++ b/stripe/events/_v2_core_batch_job_timeout_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._stripe_client import StripeClient + from stripe.v2.core._batch_job import BatchJob + + +class V2CoreBatchJobTimeoutEventNotification(EventNotification): + LOOKUP_TYPE = "v2.core.batch_job.timeout" + type: Literal["v2.core.batch_job.timeout"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V2CoreBatchJobTimeoutEvent": + return cast( + "V2CoreBatchJobTimeoutEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "BatchJob": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "BatchJob", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V2CoreBatchJobTimeoutEvent": + return cast( + "V2CoreBatchJobTimeoutEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "BatchJob": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "BatchJob", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V2CoreBatchJobTimeoutEvent(Event): + LOOKUP_TYPE = "v2.core.batch_job.timeout" + type: Literal["v2.core.batch_job.timeout"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "BatchJob": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "BatchJob", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v2_core_batch_job_updated_event.py b/stripe/events/_v2_core_batch_job_updated_event.py new file mode 100644 index 000000000..3b1c01845 --- /dev/null +++ b/stripe/events/_v2_core_batch_job_updated_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._stripe_client import StripeClient + from stripe.v2.core._batch_job import BatchJob + + +class V2CoreBatchJobUpdatedEventNotification(EventNotification): + LOOKUP_TYPE = "v2.core.batch_job.updated" + type: Literal["v2.core.batch_job.updated"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V2CoreBatchJobUpdatedEvent": + return cast( + "V2CoreBatchJobUpdatedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "BatchJob": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "BatchJob", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V2CoreBatchJobUpdatedEvent": + return cast( + "V2CoreBatchJobUpdatedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "BatchJob": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "BatchJob", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V2CoreBatchJobUpdatedEvent(Event): + LOOKUP_TYPE = "v2.core.batch_job.updated" + type: Literal["v2.core.batch_job.updated"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "BatchJob": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "BatchJob", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v2_core_batch_job_upload_timeout_event.py b/stripe/events/_v2_core_batch_job_upload_timeout_event.py new file mode 100644 index 000000000..fa875c7a8 --- /dev/null +++ b/stripe/events/_v2_core_batch_job_upload_timeout_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._stripe_client import StripeClient + from stripe.v2.core._batch_job import BatchJob + + +class V2CoreBatchJobUploadTimeoutEventNotification(EventNotification): + LOOKUP_TYPE = "v2.core.batch_job.upload_timeout" + type: Literal["v2.core.batch_job.upload_timeout"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V2CoreBatchJobUploadTimeoutEvent": + return cast( + "V2CoreBatchJobUploadTimeoutEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "BatchJob": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "BatchJob", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V2CoreBatchJobUploadTimeoutEvent": + return cast( + "V2CoreBatchJobUploadTimeoutEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "BatchJob": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "BatchJob", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V2CoreBatchJobUploadTimeoutEvent(Event): + LOOKUP_TYPE = "v2.core.batch_job.upload_timeout" + type: Literal["v2.core.batch_job.upload_timeout"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "BatchJob": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "BatchJob", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v2_core_batch_job_validating_event.py b/stripe/events/_v2_core_batch_job_validating_event.py new file mode 100644 index 000000000..c7794401e --- /dev/null +++ b/stripe/events/_v2_core_batch_job_validating_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._stripe_client import StripeClient + from stripe.v2.core._batch_job import BatchJob + + +class V2CoreBatchJobValidatingEventNotification(EventNotification): + LOOKUP_TYPE = "v2.core.batch_job.validating" + type: Literal["v2.core.batch_job.validating"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V2CoreBatchJobValidatingEvent": + return cast( + "V2CoreBatchJobValidatingEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "BatchJob": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "BatchJob", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V2CoreBatchJobValidatingEvent": + return cast( + "V2CoreBatchJobValidatingEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "BatchJob": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "BatchJob", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V2CoreBatchJobValidatingEvent(Event): + LOOKUP_TYPE = "v2.core.batch_job.validating" + type: Literal["v2.core.batch_job.validating"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "BatchJob": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "BatchJob", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v2_core_batch_job_validation_failed_event.py b/stripe/events/_v2_core_batch_job_validation_failed_event.py new file mode 100644 index 000000000..b83936b9e --- /dev/null +++ b/stripe/events/_v2_core_batch_job_validation_failed_event.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from stripe._util import get_api_mode +from stripe.v2.core._event import Event, EventNotification, RelatedObject +from typing import Any, Dict, cast +from typing_extensions import Literal, TYPE_CHECKING, override + +if TYPE_CHECKING: + from stripe._stripe_client import StripeClient + from stripe.v2.core._batch_job import BatchJob + + +class V2CoreBatchJobValidationFailedEventNotification(EventNotification): + LOOKUP_TYPE = "v2.core.batch_job.validation_failed" + type: Literal["v2.core.batch_job.validation_failed"] + related_object: RelatedObject + + def __init__( + self, parsed_body: Dict[str, Any], client: "StripeClient" + ) -> None: + super().__init__( + parsed_body, + client, + ) + self.related_object = RelatedObject(parsed_body["related_object"]) + + @override + def fetch_event(self) -> "V2CoreBatchJobValidationFailedEvent": + return cast( + "V2CoreBatchJobValidationFailedEvent", + super().fetch_event(), + ) + + def fetch_related_object(self) -> "BatchJob": + response = self._client.raw_request( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "BatchJob", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + @override + async def fetch_event_async(self) -> "V2CoreBatchJobValidationFailedEvent": + return cast( + "V2CoreBatchJobValidationFailedEvent", + await super().fetch_event_async(), + ) + + async def fetch_related_object_async(self) -> "BatchJob": + response = await self._client.raw_request_async( + "get", + self.related_object.url, + stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, + usage=["fetch_related_object"], + ) + return cast( + "BatchJob", + self._client.deserialize( + response, + api_mode=get_api_mode(self.related_object.url), + ), + ) + + +class V2CoreBatchJobValidationFailedEvent(Event): + LOOKUP_TYPE = "v2.core.batch_job.validation_failed" + type: Literal["v2.core.batch_job.validation_failed"] + + class RelatedObject(StripeObject): + id: str + """ + Unique identifier for the object relevant to the event. + """ + type: str + """ + Type of the object relevant to the event. + """ + url: str + """ + URL to retrieve the resource. + """ + + related_object: RelatedObject + """ + Object containing the reference to API resource relevant to the event + """ + + def fetch_related_object(self) -> "BatchJob": + """ + Retrieves the related object from the API. Makes an API request on every call. + """ + return cast( + "BatchJob", + self._requestor.request( + "get", + self.related_object.url, + base_address="api", + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, + ), + ) diff --git a/stripe/events/_v2_money_management_adjustment_created_event.py b/stripe/events/_v2_money_management_adjustment_created_event.py index f15e1eef3..f893d7a2f 100644 --- a/stripe/events/_v2_money_management_adjustment_created_event.py +++ b/stripe/events/_v2_money_management_adjustment_created_event.py @@ -37,6 +37,7 @@ def fetch_related_object(self) -> "Adjustment": "get", self.related_object.url, stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, usage=["fetch_related_object"], ) return cast( @@ -61,6 +62,7 @@ async def fetch_related_object_async(self) -> "Adjustment": "get", self.related_object.url, stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, usage=["fetch_related_object"], ) return cast( @@ -105,6 +107,9 @@ def fetch_related_object(self) -> "Adjustment": "get", self.related_object.url, base_address="api", - options={"stripe_context": self.context}, + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, ), ) diff --git a/stripe/events/_v2_money_management_financial_account_created_event.py b/stripe/events/_v2_money_management_financial_account_created_event.py index 84980d1c5..7e46f8d4d 100644 --- a/stripe/events/_v2_money_management_financial_account_created_event.py +++ b/stripe/events/_v2_money_management_financial_account_created_event.py @@ -39,6 +39,7 @@ def fetch_related_object(self) -> "FinancialAccount": "get", self.related_object.url, stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, usage=["fetch_related_object"], ) return cast( @@ -63,6 +64,7 @@ async def fetch_related_object_async(self) -> "FinancialAccount": "get", self.related_object.url, stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, usage=["fetch_related_object"], ) return cast( @@ -107,6 +109,9 @@ def fetch_related_object(self) -> "FinancialAccount": "get", self.related_object.url, base_address="api", - options={"stripe_context": self.context}, + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, ), ) diff --git a/stripe/events/_v2_money_management_financial_account_updated_event.py b/stripe/events/_v2_money_management_financial_account_updated_event.py index 6a2abd0bc..5651dc6bb 100644 --- a/stripe/events/_v2_money_management_financial_account_updated_event.py +++ b/stripe/events/_v2_money_management_financial_account_updated_event.py @@ -39,6 +39,7 @@ def fetch_related_object(self) -> "FinancialAccount": "get", self.related_object.url, stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, usage=["fetch_related_object"], ) return cast( @@ -63,6 +64,7 @@ async def fetch_related_object_async(self) -> "FinancialAccount": "get", self.related_object.url, stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, usage=["fetch_related_object"], ) return cast( @@ -107,6 +109,9 @@ def fetch_related_object(self) -> "FinancialAccount": "get", self.related_object.url, base_address="api", - options={"stripe_context": self.context}, + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, ), ) diff --git a/stripe/events/_v2_money_management_financial_address_activated_event.py b/stripe/events/_v2_money_management_financial_address_activated_event.py index e17cb8b83..3d1b4e4dd 100644 --- a/stripe/events/_v2_money_management_financial_address_activated_event.py +++ b/stripe/events/_v2_money_management_financial_address_activated_event.py @@ -39,6 +39,7 @@ def fetch_related_object(self) -> "FinancialAddress": "get", self.related_object.url, stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, usage=["fetch_related_object"], ) return cast( @@ -63,6 +64,7 @@ async def fetch_related_object_async(self) -> "FinancialAddress": "get", self.related_object.url, stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, usage=["fetch_related_object"], ) return cast( @@ -107,6 +109,9 @@ def fetch_related_object(self) -> "FinancialAddress": "get", self.related_object.url, base_address="api", - options={"stripe_context": self.context}, + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, ), ) diff --git a/stripe/events/_v2_money_management_financial_address_failed_event.py b/stripe/events/_v2_money_management_financial_address_failed_event.py index afd3c8dfc..4e8061943 100644 --- a/stripe/events/_v2_money_management_financial_address_failed_event.py +++ b/stripe/events/_v2_money_management_financial_address_failed_event.py @@ -39,6 +39,7 @@ def fetch_related_object(self) -> "FinancialAddress": "get", self.related_object.url, stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, usage=["fetch_related_object"], ) return cast( @@ -63,6 +64,7 @@ async def fetch_related_object_async(self) -> "FinancialAddress": "get", self.related_object.url, stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, usage=["fetch_related_object"], ) return cast( @@ -107,6 +109,9 @@ def fetch_related_object(self) -> "FinancialAddress": "get", self.related_object.url, base_address="api", - options={"stripe_context": self.context}, + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, ), ) diff --git a/stripe/events/_v2_money_management_inbound_transfer_available_event.py b/stripe/events/_v2_money_management_inbound_transfer_available_event.py index a675283fb..634f28804 100644 --- a/stripe/events/_v2_money_management_inbound_transfer_available_event.py +++ b/stripe/events/_v2_money_management_inbound_transfer_available_event.py @@ -42,6 +42,7 @@ def fetch_related_object(self) -> "InboundTransfer": "get", self.related_object.url, stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, usage=["fetch_related_object"], ) return cast( @@ -66,6 +67,7 @@ async def fetch_related_object_async(self) -> "InboundTransfer": "get", self.related_object.url, stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, usage=["fetch_related_object"], ) return cast( @@ -145,6 +147,9 @@ def fetch_related_object(self) -> "InboundTransfer": "get", self.related_object.url, base_address="api", - options={"stripe_context": self.context}, + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, ), ) diff --git a/stripe/events/_v2_money_management_inbound_transfer_bank_debit_failed_event.py b/stripe/events/_v2_money_management_inbound_transfer_bank_debit_failed_event.py index 037dc0329..ce9b59921 100644 --- a/stripe/events/_v2_money_management_inbound_transfer_bank_debit_failed_event.py +++ b/stripe/events/_v2_money_management_inbound_transfer_bank_debit_failed_event.py @@ -41,6 +41,7 @@ def fetch_related_object(self) -> "InboundTransfer": "get", self.related_object.url, stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, usage=["fetch_related_object"], ) return cast( @@ -65,6 +66,7 @@ async def fetch_related_object_async(self) -> "InboundTransfer": "get", self.related_object.url, stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, usage=["fetch_related_object"], ) return cast( @@ -109,6 +111,9 @@ def fetch_related_object(self) -> "InboundTransfer": "get", self.related_object.url, base_address="api", - options={"stripe_context": self.context}, + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, ), ) diff --git a/stripe/events/_v2_money_management_inbound_transfer_bank_debit_processing_event.py b/stripe/events/_v2_money_management_inbound_transfer_bank_debit_processing_event.py index 35d17875a..89af0838d 100644 --- a/stripe/events/_v2_money_management_inbound_transfer_bank_debit_processing_event.py +++ b/stripe/events/_v2_money_management_inbound_transfer_bank_debit_processing_event.py @@ -41,6 +41,7 @@ def fetch_related_object(self) -> "InboundTransfer": "get", self.related_object.url, stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, usage=["fetch_related_object"], ) return cast( @@ -65,6 +66,7 @@ async def fetch_related_object_async(self) -> "InboundTransfer": "get", self.related_object.url, stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, usage=["fetch_related_object"], ) return cast( @@ -109,6 +111,9 @@ def fetch_related_object(self) -> "InboundTransfer": "get", self.related_object.url, base_address="api", - options={"stripe_context": self.context}, + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, ), ) diff --git a/stripe/events/_v2_money_management_inbound_transfer_bank_debit_queued_event.py b/stripe/events/_v2_money_management_inbound_transfer_bank_debit_queued_event.py index f8acb4553..89063b7f3 100644 --- a/stripe/events/_v2_money_management_inbound_transfer_bank_debit_queued_event.py +++ b/stripe/events/_v2_money_management_inbound_transfer_bank_debit_queued_event.py @@ -41,6 +41,7 @@ def fetch_related_object(self) -> "InboundTransfer": "get", self.related_object.url, stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, usage=["fetch_related_object"], ) return cast( @@ -65,6 +66,7 @@ async def fetch_related_object_async(self) -> "InboundTransfer": "get", self.related_object.url, stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, usage=["fetch_related_object"], ) return cast( @@ -109,6 +111,9 @@ def fetch_related_object(self) -> "InboundTransfer": "get", self.related_object.url, base_address="api", - options={"stripe_context": self.context}, + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, ), ) diff --git a/stripe/events/_v2_money_management_inbound_transfer_bank_debit_returned_event.py b/stripe/events/_v2_money_management_inbound_transfer_bank_debit_returned_event.py index 916aa81df..021d63798 100644 --- a/stripe/events/_v2_money_management_inbound_transfer_bank_debit_returned_event.py +++ b/stripe/events/_v2_money_management_inbound_transfer_bank_debit_returned_event.py @@ -41,6 +41,7 @@ def fetch_related_object(self) -> "InboundTransfer": "get", self.related_object.url, stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, usage=["fetch_related_object"], ) return cast( @@ -65,6 +66,7 @@ async def fetch_related_object_async(self) -> "InboundTransfer": "get", self.related_object.url, stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, usage=["fetch_related_object"], ) return cast( @@ -109,6 +111,9 @@ def fetch_related_object(self) -> "InboundTransfer": "get", self.related_object.url, base_address="api", - options={"stripe_context": self.context}, + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, ), ) diff --git a/stripe/events/_v2_money_management_inbound_transfer_bank_debit_succeeded_event.py b/stripe/events/_v2_money_management_inbound_transfer_bank_debit_succeeded_event.py index 256c91451..5647fc852 100644 --- a/stripe/events/_v2_money_management_inbound_transfer_bank_debit_succeeded_event.py +++ b/stripe/events/_v2_money_management_inbound_transfer_bank_debit_succeeded_event.py @@ -41,6 +41,7 @@ def fetch_related_object(self) -> "InboundTransfer": "get", self.related_object.url, stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, usage=["fetch_related_object"], ) return cast( @@ -65,6 +66,7 @@ async def fetch_related_object_async(self) -> "InboundTransfer": "get", self.related_object.url, stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, usage=["fetch_related_object"], ) return cast( @@ -109,6 +111,9 @@ def fetch_related_object(self) -> "InboundTransfer": "get", self.related_object.url, base_address="api", - options={"stripe_context": self.context}, + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, ), ) diff --git a/stripe/events/_v2_money_management_outbound_payment_canceled_event.py b/stripe/events/_v2_money_management_outbound_payment_canceled_event.py index 15f95dd5a..915eeee49 100644 --- a/stripe/events/_v2_money_management_outbound_payment_canceled_event.py +++ b/stripe/events/_v2_money_management_outbound_payment_canceled_event.py @@ -39,6 +39,7 @@ def fetch_related_object(self) -> "OutboundPayment": "get", self.related_object.url, stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, usage=["fetch_related_object"], ) return cast( @@ -63,6 +64,7 @@ async def fetch_related_object_async(self) -> "OutboundPayment": "get", self.related_object.url, stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, usage=["fetch_related_object"], ) return cast( @@ -107,6 +109,9 @@ def fetch_related_object(self) -> "OutboundPayment": "get", self.related_object.url, base_address="api", - options={"stripe_context": self.context}, + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, ), ) diff --git a/stripe/events/_v2_money_management_outbound_payment_created_event.py b/stripe/events/_v2_money_management_outbound_payment_created_event.py index 62a15eb48..e84c6587c 100644 --- a/stripe/events/_v2_money_management_outbound_payment_created_event.py +++ b/stripe/events/_v2_money_management_outbound_payment_created_event.py @@ -39,6 +39,7 @@ def fetch_related_object(self) -> "OutboundPayment": "get", self.related_object.url, stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, usage=["fetch_related_object"], ) return cast( @@ -63,6 +64,7 @@ async def fetch_related_object_async(self) -> "OutboundPayment": "get", self.related_object.url, stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, usage=["fetch_related_object"], ) return cast( @@ -107,6 +109,9 @@ def fetch_related_object(self) -> "OutboundPayment": "get", self.related_object.url, base_address="api", - options={"stripe_context": self.context}, + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, ), ) diff --git a/stripe/events/_v2_money_management_outbound_payment_failed_event.py b/stripe/events/_v2_money_management_outbound_payment_failed_event.py index 72dc74f43..018ce10d1 100644 --- a/stripe/events/_v2_money_management_outbound_payment_failed_event.py +++ b/stripe/events/_v2_money_management_outbound_payment_failed_event.py @@ -39,6 +39,7 @@ def fetch_related_object(self) -> "OutboundPayment": "get", self.related_object.url, stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, usage=["fetch_related_object"], ) return cast( @@ -63,6 +64,7 @@ async def fetch_related_object_async(self) -> "OutboundPayment": "get", self.related_object.url, stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, usage=["fetch_related_object"], ) return cast( @@ -107,6 +109,9 @@ def fetch_related_object(self) -> "OutboundPayment": "get", self.related_object.url, base_address="api", - options={"stripe_context": self.context}, + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, ), ) diff --git a/stripe/events/_v2_money_management_outbound_payment_posted_event.py b/stripe/events/_v2_money_management_outbound_payment_posted_event.py index 2d4fddee3..f748ba61b 100644 --- a/stripe/events/_v2_money_management_outbound_payment_posted_event.py +++ b/stripe/events/_v2_money_management_outbound_payment_posted_event.py @@ -39,6 +39,7 @@ def fetch_related_object(self) -> "OutboundPayment": "get", self.related_object.url, stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, usage=["fetch_related_object"], ) return cast( @@ -63,6 +64,7 @@ async def fetch_related_object_async(self) -> "OutboundPayment": "get", self.related_object.url, stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, usage=["fetch_related_object"], ) return cast( @@ -107,6 +109,9 @@ def fetch_related_object(self) -> "OutboundPayment": "get", self.related_object.url, base_address="api", - options={"stripe_context": self.context}, + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, ), ) diff --git a/stripe/events/_v2_money_management_outbound_payment_returned_event.py b/stripe/events/_v2_money_management_outbound_payment_returned_event.py index f0b45dcbc..303d509a1 100644 --- a/stripe/events/_v2_money_management_outbound_payment_returned_event.py +++ b/stripe/events/_v2_money_management_outbound_payment_returned_event.py @@ -39,6 +39,7 @@ def fetch_related_object(self) -> "OutboundPayment": "get", self.related_object.url, stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, usage=["fetch_related_object"], ) return cast( @@ -63,6 +64,7 @@ async def fetch_related_object_async(self) -> "OutboundPayment": "get", self.related_object.url, stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, usage=["fetch_related_object"], ) return cast( @@ -107,6 +109,9 @@ def fetch_related_object(self) -> "OutboundPayment": "get", self.related_object.url, base_address="api", - options={"stripe_context": self.context}, + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, ), ) diff --git a/stripe/events/_v2_money_management_outbound_payment_updated_event.py b/stripe/events/_v2_money_management_outbound_payment_updated_event.py index 8eaae9007..2635ff9b1 100644 --- a/stripe/events/_v2_money_management_outbound_payment_updated_event.py +++ b/stripe/events/_v2_money_management_outbound_payment_updated_event.py @@ -39,6 +39,7 @@ def fetch_related_object(self) -> "OutboundPayment": "get", self.related_object.url, stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, usage=["fetch_related_object"], ) return cast( @@ -63,6 +64,7 @@ async def fetch_related_object_async(self) -> "OutboundPayment": "get", self.related_object.url, stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, usage=["fetch_related_object"], ) return cast( @@ -107,6 +109,9 @@ def fetch_related_object(self) -> "OutboundPayment": "get", self.related_object.url, base_address="api", - options={"stripe_context": self.context}, + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, ), ) diff --git a/stripe/events/_v2_money_management_outbound_transfer_canceled_event.py b/stripe/events/_v2_money_management_outbound_transfer_canceled_event.py index 58b1630bd..3adc00e4c 100644 --- a/stripe/events/_v2_money_management_outbound_transfer_canceled_event.py +++ b/stripe/events/_v2_money_management_outbound_transfer_canceled_event.py @@ -39,6 +39,7 @@ def fetch_related_object(self) -> "OutboundTransfer": "get", self.related_object.url, stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, usage=["fetch_related_object"], ) return cast( @@ -63,6 +64,7 @@ async def fetch_related_object_async(self) -> "OutboundTransfer": "get", self.related_object.url, stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, usage=["fetch_related_object"], ) return cast( @@ -107,6 +109,9 @@ def fetch_related_object(self) -> "OutboundTransfer": "get", self.related_object.url, base_address="api", - options={"stripe_context": self.context}, + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, ), ) diff --git a/stripe/events/_v2_money_management_outbound_transfer_created_event.py b/stripe/events/_v2_money_management_outbound_transfer_created_event.py index 1f71768ec..7687bbab3 100644 --- a/stripe/events/_v2_money_management_outbound_transfer_created_event.py +++ b/stripe/events/_v2_money_management_outbound_transfer_created_event.py @@ -39,6 +39,7 @@ def fetch_related_object(self) -> "OutboundTransfer": "get", self.related_object.url, stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, usage=["fetch_related_object"], ) return cast( @@ -63,6 +64,7 @@ async def fetch_related_object_async(self) -> "OutboundTransfer": "get", self.related_object.url, stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, usage=["fetch_related_object"], ) return cast( @@ -107,6 +109,9 @@ def fetch_related_object(self) -> "OutboundTransfer": "get", self.related_object.url, base_address="api", - options={"stripe_context": self.context}, + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, ), ) diff --git a/stripe/events/_v2_money_management_outbound_transfer_failed_event.py b/stripe/events/_v2_money_management_outbound_transfer_failed_event.py index 45587a302..def1cfbb7 100644 --- a/stripe/events/_v2_money_management_outbound_transfer_failed_event.py +++ b/stripe/events/_v2_money_management_outbound_transfer_failed_event.py @@ -39,6 +39,7 @@ def fetch_related_object(self) -> "OutboundTransfer": "get", self.related_object.url, stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, usage=["fetch_related_object"], ) return cast( @@ -63,6 +64,7 @@ async def fetch_related_object_async(self) -> "OutboundTransfer": "get", self.related_object.url, stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, usage=["fetch_related_object"], ) return cast( @@ -107,6 +109,9 @@ def fetch_related_object(self) -> "OutboundTransfer": "get", self.related_object.url, base_address="api", - options={"stripe_context": self.context}, + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, ), ) diff --git a/stripe/events/_v2_money_management_outbound_transfer_posted_event.py b/stripe/events/_v2_money_management_outbound_transfer_posted_event.py index 03373764f..f6a3681dc 100644 --- a/stripe/events/_v2_money_management_outbound_transfer_posted_event.py +++ b/stripe/events/_v2_money_management_outbound_transfer_posted_event.py @@ -39,6 +39,7 @@ def fetch_related_object(self) -> "OutboundTransfer": "get", self.related_object.url, stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, usage=["fetch_related_object"], ) return cast( @@ -63,6 +64,7 @@ async def fetch_related_object_async(self) -> "OutboundTransfer": "get", self.related_object.url, stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, usage=["fetch_related_object"], ) return cast( @@ -107,6 +109,9 @@ def fetch_related_object(self) -> "OutboundTransfer": "get", self.related_object.url, base_address="api", - options={"stripe_context": self.context}, + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, ), ) diff --git a/stripe/events/_v2_money_management_outbound_transfer_returned_event.py b/stripe/events/_v2_money_management_outbound_transfer_returned_event.py index c7d154b04..5bf6a7b4c 100644 --- a/stripe/events/_v2_money_management_outbound_transfer_returned_event.py +++ b/stripe/events/_v2_money_management_outbound_transfer_returned_event.py @@ -39,6 +39,7 @@ def fetch_related_object(self) -> "OutboundTransfer": "get", self.related_object.url, stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, usage=["fetch_related_object"], ) return cast( @@ -63,6 +64,7 @@ async def fetch_related_object_async(self) -> "OutboundTransfer": "get", self.related_object.url, stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, usage=["fetch_related_object"], ) return cast( @@ -107,6 +109,9 @@ def fetch_related_object(self) -> "OutboundTransfer": "get", self.related_object.url, base_address="api", - options={"stripe_context": self.context}, + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, ), ) diff --git a/stripe/events/_v2_money_management_outbound_transfer_updated_event.py b/stripe/events/_v2_money_management_outbound_transfer_updated_event.py index 00d9debe5..875381d3c 100644 --- a/stripe/events/_v2_money_management_outbound_transfer_updated_event.py +++ b/stripe/events/_v2_money_management_outbound_transfer_updated_event.py @@ -39,6 +39,7 @@ def fetch_related_object(self) -> "OutboundTransfer": "get", self.related_object.url, stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, usage=["fetch_related_object"], ) return cast( @@ -63,6 +64,7 @@ async def fetch_related_object_async(self) -> "OutboundTransfer": "get", self.related_object.url, stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, usage=["fetch_related_object"], ) return cast( @@ -107,6 +109,9 @@ def fetch_related_object(self) -> "OutboundTransfer": "get", self.related_object.url, base_address="api", - options={"stripe_context": self.context}, + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, ), ) diff --git a/stripe/events/_v2_money_management_payout_method_created_event.py b/stripe/events/_v2_money_management_payout_method_created_event.py index 3e5123c10..2a1656091 100644 --- a/stripe/events/_v2_money_management_payout_method_created_event.py +++ b/stripe/events/_v2_money_management_payout_method_created_event.py @@ -37,6 +37,7 @@ def fetch_related_object(self) -> "PayoutMethod": "get", self.related_object.url, stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, usage=["fetch_related_object"], ) return cast( @@ -61,6 +62,7 @@ async def fetch_related_object_async(self) -> "PayoutMethod": "get", self.related_object.url, stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, usage=["fetch_related_object"], ) return cast( @@ -105,6 +107,9 @@ def fetch_related_object(self) -> "PayoutMethod": "get", self.related_object.url, base_address="api", - options={"stripe_context": self.context}, + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, ), ) diff --git a/stripe/events/_v2_money_management_payout_method_updated_event.py b/stripe/events/_v2_money_management_payout_method_updated_event.py index 1c0ed4f18..205893398 100644 --- a/stripe/events/_v2_money_management_payout_method_updated_event.py +++ b/stripe/events/_v2_money_management_payout_method_updated_event.py @@ -37,6 +37,7 @@ def fetch_related_object(self) -> "PayoutMethod": "get", self.related_object.url, stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, usage=["fetch_related_object"], ) return cast( @@ -61,6 +62,7 @@ async def fetch_related_object_async(self) -> "PayoutMethod": "get", self.related_object.url, stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, usage=["fetch_related_object"], ) return cast( @@ -105,6 +107,9 @@ def fetch_related_object(self) -> "PayoutMethod": "get", self.related_object.url, base_address="api", - options={"stripe_context": self.context}, + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, ), ) diff --git a/stripe/events/_v2_money_management_received_credit_available_event.py b/stripe/events/_v2_money_management_received_credit_available_event.py index 676a66196..fd8dfd13b 100644 --- a/stripe/events/_v2_money_management_received_credit_available_event.py +++ b/stripe/events/_v2_money_management_received_credit_available_event.py @@ -42,6 +42,7 @@ def fetch_related_object(self) -> "ReceivedCredit": "get", self.related_object.url, stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, usage=["fetch_related_object"], ) return cast( @@ -66,6 +67,7 @@ async def fetch_related_object_async(self) -> "ReceivedCredit": "get", self.related_object.url, stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, usage=["fetch_related_object"], ) return cast( @@ -145,6 +147,9 @@ def fetch_related_object(self) -> "ReceivedCredit": "get", self.related_object.url, base_address="api", - options={"stripe_context": self.context}, + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, ), ) diff --git a/stripe/events/_v2_money_management_received_credit_failed_event.py b/stripe/events/_v2_money_management_received_credit_failed_event.py index f8e851b58..ed993ebed 100644 --- a/stripe/events/_v2_money_management_received_credit_failed_event.py +++ b/stripe/events/_v2_money_management_received_credit_failed_event.py @@ -39,6 +39,7 @@ def fetch_related_object(self) -> "ReceivedCredit": "get", self.related_object.url, stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, usage=["fetch_related_object"], ) return cast( @@ -63,6 +64,7 @@ async def fetch_related_object_async(self) -> "ReceivedCredit": "get", self.related_object.url, stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, usage=["fetch_related_object"], ) return cast( @@ -107,6 +109,9 @@ def fetch_related_object(self) -> "ReceivedCredit": "get", self.related_object.url, base_address="api", - options={"stripe_context": self.context}, + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, ), ) diff --git a/stripe/events/_v2_money_management_received_credit_returned_event.py b/stripe/events/_v2_money_management_received_credit_returned_event.py index 530bf7d95..2e301c931 100644 --- a/stripe/events/_v2_money_management_received_credit_returned_event.py +++ b/stripe/events/_v2_money_management_received_credit_returned_event.py @@ -39,6 +39,7 @@ def fetch_related_object(self) -> "ReceivedCredit": "get", self.related_object.url, stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, usage=["fetch_related_object"], ) return cast( @@ -63,6 +64,7 @@ async def fetch_related_object_async(self) -> "ReceivedCredit": "get", self.related_object.url, stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, usage=["fetch_related_object"], ) return cast( @@ -107,6 +109,9 @@ def fetch_related_object(self) -> "ReceivedCredit": "get", self.related_object.url, base_address="api", - options={"stripe_context": self.context}, + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, ), ) diff --git a/stripe/events/_v2_money_management_received_credit_succeeded_event.py b/stripe/events/_v2_money_management_received_credit_succeeded_event.py index 2e2520da2..238605ccf 100644 --- a/stripe/events/_v2_money_management_received_credit_succeeded_event.py +++ b/stripe/events/_v2_money_management_received_credit_succeeded_event.py @@ -39,6 +39,7 @@ def fetch_related_object(self) -> "ReceivedCredit": "get", self.related_object.url, stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, usage=["fetch_related_object"], ) return cast( @@ -63,6 +64,7 @@ async def fetch_related_object_async(self) -> "ReceivedCredit": "get", self.related_object.url, stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, usage=["fetch_related_object"], ) return cast( @@ -107,6 +109,9 @@ def fetch_related_object(self) -> "ReceivedCredit": "get", self.related_object.url, base_address="api", - options={"stripe_context": self.context}, + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, ), ) diff --git a/stripe/events/_v2_money_management_received_debit_canceled_event.py b/stripe/events/_v2_money_management_received_debit_canceled_event.py index 7add70abc..6ea4fb506 100644 --- a/stripe/events/_v2_money_management_received_debit_canceled_event.py +++ b/stripe/events/_v2_money_management_received_debit_canceled_event.py @@ -39,6 +39,7 @@ def fetch_related_object(self) -> "ReceivedDebit": "get", self.related_object.url, stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, usage=["fetch_related_object"], ) return cast( @@ -63,6 +64,7 @@ async def fetch_related_object_async(self) -> "ReceivedDebit": "get", self.related_object.url, stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, usage=["fetch_related_object"], ) return cast( @@ -107,6 +109,9 @@ def fetch_related_object(self) -> "ReceivedDebit": "get", self.related_object.url, base_address="api", - options={"stripe_context": self.context}, + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, ), ) diff --git a/stripe/events/_v2_money_management_received_debit_failed_event.py b/stripe/events/_v2_money_management_received_debit_failed_event.py index b6edf869e..fc707064b 100644 --- a/stripe/events/_v2_money_management_received_debit_failed_event.py +++ b/stripe/events/_v2_money_management_received_debit_failed_event.py @@ -37,6 +37,7 @@ def fetch_related_object(self) -> "ReceivedDebit": "get", self.related_object.url, stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, usage=["fetch_related_object"], ) return cast( @@ -61,6 +62,7 @@ async def fetch_related_object_async(self) -> "ReceivedDebit": "get", self.related_object.url, stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, usage=["fetch_related_object"], ) return cast( @@ -105,6 +107,9 @@ def fetch_related_object(self) -> "ReceivedDebit": "get", self.related_object.url, base_address="api", - options={"stripe_context": self.context}, + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, ), ) diff --git a/stripe/events/_v2_money_management_received_debit_pending_event.py b/stripe/events/_v2_money_management_received_debit_pending_event.py index 701aad393..0f0cc6200 100644 --- a/stripe/events/_v2_money_management_received_debit_pending_event.py +++ b/stripe/events/_v2_money_management_received_debit_pending_event.py @@ -39,6 +39,7 @@ def fetch_related_object(self) -> "ReceivedDebit": "get", self.related_object.url, stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, usage=["fetch_related_object"], ) return cast( @@ -63,6 +64,7 @@ async def fetch_related_object_async(self) -> "ReceivedDebit": "get", self.related_object.url, stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, usage=["fetch_related_object"], ) return cast( @@ -107,6 +109,9 @@ def fetch_related_object(self) -> "ReceivedDebit": "get", self.related_object.url, base_address="api", - options={"stripe_context": self.context}, + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, ), ) diff --git a/stripe/events/_v2_money_management_received_debit_succeeded_event.py b/stripe/events/_v2_money_management_received_debit_succeeded_event.py index bcb06e10a..082408116 100644 --- a/stripe/events/_v2_money_management_received_debit_succeeded_event.py +++ b/stripe/events/_v2_money_management_received_debit_succeeded_event.py @@ -39,6 +39,7 @@ def fetch_related_object(self) -> "ReceivedDebit": "get", self.related_object.url, stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, usage=["fetch_related_object"], ) return cast( @@ -63,6 +64,7 @@ async def fetch_related_object_async(self) -> "ReceivedDebit": "get", self.related_object.url, stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, usage=["fetch_related_object"], ) return cast( @@ -107,6 +109,9 @@ def fetch_related_object(self) -> "ReceivedDebit": "get", self.related_object.url, base_address="api", - options={"stripe_context": self.context}, + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, ), ) diff --git a/stripe/events/_v2_money_management_received_debit_updated_event.py b/stripe/events/_v2_money_management_received_debit_updated_event.py index ca89d6795..8a842cf48 100644 --- a/stripe/events/_v2_money_management_received_debit_updated_event.py +++ b/stripe/events/_v2_money_management_received_debit_updated_event.py @@ -39,6 +39,7 @@ def fetch_related_object(self) -> "ReceivedDebit": "get", self.related_object.url, stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, usage=["fetch_related_object"], ) return cast( @@ -63,6 +64,7 @@ async def fetch_related_object_async(self) -> "ReceivedDebit": "get", self.related_object.url, stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, usage=["fetch_related_object"], ) return cast( @@ -107,6 +109,9 @@ def fetch_related_object(self) -> "ReceivedDebit": "get", self.related_object.url, base_address="api", - options={"stripe_context": self.context}, + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, ), ) diff --git a/stripe/events/_v2_money_management_transaction_created_event.py b/stripe/events/_v2_money_management_transaction_created_event.py index d9d137098..45ff9b3c1 100644 --- a/stripe/events/_v2_money_management_transaction_created_event.py +++ b/stripe/events/_v2_money_management_transaction_created_event.py @@ -40,6 +40,7 @@ def fetch_related_object(self) -> "Transaction": "get", self.related_object.url, stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, usage=["fetch_related_object"], ) return cast( @@ -64,6 +65,7 @@ async def fetch_related_object_async(self) -> "Transaction": "get", self.related_object.url, stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, usage=["fetch_related_object"], ) return cast( @@ -143,6 +145,9 @@ def fetch_related_object(self) -> "Transaction": "get", self.related_object.url, base_address="api", - options={"stripe_context": self.context}, + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, ), ) diff --git a/stripe/events/_v2_money_management_transaction_updated_event.py b/stripe/events/_v2_money_management_transaction_updated_event.py index d7a588e6c..affb5f9b9 100644 --- a/stripe/events/_v2_money_management_transaction_updated_event.py +++ b/stripe/events/_v2_money_management_transaction_updated_event.py @@ -37,6 +37,7 @@ def fetch_related_object(self) -> "Transaction": "get", self.related_object.url, stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, usage=["fetch_related_object"], ) return cast( @@ -61,6 +62,7 @@ async def fetch_related_object_async(self) -> "Transaction": "get", self.related_object.url, stripe_context=self.context, + headers={"Stripe-Request-Trigger": f"event={self.id}"}, usage=["fetch_related_object"], ) return cast( @@ -105,6 +107,9 @@ def fetch_related_object(self) -> "Transaction": "get", self.related_object.url, base_address="api", - options={"stripe_context": self.context}, + options={ + "stripe_context": self.context, + "headers": {"Stripe-Request-Trigger": f"event={self.id}"}, + }, ), ) diff --git a/stripe/financial_connections/_account.py b/stripe/financial_connections/_account.py index 0a6a3d152..612fc2468 100644 --- a/stripe/financial_connections/_account.py +++ b/stripe/financial_connections/_account.py @@ -264,7 +264,7 @@ class TransactionRefresh(StripeObject): """ livemode: bool """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ object: Literal["financial_connections.account"] """ @@ -379,7 +379,7 @@ def disconnect( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/financial_connections/accounts/{account}/disconnect".format( - account=sanitize_id(self.get("id")) + account=sanitize_id(self._data.get("id")) ), params=params, ), @@ -434,7 +434,7 @@ async def disconnect_async( # pyright: ignore[reportGeneralTypeIssues] await self._request_async( "post", "/v1/financial_connections/accounts/{account}/disconnect".format( - account=sanitize_id(self.get("id")) + account=sanitize_id(self._data.get("id")) ), params=params, ), @@ -529,7 +529,7 @@ def list_owners( # pyright: ignore[reportGeneralTypeIssues] self._request( "get", "/v1/financial_connections/accounts/{account}/owners".format( - account=sanitize_id(self.get("id")) + account=sanitize_id(self._data.get("id")) ), params=params, ), @@ -584,7 +584,7 @@ async def list_owners_async( # pyright: ignore[reportGeneralTypeIssues] await self._request_async( "get", "/v1/financial_connections/accounts/{account}/owners".format( - account=sanitize_id(self.get("id")) + account=sanitize_id(self._data.get("id")) ), params=params, ), @@ -639,7 +639,7 @@ def refresh_account( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/financial_connections/accounts/{account}/refresh".format( - account=sanitize_id(self.get("id")) + account=sanitize_id(self._data.get("id")) ), params=params, ), @@ -694,7 +694,7 @@ async def refresh_account_async( # pyright: ignore[reportGeneralTypeIssues] await self._request_async( "post", "/v1/financial_connections/accounts/{account}/refresh".format( - account=sanitize_id(self.get("id")) + account=sanitize_id(self._data.get("id")) ), params=params, ), @@ -771,7 +771,7 @@ def subscribe( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/financial_connections/accounts/{account}/subscribe".format( - account=sanitize_id(self.get("id")) + account=sanitize_id(self._data.get("id")) ), params=params, ), @@ -826,7 +826,7 @@ async def subscribe_async( # pyright: ignore[reportGeneralTypeIssues] await self._request_async( "post", "/v1/financial_connections/accounts/{account}/subscribe".format( - account=sanitize_id(self.get("id")) + account=sanitize_id(self._data.get("id")) ), params=params, ), @@ -881,7 +881,7 @@ def unsubscribe( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/financial_connections/accounts/{account}/unsubscribe".format( - account=sanitize_id(self.get("id")) + account=sanitize_id(self._data.get("id")) ), params=params, ), @@ -936,7 +936,7 @@ async def unsubscribe_async( # pyright: ignore[reportGeneralTypeIssues] await self._request_async( "post", "/v1/financial_connections/accounts/{account}/unsubscribe".format( - account=sanitize_id(self.get("id")) + account=sanitize_id(self._data.get("id")) ), params=params, ), diff --git a/stripe/financial_connections/_authorization.py b/stripe/financial_connections/_authorization.py index ec35efd8b..91fd54099 100644 --- a/stripe/financial_connections/_authorization.py +++ b/stripe/financial_connections/_authorization.py @@ -67,7 +67,7 @@ class Inactive(StripeObject): """ livemode: bool """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ object: Literal["financial_connections.authorization"] """ diff --git a/stripe/financial_connections/_institution.py b/stripe/financial_connections/_institution.py index 0d671827f..2f2df86e3 100644 --- a/stripe/financial_connections/_institution.py +++ b/stripe/financial_connections/_institution.py @@ -71,7 +71,7 @@ class Transactions(StripeObject): """ livemode: bool """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ name: str """ diff --git a/stripe/financial_connections/_session.py b/stripe/financial_connections/_session.py index 305c5c35f..78539a46e 100644 --- a/stripe/financial_connections/_session.py +++ b/stripe/financial_connections/_session.py @@ -69,6 +69,16 @@ class Filters(StripeObject): Stripe ID of the institution with which the customer should be directed to log in. """ + class Hosted(StripeObject): + delivery_method: Optional[Literal["email", "url"]] + """ + How the user enters the hosted flow. You can only use the values `email` and `url` if you provide `relink_options`. + """ + return_url: Optional[str] + """ + The URL to redirect your customer back to after they link their accounts or cancel this Session. This parameter is required if `ui_mode` is `hosted`. + """ + class Limits(StripeObject): accounts: int """ @@ -127,6 +137,10 @@ class Cancelled(StripeObject): A value that will be passed to the client to launch the authentication flow. """ filters: Optional[Filters] + hosted: Optional[Hosted] + """ + Settings for the Hosted UI mode. + """ id: str """ Unique identifier for the object. @@ -134,7 +148,7 @@ class Cancelled(StripeObject): limits: Optional[Limits] livemode: bool """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ manual_entry: Optional[ManualEntry] object: Literal["financial_connections.session"] @@ -168,6 +182,14 @@ class Cancelled(StripeObject): The current state of the session. """ status_details: Optional[StatusDetails] + ui_mode: Optional[Literal["hosted", "modal"]] + """ + The UI mode for this session. + """ + url: Optional[str] + """ + The hosted URL for this Session. Redirect customers to this URL to take them to the hosted authentication flow. This value is only present when the Session is active and the `ui_mode` is `hosted`. + """ @classmethod def create(cls, **params: Unpack["SessionCreateParams"]) -> "Session": @@ -224,6 +246,7 @@ async def retrieve_async( _inner_class_types = { "account_holder": AccountHolder, "filters": Filters, + "hosted": Hosted, "limits": Limits, "manual_entry": ManualEntry, "relink_options": RelinkOptions, diff --git a/stripe/financial_connections/_transaction.py b/stripe/financial_connections/_transaction.py index 9a5369584..970366ec2 100644 --- a/stripe/financial_connections/_transaction.py +++ b/stripe/financial_connections/_transaction.py @@ -56,7 +56,7 @@ class StatusTransitions(StripeObject): """ livemode: bool """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ object: Literal["financial_connections.transaction"] """ diff --git a/stripe/forwarding/_request.py b/stripe/forwarding/_request.py index 2c6f23971..4e3cd5e63 100644 --- a/stripe/forwarding/_request.py +++ b/stripe/forwarding/_request.py @@ -111,7 +111,7 @@ class Header(StripeObject): """ livemode: bool """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ metadata: Optional[Dict[str, str]] """ diff --git a/stripe/identity/_verification_report.py b/stripe/identity/_verification_report.py index df53ce6fb..3ffc9a0c0 100644 --- a/stripe/identity/_verification_report.py +++ b/stripe/identity/_verification_report.py @@ -396,7 +396,7 @@ class Error(StripeObject): """ livemode: bool """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ object: Literal["identity.verification_report"] """ diff --git a/stripe/identity/_verification_session.py b/stripe/identity/_verification_session.py index 374f3d5bd..60495e529 100644 --- a/stripe/identity/_verification_session.py +++ b/stripe/identity/_verification_session.py @@ -285,7 +285,7 @@ class Dob(StripeObject): """ livemode: bool """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ metadata: Dict[str, str] """ @@ -394,7 +394,7 @@ def cancel( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/identity/verification_sessions/{session}/cancel".format( - session=sanitize_id(self.get("id")) + session=sanitize_id(self._data.get("id")) ), params=params, ), @@ -457,7 +457,7 @@ async def cancel_async( # pyright: ignore[reportGeneralTypeIssues] await self._request_async( "post", "/v1/identity/verification_sessions/{session}/cancel".format( - session=sanitize_id(self.get("id")) + session=sanitize_id(self._data.get("id")) ), params=params, ), @@ -708,7 +708,7 @@ def redact( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/identity/verification_sessions/{session}/redact".format( - session=sanitize_id(self.get("id")) + session=sanitize_id(self._data.get("id")) ), params=params, ), @@ -835,7 +835,7 @@ async def redact_async( # pyright: ignore[reportGeneralTypeIssues] await self._request_async( "post", "/v1/identity/verification_sessions/{session}/redact".format( - session=sanitize_id(self.get("id")) + session=sanitize_id(self._data.get("id")) ), params=params, ), diff --git a/stripe/issuing/_authorization.py b/stripe/issuing/_authorization.py index 55dbb593d..e892cda27 100644 --- a/stripe/issuing/_authorization.py +++ b/stripe/issuing/_authorization.py @@ -543,7 +543,7 @@ class ThreeDSecure(StripeObject): """ livemode: bool """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ merchant_amount: int """ @@ -653,7 +653,7 @@ def approve( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/issuing/authorizations/{authorization}/approve".format( - authorization=sanitize_id(self.get("id")) + authorization=sanitize_id(self._data.get("id")) ), params=params, ), @@ -712,7 +712,7 @@ async def approve_async( # pyright: ignore[reportGeneralTypeIssues] await self._request_async( "post", "/v1/issuing/authorizations/{authorization}/approve".format( - authorization=sanitize_id(self.get("id")) + authorization=sanitize_id(self._data.get("id")) ), params=params, ), @@ -771,7 +771,7 @@ def decline( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/issuing/authorizations/{authorization}/decline".format( - authorization=sanitize_id(self.get("id")) + authorization=sanitize_id(self._data.get("id")) ), params=params, ), @@ -830,7 +830,7 @@ async def decline_async( # pyright: ignore[reportGeneralTypeIssues] await self._request_async( "post", "/v1/issuing/authorizations/{authorization}/decline".format( - authorization=sanitize_id(self.get("id")) + authorization=sanitize_id(self._data.get("id")) ), params=params, ), @@ -986,7 +986,9 @@ def capture( # pyright: ignore[reportGeneralTypeIssues] self.resource._request( "post", "/v1/test_helpers/issuing/authorizations/{authorization}/capture".format( - authorization=sanitize_id(self.resource.get("id")) + authorization=sanitize_id( + self.resource._data.get("id") + ) ), params=params, ), @@ -1043,7 +1045,9 @@ async def capture_async( # pyright: ignore[reportGeneralTypeIssues] await self.resource._request_async( "post", "/v1/test_helpers/issuing/authorizations/{authorization}/capture".format( - authorization=sanitize_id(self.resource.get("id")) + authorization=sanitize_id( + self.resource._data.get("id") + ) ), params=params, ), @@ -1132,7 +1136,9 @@ def expire( # pyright: ignore[reportGeneralTypeIssues] self.resource._request( "post", "/v1/test_helpers/issuing/authorizations/{authorization}/expire".format( - authorization=sanitize_id(self.resource.get("id")) + authorization=sanitize_id( + self.resource._data.get("id") + ) ), params=params, ), @@ -1189,7 +1195,9 @@ async def expire_async( # pyright: ignore[reportGeneralTypeIssues] await self.resource._request_async( "post", "/v1/test_helpers/issuing/authorizations/{authorization}/expire".format( - authorization=sanitize_id(self.resource.get("id")) + authorization=sanitize_id( + self.resource._data.get("id") + ) ), params=params, ), @@ -1247,7 +1255,9 @@ def finalize_amount( # pyright: ignore[reportGeneralTypeIssues] self.resource._request( "post", "/v1/test_helpers/issuing/authorizations/{authorization}/finalize_amount".format( - authorization=sanitize_id(self.resource.get("id")) + authorization=sanitize_id( + self.resource._data.get("id") + ) ), params=params, ), @@ -1305,7 +1315,9 @@ async def finalize_amount_async( # pyright: ignore[reportGeneralTypeIssues] await self.resource._request_async( "post", "/v1/test_helpers/issuing/authorizations/{authorization}/finalize_amount".format( - authorization=sanitize_id(self.resource.get("id")) + authorization=sanitize_id( + self.resource._data.get("id") + ) ), params=params, ), @@ -1363,7 +1375,9 @@ def increment( # pyright: ignore[reportGeneralTypeIssues] self.resource._request( "post", "/v1/test_helpers/issuing/authorizations/{authorization}/increment".format( - authorization=sanitize_id(self.resource.get("id")) + authorization=sanitize_id( + self.resource._data.get("id") + ) ), params=params, ), @@ -1421,7 +1435,9 @@ async def increment_async( # pyright: ignore[reportGeneralTypeIssues] await self.resource._request_async( "post", "/v1/test_helpers/issuing/authorizations/{authorization}/increment".format( - authorization=sanitize_id(self.resource.get("id")) + authorization=sanitize_id( + self.resource._data.get("id") + ) ), params=params, ), @@ -1478,7 +1494,9 @@ def respond( # pyright: ignore[reportGeneralTypeIssues] self.resource._request( "post", "/v1/test_helpers/issuing/authorizations/{authorization}/fraud_challenges/respond".format( - authorization=sanitize_id(self.resource.get("id")) + authorization=sanitize_id( + self.resource._data.get("id") + ) ), params=params, ), @@ -1535,7 +1553,9 @@ async def respond_async( # pyright: ignore[reportGeneralTypeIssues] await self.resource._request_async( "post", "/v1/test_helpers/issuing/authorizations/{authorization}/fraud_challenges/respond".format( - authorization=sanitize_id(self.resource.get("id")) + authorization=sanitize_id( + self.resource._data.get("id") + ) ), params=params, ), @@ -1592,7 +1612,9 @@ def reverse( # pyright: ignore[reportGeneralTypeIssues] self.resource._request( "post", "/v1/test_helpers/issuing/authorizations/{authorization}/reverse".format( - authorization=sanitize_id(self.resource.get("id")) + authorization=sanitize_id( + self.resource._data.get("id") + ) ), params=params, ), @@ -1649,7 +1671,9 @@ async def reverse_async( # pyright: ignore[reportGeneralTypeIssues] await self.resource._request_async( "post", "/v1/test_helpers/issuing/authorizations/{authorization}/reverse".format( - authorization=sanitize_id(self.resource.get("id")) + authorization=sanitize_id( + self.resource._data.get("id") + ) ), params=params, ), diff --git a/stripe/issuing/_card.py b/stripe/issuing/_card.py index c45204df3..0d04fcd48 100644 --- a/stripe/issuing/_card.py +++ b/stripe/issuing/_card.py @@ -59,6 +59,16 @@ class LatestFraudWarning(StripeObject): The type of fraud warning that most recently took place on this card. This field updates with every new fraud warning, so the value changes over time. If populated, cancel and reissue the card. """ + class LifecycleControls(StripeObject): + class CancelAfter(StripeObject): + payment_count: int + """ + The card is automatically cancelled when it makes this number of non-zero payment authorizations and transactions. The count includes penny authorizations, but doesn't include non-payment actions, such as authorization advice. + """ + + cancel_after: CancelAfter + _inner_class_types = {"cancel_after": CancelAfter} + class Shipping(StripeObject): class Address(StripeObject): city: Optional[str] @@ -1247,9 +1257,13 @@ class GooglePay(StripeObject): """ Stripe's assessment of whether this card's details have been compromised. If this property isn't null, cancel and reissue the card to prevent fraudulent activity risk. """ + lifecycle_controls: Optional[LifecycleControls] + """ + Rules that control the lifecycle of this card, such as automatic cancellation. Refer to our [documentation](https://docs.stripe.com/issuing/controls/lifecycle-controls) for more details. + """ livemode: bool """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ metadata: Dict[str, str] """ @@ -1477,7 +1491,7 @@ def deliver_card( # pyright: ignore[reportGeneralTypeIssues] self.resource._request( "post", "/v1/test_helpers/issuing/cards/{card}/shipping/deliver".format( - card=sanitize_id(self.resource.get("id")) + card=sanitize_id(self.resource._data.get("id")) ), params=params, ), @@ -1532,7 +1546,7 @@ async def deliver_card_async( # pyright: ignore[reportGeneralTypeIssues] await self.resource._request_async( "post", "/v1/test_helpers/issuing/cards/{card}/shipping/deliver".format( - card=sanitize_id(self.resource.get("id")) + card=sanitize_id(self.resource._data.get("id")) ), params=params, ), @@ -1585,7 +1599,7 @@ def fail_card( # pyright: ignore[reportGeneralTypeIssues] self.resource._request( "post", "/v1/test_helpers/issuing/cards/{card}/shipping/fail".format( - card=sanitize_id(self.resource.get("id")) + card=sanitize_id(self.resource._data.get("id")) ), params=params, ), @@ -1640,7 +1654,7 @@ async def fail_card_async( # pyright: ignore[reportGeneralTypeIssues] await self.resource._request_async( "post", "/v1/test_helpers/issuing/cards/{card}/shipping/fail".format( - card=sanitize_id(self.resource.get("id")) + card=sanitize_id(self.resource._data.get("id")) ), params=params, ), @@ -1695,7 +1709,7 @@ def return_card( # pyright: ignore[reportGeneralTypeIssues] self.resource._request( "post", "/v1/test_helpers/issuing/cards/{card}/shipping/return".format( - card=sanitize_id(self.resource.get("id")) + card=sanitize_id(self.resource._data.get("id")) ), params=params, ), @@ -1750,7 +1764,7 @@ async def return_card_async( # pyright: ignore[reportGeneralTypeIssues] await self.resource._request_async( "post", "/v1/test_helpers/issuing/cards/{card}/shipping/return".format( - card=sanitize_id(self.resource.get("id")) + card=sanitize_id(self.resource._data.get("id")) ), params=params, ), @@ -1803,7 +1817,7 @@ def ship_card( # pyright: ignore[reportGeneralTypeIssues] self.resource._request( "post", "/v1/test_helpers/issuing/cards/{card}/shipping/ship".format( - card=sanitize_id(self.resource.get("id")) + card=sanitize_id(self.resource._data.get("id")) ), params=params, ), @@ -1858,7 +1872,7 @@ async def ship_card_async( # pyright: ignore[reportGeneralTypeIssues] await self.resource._request_async( "post", "/v1/test_helpers/issuing/cards/{card}/shipping/ship".format( - card=sanitize_id(self.resource.get("id")) + card=sanitize_id(self.resource._data.get("id")) ), params=params, ), @@ -1913,7 +1927,7 @@ def submit_card( # pyright: ignore[reportGeneralTypeIssues] self.resource._request( "post", "/v1/test_helpers/issuing/cards/{card}/shipping/submit".format( - card=sanitize_id(self.resource.get("id")) + card=sanitize_id(self.resource._data.get("id")) ), params=params, ), @@ -1968,7 +1982,7 @@ async def submit_card_async( # pyright: ignore[reportGeneralTypeIssues] await self.resource._request_async( "post", "/v1/test_helpers/issuing/cards/{card}/shipping/submit".format( - card=sanitize_id(self.resource.get("id")) + card=sanitize_id(self.resource._data.get("id")) ), params=params, ), @@ -1980,6 +1994,7 @@ def test_helpers(self): _inner_class_types = { "latest_fraud_warning": LatestFraudWarning, + "lifecycle_controls": LifecycleControls, "shipping": Shipping, "spending_controls": SpendingControls, "wallets": Wallets, diff --git a/stripe/issuing/_cardholder.py b/stripe/issuing/_cardholder.py index 15aecebe0..d3df65b6c 100644 --- a/stripe/issuing/_cardholder.py +++ b/stripe/issuing/_cardholder.py @@ -1156,7 +1156,7 @@ class SpendingLimit(StripeObject): """ livemode: bool """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ metadata: Dict[str, str] """ diff --git a/stripe/issuing/_credit_underwriting_record.py b/stripe/issuing/_credit_underwriting_record.py index 1801bfbce..71f8fe9af 100644 --- a/stripe/issuing/_credit_underwriting_record.py +++ b/stripe/issuing/_credit_underwriting_record.py @@ -412,7 +412,7 @@ class UnderwritingException(StripeObject): """ livemode: bool """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ metadata: Optional[Dict[str, str]] """ @@ -485,7 +485,9 @@ def correct( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/issuing/credit_underwriting_records/{credit_underwriting_record}/correct".format( - credit_underwriting_record=sanitize_id(self.get("id")) + credit_underwriting_record=sanitize_id( + self._data.get("id") + ) ), params=params, ), @@ -545,7 +547,9 @@ async def correct_async( # pyright: ignore[reportGeneralTypeIssues] await self._request_async( "post", "/v1/issuing/credit_underwriting_records/{credit_underwriting_record}/correct".format( - credit_underwriting_record=sanitize_id(self.get("id")) + credit_underwriting_record=sanitize_id( + self._data.get("id") + ) ), params=params, ), @@ -721,7 +725,9 @@ def report_decision( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/issuing/credit_underwriting_records/{credit_underwriting_record}/report_decision".format( - credit_underwriting_record=sanitize_id(self.get("id")) + credit_underwriting_record=sanitize_id( + self._data.get("id") + ) ), params=params, ), @@ -781,7 +787,9 @@ async def report_decision_async( # pyright: ignore[reportGeneralTypeIssues] await self._request_async( "post", "/v1/issuing/credit_underwriting_records/{credit_underwriting_record}/report_decision".format( - credit_underwriting_record=sanitize_id(self.get("id")) + credit_underwriting_record=sanitize_id( + self._data.get("id") + ) ), params=params, ), diff --git a/stripe/issuing/_dispute.py b/stripe/issuing/_dispute.py index b9a4a9fd3..f7c991c79 100644 --- a/stripe/issuing/_dispute.py +++ b/stripe/issuing/_dispute.py @@ -284,7 +284,7 @@ class Treasury(StripeObject): """ livemode: bool """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ loss_reason: Optional[ Literal[ @@ -507,7 +507,7 @@ def submit( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/issuing/disputes/{dispute}/submit".format( - dispute=sanitize_id(self.get("id")) + dispute=sanitize_id(self._data.get("id")) ), params=params, ), @@ -562,7 +562,7 @@ async def submit_async( # pyright: ignore[reportGeneralTypeIssues] await self._request_async( "post", "/v1/issuing/disputes/{dispute}/submit".format( - dispute=sanitize_id(self.get("id")) + dispute=sanitize_id(self._data.get("id")) ), params=params, ), diff --git a/stripe/issuing/_dispute_settlement_detail.py b/stripe/issuing/_dispute_settlement_detail.py index c94626545..b24f73511 100644 --- a/stripe/issuing/_dispute_settlement_detail.py +++ b/stripe/issuing/_dispute_settlement_detail.py @@ -60,7 +60,7 @@ class NetworkData(StripeObject): """ livemode: bool """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ network: Literal["maestro", "mastercard", "visa"] """ diff --git a/stripe/issuing/_fraud_liability_debit.py b/stripe/issuing/_fraud_liability_debit.py index 8e9f8387a..f003ad97d 100644 --- a/stripe/issuing/_fraud_liability_debit.py +++ b/stripe/issuing/_fraud_liability_debit.py @@ -50,7 +50,7 @@ class FraudLiabilityDebit(ListableAPIResource["FraudLiabilityDebit"]): """ livemode: bool """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ object: Literal["issuing.fraud_liability_debit"] """ diff --git a/stripe/issuing/_personalization_design.py b/stripe/issuing/_personalization_design.py index fcdcc5e96..6f5864222 100644 --- a/stripe/issuing/_personalization_design.py +++ b/stripe/issuing/_personalization_design.py @@ -131,7 +131,7 @@ class RejectionReasons(StripeObject): """ livemode: bool """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ lookup_key: Optional[str] """ @@ -346,7 +346,7 @@ def activate( # pyright: ignore[reportGeneralTypeIssues] "post", "/v1/test_helpers/issuing/personalization_designs/{personalization_design}/activate".format( personalization_design=sanitize_id( - self.resource.get("id") + self.resource._data.get("id") ) ), params=params, @@ -408,7 +408,7 @@ async def activate_async( # pyright: ignore[reportGeneralTypeIssues] "post", "/v1/test_helpers/issuing/personalization_designs/{personalization_design}/activate".format( personalization_design=sanitize_id( - self.resource.get("id") + self.resource._data.get("id") ) ), params=params, @@ -470,7 +470,7 @@ def deactivate( # pyright: ignore[reportGeneralTypeIssues] "post", "/v1/test_helpers/issuing/personalization_designs/{personalization_design}/deactivate".format( personalization_design=sanitize_id( - self.resource.get("id") + self.resource._data.get("id") ) ), params=params, @@ -532,7 +532,7 @@ async def deactivate_async( # pyright: ignore[reportGeneralTypeIssues] "post", "/v1/test_helpers/issuing/personalization_designs/{personalization_design}/deactivate".format( personalization_design=sanitize_id( - self.resource.get("id") + self.resource._data.get("id") ) ), params=params, @@ -594,7 +594,7 @@ def reject( # pyright: ignore[reportGeneralTypeIssues] "post", "/v1/test_helpers/issuing/personalization_designs/{personalization_design}/reject".format( personalization_design=sanitize_id( - self.resource.get("id") + self.resource._data.get("id") ) ), params=params, @@ -656,7 +656,7 @@ async def reject_async( # pyright: ignore[reportGeneralTypeIssues] "post", "/v1/test_helpers/issuing/personalization_designs/{personalization_design}/reject".format( personalization_design=sanitize_id( - self.resource.get("id") + self.resource._data.get("id") ) ), params=params, diff --git a/stripe/issuing/_physical_bundle.py b/stripe/issuing/_physical_bundle.py index 0e5b33878..7b29c2055 100644 --- a/stripe/issuing/_physical_bundle.py +++ b/stripe/issuing/_physical_bundle.py @@ -45,7 +45,7 @@ class Features(StripeObject): """ livemode: bool """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ name: str """ diff --git a/stripe/issuing/_settlement.py b/stripe/issuing/_settlement.py index f04f49639..019c8f41f 100644 --- a/stripe/issuing/_settlement.py +++ b/stripe/issuing/_settlement.py @@ -37,7 +37,7 @@ class Settlement(StripeObject): """ livemode: bool """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ metadata: Dict[str, str] """ diff --git a/stripe/issuing/_token.py b/stripe/issuing/_token.py index 1a76ce121..71a87a2aa 100644 --- a/stripe/issuing/_token.py +++ b/stripe/issuing/_token.py @@ -71,7 +71,7 @@ class Mastercard(StripeObject): """ class Visa(StripeObject): - card_reference_id: str + card_reference_id: Optional[str] """ A unique reference ID from Visa to represent the card account number. """ @@ -212,7 +212,7 @@ class CardholderAddress(StripeObject): """ livemode: bool """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ network: Literal["mastercard", "visa"] """ diff --git a/stripe/issuing/_transaction.py b/stripe/issuing/_transaction.py index 429f7e24b..8849e1146 100644 --- a/stripe/issuing/_transaction.py +++ b/stripe/issuing/_transaction.py @@ -393,7 +393,7 @@ class Treasury(StripeObject): """ livemode: bool """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ merchant_amount: int """ @@ -653,7 +653,7 @@ def refund( # pyright: ignore[reportGeneralTypeIssues] self.resource._request( "post", "/v1/test_helpers/issuing/transactions/{transaction}/refund".format( - transaction=sanitize_id(self.resource.get("id")) + transaction=sanitize_id(self.resource._data.get("id")) ), params=params, ), @@ -708,7 +708,7 @@ async def refund_async( # pyright: ignore[reportGeneralTypeIssues] await self.resource._request_async( "post", "/v1/test_helpers/issuing/transactions/{transaction}/refund".format( - transaction=sanitize_id(self.resource.get("id")) + transaction=sanitize_id(self.resource._data.get("id")) ), params=params, ), diff --git a/stripe/params/__init__.py b/stripe/params/__init__.py index cc570ee03..03b29158e 100644 --- a/stripe/params/__init__.py +++ b/stripe/params/__init__.py @@ -17,6 +17,7 @@ identity as identity, issuing as issuing, privacy as privacy, + product_catalog as product_catalog, radar as radar, reporting as reporting, reserve as reserve, @@ -123,6 +124,7 @@ AccountCreateParamsCapabilitiesTreasuryFifthThird as AccountCreateParamsCapabilitiesTreasuryFifthThird, AccountCreateParamsCapabilitiesTreasuryGoldmanSachs as AccountCreateParamsCapabilitiesTreasuryGoldmanSachs, AccountCreateParamsCapabilitiesTwintPayments as AccountCreateParamsCapabilitiesTwintPayments, + AccountCreateParamsCapabilitiesUpiPayments as AccountCreateParamsCapabilitiesUpiPayments, AccountCreateParamsCapabilitiesUsBankAccountAchPayments as AccountCreateParamsCapabilitiesUsBankAccountAchPayments, AccountCreateParamsCapabilitiesUsBankTransferPayments as AccountCreateParamsCapabilitiesUsBankTransferPayments, AccountCreateParamsCapabilitiesZipPayments as AccountCreateParamsCapabilitiesZipPayments, @@ -528,6 +530,7 @@ AccountUpdateParamsCapabilitiesTreasuryFifthThird as AccountUpdateParamsCapabilitiesTreasuryFifthThird, AccountUpdateParamsCapabilitiesTreasuryGoldmanSachs as AccountUpdateParamsCapabilitiesTreasuryGoldmanSachs, AccountUpdateParamsCapabilitiesTwintPayments as AccountUpdateParamsCapabilitiesTwintPayments, + AccountUpdateParamsCapabilitiesUpiPayments as AccountUpdateParamsCapabilitiesUpiPayments, AccountUpdateParamsCapabilitiesUsBankAccountAchPayments as AccountUpdateParamsCapabilitiesUsBankAccountAchPayments, AccountUpdateParamsCapabilitiesUsBankTransferPayments as AccountUpdateParamsCapabilitiesUsBankTransferPayments, AccountUpdateParamsCapabilitiesZipPayments as AccountUpdateParamsCapabilitiesZipPayments, @@ -982,6 +985,8 @@ ConfirmationTokenCreateParamsPaymentMethodDataStripeBalance as ConfirmationTokenCreateParamsPaymentMethodDataStripeBalance, ConfirmationTokenCreateParamsPaymentMethodDataSwish as ConfirmationTokenCreateParamsPaymentMethodDataSwish, ConfirmationTokenCreateParamsPaymentMethodDataTwint as ConfirmationTokenCreateParamsPaymentMethodDataTwint, + ConfirmationTokenCreateParamsPaymentMethodDataUpi as ConfirmationTokenCreateParamsPaymentMethodDataUpi, + ConfirmationTokenCreateParamsPaymentMethodDataUpiMandateOptions as ConfirmationTokenCreateParamsPaymentMethodDataUpiMandateOptions, ConfirmationTokenCreateParamsPaymentMethodDataUsBankAccount as ConfirmationTokenCreateParamsPaymentMethodDataUsBankAccount, ConfirmationTokenCreateParamsPaymentMethodDataWechatPay as ConfirmationTokenCreateParamsPaymentMethodDataWechatPay, ConfirmationTokenCreateParamsPaymentMethodDataZip as ConfirmationTokenCreateParamsPaymentMethodDataZip, @@ -1403,6 +1408,7 @@ InvoiceAddLinesParamsLinePeriod as InvoiceAddLinesParamsLinePeriod, InvoiceAddLinesParamsLinePriceData as InvoiceAddLinesParamsLinePriceData, InvoiceAddLinesParamsLinePriceDataProductData as InvoiceAddLinesParamsLinePriceDataProductData, + InvoiceAddLinesParamsLinePriceDataProductDataTaxDetails as InvoiceAddLinesParamsLinePriceDataProductDataTaxDetails, InvoiceAddLinesParamsLinePricing as InvoiceAddLinesParamsLinePricing, InvoiceAddLinesParamsLineTaxAmount as InvoiceAddLinesParamsLineTaxAmount, InvoiceAddLinesParamsLineTaxAmountTaxRateData as InvoiceAddLinesParamsLineTaxAmountTaxRateData, @@ -1552,6 +1558,7 @@ InvoiceCreatePreviewParamsSubscriptionDetailsBillingScheduleBillUntilDuration as InvoiceCreatePreviewParamsSubscriptionDetailsBillingScheduleBillUntilDuration, InvoiceCreatePreviewParamsSubscriptionDetailsItem as InvoiceCreatePreviewParamsSubscriptionDetailsItem, InvoiceCreatePreviewParamsSubscriptionDetailsItemBillingThresholds as InvoiceCreatePreviewParamsSubscriptionDetailsItemBillingThresholds, + InvoiceCreatePreviewParamsSubscriptionDetailsItemCurrentTrial as InvoiceCreatePreviewParamsSubscriptionDetailsItemCurrentTrial, InvoiceCreatePreviewParamsSubscriptionDetailsItemDiscount as InvoiceCreatePreviewParamsSubscriptionDetailsItemDiscount, InvoiceCreatePreviewParamsSubscriptionDetailsItemDiscountDiscountEnd as InvoiceCreatePreviewParamsSubscriptionDetailsItemDiscountDiscountEnd, InvoiceCreatePreviewParamsSubscriptionDetailsItemDiscountDiscountEndDuration as InvoiceCreatePreviewParamsSubscriptionDetailsItemDiscountDiscountEndDuration, @@ -1616,6 +1623,7 @@ InvoiceLineItemUpdateParamsPeriod as InvoiceLineItemUpdateParamsPeriod, InvoiceLineItemUpdateParamsPriceData as InvoiceLineItemUpdateParamsPriceData, InvoiceLineItemUpdateParamsPriceDataProductData as InvoiceLineItemUpdateParamsPriceDataProductData, + InvoiceLineItemUpdateParamsPriceDataProductDataTaxDetails as InvoiceLineItemUpdateParamsPriceDataProductDataTaxDetails, InvoiceLineItemUpdateParamsPricing as InvoiceLineItemUpdateParamsPricing, InvoiceLineItemUpdateParamsTaxAmount as InvoiceLineItemUpdateParamsTaxAmount, InvoiceLineItemUpdateParamsTaxAmountTaxRateData as InvoiceLineItemUpdateParamsTaxAmountTaxRateData, @@ -1721,6 +1729,7 @@ InvoiceUpdateLinesParamsLinePeriod as InvoiceUpdateLinesParamsLinePeriod, InvoiceUpdateLinesParamsLinePriceData as InvoiceUpdateLinesParamsLinePriceData, InvoiceUpdateLinesParamsLinePriceDataProductData as InvoiceUpdateLinesParamsLinePriceDataProductData, + InvoiceUpdateLinesParamsLinePriceDataProductDataTaxDetails as InvoiceUpdateLinesParamsLinePriceDataProductDataTaxDetails, InvoiceUpdateLinesParamsLinePricing as InvoiceUpdateLinesParamsLinePricing, InvoiceUpdateLinesParamsLineTaxAmount as InvoiceUpdateLinesParamsLineTaxAmount, InvoiceUpdateLinesParamsLineTaxAmountTaxRateData as InvoiceUpdateLinesParamsLineTaxAmountTaxRateData, @@ -2090,6 +2099,7 @@ PaymentIntentCaptureParamsAmountDetailsLineItemPaymentMethodOptionsPaypal as PaymentIntentCaptureParamsAmountDetailsLineItemPaymentMethodOptionsPaypal, PaymentIntentCaptureParamsAmountDetailsLineItemTax as PaymentIntentCaptureParamsAmountDetailsLineItemTax, PaymentIntentCaptureParamsAmountDetailsShipping as PaymentIntentCaptureParamsAmountDetailsShipping, + PaymentIntentCaptureParamsAmountDetailsSurcharge as PaymentIntentCaptureParamsAmountDetailsSurcharge, PaymentIntentCaptureParamsAmountDetailsTax as PaymentIntentCaptureParamsAmountDetailsTax, PaymentIntentCaptureParamsHooks as PaymentIntentCaptureParamsHooks, PaymentIntentCaptureParamsHooksInputs as PaymentIntentCaptureParamsHooksInputs, @@ -2176,6 +2186,7 @@ PaymentIntentConfirmParamsAmountDetailsLineItemPaymentMethodOptionsPaypal as PaymentIntentConfirmParamsAmountDetailsLineItemPaymentMethodOptionsPaypal, PaymentIntentConfirmParamsAmountDetailsLineItemTax as PaymentIntentConfirmParamsAmountDetailsLineItemTax, PaymentIntentConfirmParamsAmountDetailsShipping as PaymentIntentConfirmParamsAmountDetailsShipping, + PaymentIntentConfirmParamsAmountDetailsSurcharge as PaymentIntentConfirmParamsAmountDetailsSurcharge, PaymentIntentConfirmParamsAmountDetailsTax as PaymentIntentConfirmParamsAmountDetailsTax, PaymentIntentConfirmParamsHooks as PaymentIntentConfirmParamsHooks, PaymentIntentConfirmParamsHooksInputs as PaymentIntentConfirmParamsHooksInputs, @@ -2313,6 +2324,8 @@ PaymentIntentConfirmParamsPaymentMethodDataStripeBalance as PaymentIntentConfirmParamsPaymentMethodDataStripeBalance, PaymentIntentConfirmParamsPaymentMethodDataSwish as PaymentIntentConfirmParamsPaymentMethodDataSwish, PaymentIntentConfirmParamsPaymentMethodDataTwint as PaymentIntentConfirmParamsPaymentMethodDataTwint, + PaymentIntentConfirmParamsPaymentMethodDataUpi as PaymentIntentConfirmParamsPaymentMethodDataUpi, + PaymentIntentConfirmParamsPaymentMethodDataUpiMandateOptions as PaymentIntentConfirmParamsPaymentMethodDataUpiMandateOptions, PaymentIntentConfirmParamsPaymentMethodDataUsBankAccount as PaymentIntentConfirmParamsPaymentMethodDataUsBankAccount, PaymentIntentConfirmParamsPaymentMethodDataWechatPay as PaymentIntentConfirmParamsPaymentMethodDataWechatPay, PaymentIntentConfirmParamsPaymentMethodDataZip as PaymentIntentConfirmParamsPaymentMethodDataZip, @@ -2430,6 +2443,8 @@ PaymentIntentConfirmParamsPaymentMethodOptionsStripeBalance as PaymentIntentConfirmParamsPaymentMethodOptionsStripeBalance, PaymentIntentConfirmParamsPaymentMethodOptionsSwish as PaymentIntentConfirmParamsPaymentMethodOptionsSwish, PaymentIntentConfirmParamsPaymentMethodOptionsTwint as PaymentIntentConfirmParamsPaymentMethodOptionsTwint, + PaymentIntentConfirmParamsPaymentMethodOptionsUpi as PaymentIntentConfirmParamsPaymentMethodOptionsUpi, + PaymentIntentConfirmParamsPaymentMethodOptionsUpiMandateOptions as PaymentIntentConfirmParamsPaymentMethodOptionsUpiMandateOptions, PaymentIntentConfirmParamsPaymentMethodOptionsUsBankAccount as PaymentIntentConfirmParamsPaymentMethodOptionsUsBankAccount, PaymentIntentConfirmParamsPaymentMethodOptionsUsBankAccountFinancialConnections as PaymentIntentConfirmParamsPaymentMethodOptionsUsBankAccountFinancialConnections, PaymentIntentConfirmParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters as PaymentIntentConfirmParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters, @@ -2453,6 +2468,7 @@ PaymentIntentCreateParamsAmountDetailsLineItemPaymentMethodOptionsPaypal as PaymentIntentCreateParamsAmountDetailsLineItemPaymentMethodOptionsPaypal, PaymentIntentCreateParamsAmountDetailsLineItemTax as PaymentIntentCreateParamsAmountDetailsLineItemTax, PaymentIntentCreateParamsAmountDetailsShipping as PaymentIntentCreateParamsAmountDetailsShipping, + PaymentIntentCreateParamsAmountDetailsSurcharge as PaymentIntentCreateParamsAmountDetailsSurcharge, PaymentIntentCreateParamsAmountDetailsTax as PaymentIntentCreateParamsAmountDetailsTax, PaymentIntentCreateParamsAutomaticPaymentMethods as PaymentIntentCreateParamsAutomaticPaymentMethods, PaymentIntentCreateParamsHooks as PaymentIntentCreateParamsHooks, @@ -2591,6 +2607,8 @@ PaymentIntentCreateParamsPaymentMethodDataStripeBalance as PaymentIntentCreateParamsPaymentMethodDataStripeBalance, PaymentIntentCreateParamsPaymentMethodDataSwish as PaymentIntentCreateParamsPaymentMethodDataSwish, PaymentIntentCreateParamsPaymentMethodDataTwint as PaymentIntentCreateParamsPaymentMethodDataTwint, + PaymentIntentCreateParamsPaymentMethodDataUpi as PaymentIntentCreateParamsPaymentMethodDataUpi, + PaymentIntentCreateParamsPaymentMethodDataUpiMandateOptions as PaymentIntentCreateParamsPaymentMethodDataUpiMandateOptions, PaymentIntentCreateParamsPaymentMethodDataUsBankAccount as PaymentIntentCreateParamsPaymentMethodDataUsBankAccount, PaymentIntentCreateParamsPaymentMethodDataWechatPay as PaymentIntentCreateParamsPaymentMethodDataWechatPay, PaymentIntentCreateParamsPaymentMethodDataZip as PaymentIntentCreateParamsPaymentMethodDataZip, @@ -2708,6 +2726,8 @@ PaymentIntentCreateParamsPaymentMethodOptionsStripeBalance as PaymentIntentCreateParamsPaymentMethodOptionsStripeBalance, PaymentIntentCreateParamsPaymentMethodOptionsSwish as PaymentIntentCreateParamsPaymentMethodOptionsSwish, PaymentIntentCreateParamsPaymentMethodOptionsTwint as PaymentIntentCreateParamsPaymentMethodOptionsTwint, + PaymentIntentCreateParamsPaymentMethodOptionsUpi as PaymentIntentCreateParamsPaymentMethodOptionsUpi, + PaymentIntentCreateParamsPaymentMethodOptionsUpiMandateOptions as PaymentIntentCreateParamsPaymentMethodOptionsUpiMandateOptions, PaymentIntentCreateParamsPaymentMethodOptionsUsBankAccount as PaymentIntentCreateParamsPaymentMethodOptionsUsBankAccount, PaymentIntentCreateParamsPaymentMethodOptionsUsBankAccountFinancialConnections as PaymentIntentCreateParamsPaymentMethodOptionsUsBankAccountFinancialConnections, PaymentIntentCreateParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters as PaymentIntentCreateParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters, @@ -2723,9 +2743,21 @@ ) from stripe.params._payment_intent_decrement_authorization_params import ( PaymentIntentDecrementAuthorizationParams as PaymentIntentDecrementAuthorizationParams, + PaymentIntentDecrementAuthorizationParamsAmountDetails as PaymentIntentDecrementAuthorizationParamsAmountDetails, + PaymentIntentDecrementAuthorizationParamsAmountDetailsLineItem as PaymentIntentDecrementAuthorizationParamsAmountDetailsLineItem, + PaymentIntentDecrementAuthorizationParamsAmountDetailsLineItemPaymentMethodOptions as PaymentIntentDecrementAuthorizationParamsAmountDetailsLineItemPaymentMethodOptions, + PaymentIntentDecrementAuthorizationParamsAmountDetailsLineItemPaymentMethodOptionsCard as PaymentIntentDecrementAuthorizationParamsAmountDetailsLineItemPaymentMethodOptionsCard, + PaymentIntentDecrementAuthorizationParamsAmountDetailsLineItemPaymentMethodOptionsCardPresent as PaymentIntentDecrementAuthorizationParamsAmountDetailsLineItemPaymentMethodOptionsCardPresent, + PaymentIntentDecrementAuthorizationParamsAmountDetailsLineItemPaymentMethodOptionsKlarna as PaymentIntentDecrementAuthorizationParamsAmountDetailsLineItemPaymentMethodOptionsKlarna, + PaymentIntentDecrementAuthorizationParamsAmountDetailsLineItemPaymentMethodOptionsPaypal as PaymentIntentDecrementAuthorizationParamsAmountDetailsLineItemPaymentMethodOptionsPaypal, + PaymentIntentDecrementAuthorizationParamsAmountDetailsLineItemTax as PaymentIntentDecrementAuthorizationParamsAmountDetailsLineItemTax, + PaymentIntentDecrementAuthorizationParamsAmountDetailsShipping as PaymentIntentDecrementAuthorizationParamsAmountDetailsShipping, + PaymentIntentDecrementAuthorizationParamsAmountDetailsSurcharge as PaymentIntentDecrementAuthorizationParamsAmountDetailsSurcharge, + PaymentIntentDecrementAuthorizationParamsAmountDetailsTax as PaymentIntentDecrementAuthorizationParamsAmountDetailsTax, PaymentIntentDecrementAuthorizationParamsHooks as PaymentIntentDecrementAuthorizationParamsHooks, PaymentIntentDecrementAuthorizationParamsHooksInputs as PaymentIntentDecrementAuthorizationParamsHooksInputs, PaymentIntentDecrementAuthorizationParamsHooksInputsTax as PaymentIntentDecrementAuthorizationParamsHooksInputsTax, + PaymentIntentDecrementAuthorizationParamsPaymentDetails as PaymentIntentDecrementAuthorizationParamsPaymentDetails, PaymentIntentDecrementAuthorizationParamsTransferData as PaymentIntentDecrementAuthorizationParamsTransferData, ) from stripe.params._payment_intent_increment_authorization_params import ( @@ -2739,6 +2771,7 @@ PaymentIntentIncrementAuthorizationParamsAmountDetailsLineItemPaymentMethodOptionsPaypal as PaymentIntentIncrementAuthorizationParamsAmountDetailsLineItemPaymentMethodOptionsPaypal, PaymentIntentIncrementAuthorizationParamsAmountDetailsLineItemTax as PaymentIntentIncrementAuthorizationParamsAmountDetailsLineItemTax, PaymentIntentIncrementAuthorizationParamsAmountDetailsShipping as PaymentIntentIncrementAuthorizationParamsAmountDetailsShipping, + PaymentIntentIncrementAuthorizationParamsAmountDetailsSurcharge as PaymentIntentIncrementAuthorizationParamsAmountDetailsSurcharge, PaymentIntentIncrementAuthorizationParamsAmountDetailsTax as PaymentIntentIncrementAuthorizationParamsAmountDetailsTax, PaymentIntentIncrementAuthorizationParamsHooks as PaymentIntentIncrementAuthorizationParamsHooks, PaymentIntentIncrementAuthorizationParamsHooksInputs as PaymentIntentIncrementAuthorizationParamsHooksInputs, @@ -2766,6 +2799,7 @@ PaymentIntentModifyParamsAmountDetailsLineItemPaymentMethodOptionsPaypal as PaymentIntentModifyParamsAmountDetailsLineItemPaymentMethodOptionsPaypal, PaymentIntentModifyParamsAmountDetailsLineItemTax as PaymentIntentModifyParamsAmountDetailsLineItemTax, PaymentIntentModifyParamsAmountDetailsShipping as PaymentIntentModifyParamsAmountDetailsShipping, + PaymentIntentModifyParamsAmountDetailsSurcharge as PaymentIntentModifyParamsAmountDetailsSurcharge, PaymentIntentModifyParamsAmountDetailsTax as PaymentIntentModifyParamsAmountDetailsTax, PaymentIntentModifyParamsHooks as PaymentIntentModifyParamsHooks, PaymentIntentModifyParamsHooksInputs as PaymentIntentModifyParamsHooksInputs, @@ -2902,6 +2936,8 @@ PaymentIntentModifyParamsPaymentMethodDataStripeBalance as PaymentIntentModifyParamsPaymentMethodDataStripeBalance, PaymentIntentModifyParamsPaymentMethodDataSwish as PaymentIntentModifyParamsPaymentMethodDataSwish, PaymentIntentModifyParamsPaymentMethodDataTwint as PaymentIntentModifyParamsPaymentMethodDataTwint, + PaymentIntentModifyParamsPaymentMethodDataUpi as PaymentIntentModifyParamsPaymentMethodDataUpi, + PaymentIntentModifyParamsPaymentMethodDataUpiMandateOptions as PaymentIntentModifyParamsPaymentMethodDataUpiMandateOptions, PaymentIntentModifyParamsPaymentMethodDataUsBankAccount as PaymentIntentModifyParamsPaymentMethodDataUsBankAccount, PaymentIntentModifyParamsPaymentMethodDataWechatPay as PaymentIntentModifyParamsPaymentMethodDataWechatPay, PaymentIntentModifyParamsPaymentMethodDataZip as PaymentIntentModifyParamsPaymentMethodDataZip, @@ -3019,6 +3055,8 @@ PaymentIntentModifyParamsPaymentMethodOptionsStripeBalance as PaymentIntentModifyParamsPaymentMethodOptionsStripeBalance, PaymentIntentModifyParamsPaymentMethodOptionsSwish as PaymentIntentModifyParamsPaymentMethodOptionsSwish, PaymentIntentModifyParamsPaymentMethodOptionsTwint as PaymentIntentModifyParamsPaymentMethodOptionsTwint, + PaymentIntentModifyParamsPaymentMethodOptionsUpi as PaymentIntentModifyParamsPaymentMethodOptionsUpi, + PaymentIntentModifyParamsPaymentMethodOptionsUpiMandateOptions as PaymentIntentModifyParamsPaymentMethodOptionsUpiMandateOptions, PaymentIntentModifyParamsPaymentMethodOptionsUsBankAccount as PaymentIntentModifyParamsPaymentMethodOptionsUsBankAccount, PaymentIntentModifyParamsPaymentMethodOptionsUsBankAccountFinancialConnections as PaymentIntentModifyParamsPaymentMethodOptionsUsBankAccountFinancialConnections, PaymentIntentModifyParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters as PaymentIntentModifyParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters, @@ -3052,6 +3090,7 @@ PaymentIntentUpdateParamsAmountDetailsLineItemPaymentMethodOptionsPaypal as PaymentIntentUpdateParamsAmountDetailsLineItemPaymentMethodOptionsPaypal, PaymentIntentUpdateParamsAmountDetailsLineItemTax as PaymentIntentUpdateParamsAmountDetailsLineItemTax, PaymentIntentUpdateParamsAmountDetailsShipping as PaymentIntentUpdateParamsAmountDetailsShipping, + PaymentIntentUpdateParamsAmountDetailsSurcharge as PaymentIntentUpdateParamsAmountDetailsSurcharge, PaymentIntentUpdateParamsAmountDetailsTax as PaymentIntentUpdateParamsAmountDetailsTax, PaymentIntentUpdateParamsHooks as PaymentIntentUpdateParamsHooks, PaymentIntentUpdateParamsHooksInputs as PaymentIntentUpdateParamsHooksInputs, @@ -3188,6 +3227,8 @@ PaymentIntentUpdateParamsPaymentMethodDataStripeBalance as PaymentIntentUpdateParamsPaymentMethodDataStripeBalance, PaymentIntentUpdateParamsPaymentMethodDataSwish as PaymentIntentUpdateParamsPaymentMethodDataSwish, PaymentIntentUpdateParamsPaymentMethodDataTwint as PaymentIntentUpdateParamsPaymentMethodDataTwint, + PaymentIntentUpdateParamsPaymentMethodDataUpi as PaymentIntentUpdateParamsPaymentMethodDataUpi, + PaymentIntentUpdateParamsPaymentMethodDataUpiMandateOptions as PaymentIntentUpdateParamsPaymentMethodDataUpiMandateOptions, PaymentIntentUpdateParamsPaymentMethodDataUsBankAccount as PaymentIntentUpdateParamsPaymentMethodDataUsBankAccount, PaymentIntentUpdateParamsPaymentMethodDataWechatPay as PaymentIntentUpdateParamsPaymentMethodDataWechatPay, PaymentIntentUpdateParamsPaymentMethodDataZip as PaymentIntentUpdateParamsPaymentMethodDataZip, @@ -3305,6 +3346,8 @@ PaymentIntentUpdateParamsPaymentMethodOptionsStripeBalance as PaymentIntentUpdateParamsPaymentMethodOptionsStripeBalance, PaymentIntentUpdateParamsPaymentMethodOptionsSwish as PaymentIntentUpdateParamsPaymentMethodOptionsSwish, PaymentIntentUpdateParamsPaymentMethodOptionsTwint as PaymentIntentUpdateParamsPaymentMethodOptionsTwint, + PaymentIntentUpdateParamsPaymentMethodOptionsUpi as PaymentIntentUpdateParamsPaymentMethodOptionsUpi, + PaymentIntentUpdateParamsPaymentMethodOptionsUpiMandateOptions as PaymentIntentUpdateParamsPaymentMethodOptionsUpiMandateOptions, PaymentIntentUpdateParamsPaymentMethodOptionsUsBankAccount as PaymentIntentUpdateParamsPaymentMethodOptionsUsBankAccount, PaymentIntentUpdateParamsPaymentMethodOptionsUsBankAccountFinancialConnections as PaymentIntentUpdateParamsPaymentMethodOptionsUsBankAccountFinancialConnections, PaymentIntentUpdateParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters as PaymentIntentUpdateParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters, @@ -3349,7 +3392,9 @@ PaymentLinkCreateParamsLineItemAdjustableQuantity as PaymentLinkCreateParamsLineItemAdjustableQuantity, PaymentLinkCreateParamsLineItemPriceData as PaymentLinkCreateParamsLineItemPriceData, PaymentLinkCreateParamsLineItemPriceDataProductData as PaymentLinkCreateParamsLineItemPriceDataProductData, + PaymentLinkCreateParamsLineItemPriceDataProductDataTaxDetails as PaymentLinkCreateParamsLineItemPriceDataProductDataTaxDetails, PaymentLinkCreateParamsLineItemPriceDataRecurring as PaymentLinkCreateParamsLineItemPriceDataRecurring, + PaymentLinkCreateParamsManagedPayments as PaymentLinkCreateParamsManagedPayments, PaymentLinkCreateParamsNameCollection as PaymentLinkCreateParamsNameCollection, PaymentLinkCreateParamsNameCollectionBusiness as PaymentLinkCreateParamsNameCollectionBusiness, PaymentLinkCreateParamsNameCollectionIndividual as PaymentLinkCreateParamsNameCollectionIndividual, @@ -3586,6 +3631,8 @@ PaymentMethodConfigurationCreateParamsSwishDisplayPreference as PaymentMethodConfigurationCreateParamsSwishDisplayPreference, PaymentMethodConfigurationCreateParamsTwint as PaymentMethodConfigurationCreateParamsTwint, PaymentMethodConfigurationCreateParamsTwintDisplayPreference as PaymentMethodConfigurationCreateParamsTwintDisplayPreference, + PaymentMethodConfigurationCreateParamsUpi as PaymentMethodConfigurationCreateParamsUpi, + PaymentMethodConfigurationCreateParamsUpiDisplayPreference as PaymentMethodConfigurationCreateParamsUpiDisplayPreference, PaymentMethodConfigurationCreateParamsUsBankAccount as PaymentMethodConfigurationCreateParamsUsBankAccount, PaymentMethodConfigurationCreateParamsUsBankAccountDisplayPreference as PaymentMethodConfigurationCreateParamsUsBankAccountDisplayPreference, PaymentMethodConfigurationCreateParamsWechatPay as PaymentMethodConfigurationCreateParamsWechatPay, @@ -3714,6 +3761,8 @@ PaymentMethodConfigurationModifyParamsSwishDisplayPreference as PaymentMethodConfigurationModifyParamsSwishDisplayPreference, PaymentMethodConfigurationModifyParamsTwint as PaymentMethodConfigurationModifyParamsTwint, PaymentMethodConfigurationModifyParamsTwintDisplayPreference as PaymentMethodConfigurationModifyParamsTwintDisplayPreference, + PaymentMethodConfigurationModifyParamsUpi as PaymentMethodConfigurationModifyParamsUpi, + PaymentMethodConfigurationModifyParamsUpiDisplayPreference as PaymentMethodConfigurationModifyParamsUpiDisplayPreference, PaymentMethodConfigurationModifyParamsUsBankAccount as PaymentMethodConfigurationModifyParamsUsBankAccount, PaymentMethodConfigurationModifyParamsUsBankAccountDisplayPreference as PaymentMethodConfigurationModifyParamsUsBankAccountDisplayPreference, PaymentMethodConfigurationModifyParamsWechatPay as PaymentMethodConfigurationModifyParamsWechatPay, @@ -3842,6 +3891,8 @@ PaymentMethodConfigurationUpdateParamsSwishDisplayPreference as PaymentMethodConfigurationUpdateParamsSwishDisplayPreference, PaymentMethodConfigurationUpdateParamsTwint as PaymentMethodConfigurationUpdateParamsTwint, PaymentMethodConfigurationUpdateParamsTwintDisplayPreference as PaymentMethodConfigurationUpdateParamsTwintDisplayPreference, + PaymentMethodConfigurationUpdateParamsUpi as PaymentMethodConfigurationUpdateParamsUpi, + PaymentMethodConfigurationUpdateParamsUpiDisplayPreference as PaymentMethodConfigurationUpdateParamsUpiDisplayPreference, PaymentMethodConfigurationUpdateParamsUsBankAccount as PaymentMethodConfigurationUpdateParamsUsBankAccount, PaymentMethodConfigurationUpdateParamsUsBankAccountDisplayPreference as PaymentMethodConfigurationUpdateParamsUsBankAccountDisplayPreference, PaymentMethodConfigurationUpdateParamsWechatPay as PaymentMethodConfigurationUpdateParamsWechatPay, @@ -3913,6 +3964,8 @@ PaymentMethodCreateParamsStripeBalance as PaymentMethodCreateParamsStripeBalance, PaymentMethodCreateParamsSwish as PaymentMethodCreateParamsSwish, PaymentMethodCreateParamsTwint as PaymentMethodCreateParamsTwint, + PaymentMethodCreateParamsUpi as PaymentMethodCreateParamsUpi, + PaymentMethodCreateParamsUpiMandateOptions as PaymentMethodCreateParamsUpiMandateOptions, PaymentMethodCreateParamsUsBankAccount as PaymentMethodCreateParamsUsBankAccount, PaymentMethodCreateParamsWechatPay as PaymentMethodCreateParamsWechatPay, PaymentMethodCreateParamsZip as PaymentMethodCreateParamsZip, @@ -4039,6 +4092,7 @@ from stripe.params._plan_create_params import ( PlanCreateParams as PlanCreateParams, PlanCreateParamsProduct as PlanCreateParamsProduct, + PlanCreateParamsProductTaxDetails as PlanCreateParamsProductTaxDetails, PlanCreateParamsTier as PlanCreateParamsTier, PlanCreateParamsTransformUsage as PlanCreateParamsTransformUsage, ) @@ -4065,6 +4119,7 @@ PriceCreateParamsCurrencyOptionsTier as PriceCreateParamsCurrencyOptionsTier, PriceCreateParamsCustomUnitAmount as PriceCreateParamsCustomUnitAmount, PriceCreateParamsProductData as PriceCreateParamsProductData, + PriceCreateParamsProductDataTaxDetails as PriceCreateParamsProductDataTaxDetails, PriceCreateParamsRecurring as PriceCreateParamsRecurring, PriceCreateParamsTier as PriceCreateParamsTier, PriceCreateParamsTransformQuantity as PriceCreateParamsTransformQuantity, @@ -4107,6 +4162,7 @@ ProductCreateParamsDefaultPriceDataRecurring as ProductCreateParamsDefaultPriceDataRecurring, ProductCreateParamsMarketingFeature as ProductCreateParamsMarketingFeature, ProductCreateParamsPackageDimensions as ProductCreateParamsPackageDimensions, + ProductCreateParamsTaxDetails as ProductCreateParamsTaxDetails, ) from stripe.params._product_delete_feature_params import ( ProductDeleteFeatureParams as ProductDeleteFeatureParams, @@ -4137,6 +4193,7 @@ ProductModifyParams as ProductModifyParams, ProductModifyParamsMarketingFeature as ProductModifyParamsMarketingFeature, ProductModifyParamsPackageDimensions as ProductModifyParamsPackageDimensions, + ProductModifyParamsTaxDetails as ProductModifyParamsTaxDetails, ) from stripe.params._product_retrieve_feature_params import ( ProductRetrieveFeatureParams as ProductRetrieveFeatureParams, @@ -4151,6 +4208,7 @@ ProductUpdateParams as ProductUpdateParams, ProductUpdateParamsMarketingFeature as ProductUpdateParamsMarketingFeature, ProductUpdateParamsPackageDimensions as ProductUpdateParamsPackageDimensions, + ProductUpdateParamsTaxDetails as ProductUpdateParamsTaxDetails, ) from stripe.params._promotion_code_create_params import ( PromotionCodeCreateParams as PromotionCodeCreateParams, @@ -4529,6 +4587,8 @@ SetupIntentConfirmParamsPaymentMethodDataStripeBalance as SetupIntentConfirmParamsPaymentMethodDataStripeBalance, SetupIntentConfirmParamsPaymentMethodDataSwish as SetupIntentConfirmParamsPaymentMethodDataSwish, SetupIntentConfirmParamsPaymentMethodDataTwint as SetupIntentConfirmParamsPaymentMethodDataTwint, + SetupIntentConfirmParamsPaymentMethodDataUpi as SetupIntentConfirmParamsPaymentMethodDataUpi, + SetupIntentConfirmParamsPaymentMethodDataUpiMandateOptions as SetupIntentConfirmParamsPaymentMethodDataUpiMandateOptions, SetupIntentConfirmParamsPaymentMethodDataUsBankAccount as SetupIntentConfirmParamsPaymentMethodDataUsBankAccount, SetupIntentConfirmParamsPaymentMethodDataWechatPay as SetupIntentConfirmParamsPaymentMethodDataWechatPay, SetupIntentConfirmParamsPaymentMethodDataZip as SetupIntentConfirmParamsPaymentMethodDataZip, @@ -4556,6 +4616,8 @@ SetupIntentConfirmParamsPaymentMethodOptionsPixMandateOptions as SetupIntentConfirmParamsPaymentMethodOptionsPixMandateOptions, SetupIntentConfirmParamsPaymentMethodOptionsSepaDebit as SetupIntentConfirmParamsPaymentMethodOptionsSepaDebit, SetupIntentConfirmParamsPaymentMethodOptionsSepaDebitMandateOptions as SetupIntentConfirmParamsPaymentMethodOptionsSepaDebitMandateOptions, + SetupIntentConfirmParamsPaymentMethodOptionsUpi as SetupIntentConfirmParamsPaymentMethodOptionsUpi, + SetupIntentConfirmParamsPaymentMethodOptionsUpiMandateOptions as SetupIntentConfirmParamsPaymentMethodOptionsUpiMandateOptions, SetupIntentConfirmParamsPaymentMethodOptionsUsBankAccount as SetupIntentConfirmParamsPaymentMethodOptionsUsBankAccount, SetupIntentConfirmParamsPaymentMethodOptionsUsBankAccountFinancialConnections as SetupIntentConfirmParamsPaymentMethodOptionsUsBankAccountFinancialConnections, SetupIntentConfirmParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters as SetupIntentConfirmParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters, @@ -4630,6 +4692,8 @@ SetupIntentCreateParamsPaymentMethodDataStripeBalance as SetupIntentCreateParamsPaymentMethodDataStripeBalance, SetupIntentCreateParamsPaymentMethodDataSwish as SetupIntentCreateParamsPaymentMethodDataSwish, SetupIntentCreateParamsPaymentMethodDataTwint as SetupIntentCreateParamsPaymentMethodDataTwint, + SetupIntentCreateParamsPaymentMethodDataUpi as SetupIntentCreateParamsPaymentMethodDataUpi, + SetupIntentCreateParamsPaymentMethodDataUpiMandateOptions as SetupIntentCreateParamsPaymentMethodDataUpiMandateOptions, SetupIntentCreateParamsPaymentMethodDataUsBankAccount as SetupIntentCreateParamsPaymentMethodDataUsBankAccount, SetupIntentCreateParamsPaymentMethodDataWechatPay as SetupIntentCreateParamsPaymentMethodDataWechatPay, SetupIntentCreateParamsPaymentMethodDataZip as SetupIntentCreateParamsPaymentMethodDataZip, @@ -4657,6 +4721,8 @@ SetupIntentCreateParamsPaymentMethodOptionsPixMandateOptions as SetupIntentCreateParamsPaymentMethodOptionsPixMandateOptions, SetupIntentCreateParamsPaymentMethodOptionsSepaDebit as SetupIntentCreateParamsPaymentMethodOptionsSepaDebit, SetupIntentCreateParamsPaymentMethodOptionsSepaDebitMandateOptions as SetupIntentCreateParamsPaymentMethodOptionsSepaDebitMandateOptions, + SetupIntentCreateParamsPaymentMethodOptionsUpi as SetupIntentCreateParamsPaymentMethodOptionsUpi, + SetupIntentCreateParamsPaymentMethodOptionsUpiMandateOptions as SetupIntentCreateParamsPaymentMethodOptionsUpiMandateOptions, SetupIntentCreateParamsPaymentMethodOptionsUsBankAccount as SetupIntentCreateParamsPaymentMethodOptionsUsBankAccount, SetupIntentCreateParamsPaymentMethodOptionsUsBankAccountFinancialConnections as SetupIntentCreateParamsPaymentMethodOptionsUsBankAccountFinancialConnections, SetupIntentCreateParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters as SetupIntentCreateParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters, @@ -4731,6 +4797,8 @@ SetupIntentModifyParamsPaymentMethodDataStripeBalance as SetupIntentModifyParamsPaymentMethodDataStripeBalance, SetupIntentModifyParamsPaymentMethodDataSwish as SetupIntentModifyParamsPaymentMethodDataSwish, SetupIntentModifyParamsPaymentMethodDataTwint as SetupIntentModifyParamsPaymentMethodDataTwint, + SetupIntentModifyParamsPaymentMethodDataUpi as SetupIntentModifyParamsPaymentMethodDataUpi, + SetupIntentModifyParamsPaymentMethodDataUpiMandateOptions as SetupIntentModifyParamsPaymentMethodDataUpiMandateOptions, SetupIntentModifyParamsPaymentMethodDataUsBankAccount as SetupIntentModifyParamsPaymentMethodDataUsBankAccount, SetupIntentModifyParamsPaymentMethodDataWechatPay as SetupIntentModifyParamsPaymentMethodDataWechatPay, SetupIntentModifyParamsPaymentMethodDataZip as SetupIntentModifyParamsPaymentMethodDataZip, @@ -4758,6 +4826,8 @@ SetupIntentModifyParamsPaymentMethodOptionsPixMandateOptions as SetupIntentModifyParamsPaymentMethodOptionsPixMandateOptions, SetupIntentModifyParamsPaymentMethodOptionsSepaDebit as SetupIntentModifyParamsPaymentMethodOptionsSepaDebit, SetupIntentModifyParamsPaymentMethodOptionsSepaDebitMandateOptions as SetupIntentModifyParamsPaymentMethodOptionsSepaDebitMandateOptions, + SetupIntentModifyParamsPaymentMethodOptionsUpi as SetupIntentModifyParamsPaymentMethodOptionsUpi, + SetupIntentModifyParamsPaymentMethodOptionsUpiMandateOptions as SetupIntentModifyParamsPaymentMethodOptionsUpiMandateOptions, SetupIntentModifyParamsPaymentMethodOptionsUsBankAccount as SetupIntentModifyParamsPaymentMethodOptionsUsBankAccount, SetupIntentModifyParamsPaymentMethodOptionsUsBankAccountFinancialConnections as SetupIntentModifyParamsPaymentMethodOptionsUsBankAccountFinancialConnections, SetupIntentModifyParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters as SetupIntentModifyParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters, @@ -4830,6 +4900,8 @@ SetupIntentUpdateParamsPaymentMethodDataStripeBalance as SetupIntentUpdateParamsPaymentMethodDataStripeBalance, SetupIntentUpdateParamsPaymentMethodDataSwish as SetupIntentUpdateParamsPaymentMethodDataSwish, SetupIntentUpdateParamsPaymentMethodDataTwint as SetupIntentUpdateParamsPaymentMethodDataTwint, + SetupIntentUpdateParamsPaymentMethodDataUpi as SetupIntentUpdateParamsPaymentMethodDataUpi, + SetupIntentUpdateParamsPaymentMethodDataUpiMandateOptions as SetupIntentUpdateParamsPaymentMethodDataUpiMandateOptions, SetupIntentUpdateParamsPaymentMethodDataUsBankAccount as SetupIntentUpdateParamsPaymentMethodDataUsBankAccount, SetupIntentUpdateParamsPaymentMethodDataWechatPay as SetupIntentUpdateParamsPaymentMethodDataWechatPay, SetupIntentUpdateParamsPaymentMethodDataZip as SetupIntentUpdateParamsPaymentMethodDataZip, @@ -4857,6 +4929,8 @@ SetupIntentUpdateParamsPaymentMethodOptionsPixMandateOptions as SetupIntentUpdateParamsPaymentMethodOptionsPixMandateOptions, SetupIntentUpdateParamsPaymentMethodOptionsSepaDebit as SetupIntentUpdateParamsPaymentMethodOptionsSepaDebit, SetupIntentUpdateParamsPaymentMethodOptionsSepaDebitMandateOptions as SetupIntentUpdateParamsPaymentMethodOptionsSepaDebitMandateOptions, + SetupIntentUpdateParamsPaymentMethodOptionsUpi as SetupIntentUpdateParamsPaymentMethodOptionsUpi, + SetupIntentUpdateParamsPaymentMethodOptionsUpiMandateOptions as SetupIntentUpdateParamsPaymentMethodOptionsUpiMandateOptions, SetupIntentUpdateParamsPaymentMethodOptionsUsBankAccount as SetupIntentUpdateParamsPaymentMethodOptionsUsBankAccount, SetupIntentUpdateParamsPaymentMethodOptionsUsBankAccountFinancialConnections as SetupIntentUpdateParamsPaymentMethodOptionsUsBankAccountFinancialConnections, SetupIntentUpdateParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters as SetupIntentUpdateParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters, @@ -4979,6 +5053,7 @@ SubscriptionCreateParamsInvoiceSettingsIssuer as SubscriptionCreateParamsInvoiceSettingsIssuer, SubscriptionCreateParamsItem as SubscriptionCreateParamsItem, SubscriptionCreateParamsItemBillingThresholds as SubscriptionCreateParamsItemBillingThresholds, + SubscriptionCreateParamsItemCurrentTrial as SubscriptionCreateParamsItemCurrentTrial, SubscriptionCreateParamsItemDiscount as SubscriptionCreateParamsItemDiscount, SubscriptionCreateParamsItemDiscountDiscountEnd as SubscriptionCreateParamsItemDiscountDiscountEnd, SubscriptionCreateParamsItemDiscountDiscountEndDuration as SubscriptionCreateParamsItemDiscountDiscountEndDuration, @@ -5019,6 +5094,7 @@ from stripe.params._subscription_item_create_params import ( SubscriptionItemCreateParams as SubscriptionItemCreateParams, SubscriptionItemCreateParamsBillingThresholds as SubscriptionItemCreateParamsBillingThresholds, + SubscriptionItemCreateParamsCurrentTrial as SubscriptionItemCreateParamsCurrentTrial, SubscriptionItemCreateParamsDiscount as SubscriptionItemCreateParamsDiscount, SubscriptionItemCreateParamsDiscountDiscountEnd as SubscriptionItemCreateParamsDiscountDiscountEnd, SubscriptionItemCreateParamsDiscountDiscountEndDuration as SubscriptionItemCreateParamsDiscountDiscountEndDuration, @@ -5035,6 +5111,7 @@ from stripe.params._subscription_item_modify_params import ( SubscriptionItemModifyParams as SubscriptionItemModifyParams, SubscriptionItemModifyParamsBillingThresholds as SubscriptionItemModifyParamsBillingThresholds, + SubscriptionItemModifyParamsCurrentTrial as SubscriptionItemModifyParamsCurrentTrial, SubscriptionItemModifyParamsDiscount as SubscriptionItemModifyParamsDiscount, SubscriptionItemModifyParamsDiscountDiscountEnd as SubscriptionItemModifyParamsDiscountDiscountEnd, SubscriptionItemModifyParamsDiscountDiscountEndDuration as SubscriptionItemModifyParamsDiscountDiscountEndDuration, @@ -5047,6 +5124,7 @@ from stripe.params._subscription_item_update_params import ( SubscriptionItemUpdateParams as SubscriptionItemUpdateParams, SubscriptionItemUpdateParamsBillingThresholds as SubscriptionItemUpdateParamsBillingThresholds, + SubscriptionItemUpdateParamsCurrentTrial as SubscriptionItemUpdateParamsCurrentTrial, SubscriptionItemUpdateParamsDiscount as SubscriptionItemUpdateParamsDiscount, SubscriptionItemUpdateParamsDiscountDiscountEnd as SubscriptionItemUpdateParamsDiscountDiscountEnd, SubscriptionItemUpdateParamsDiscountDiscountEndDuration as SubscriptionItemUpdateParamsDiscountDiscountEndDuration, @@ -5090,6 +5168,7 @@ SubscriptionModifyParamsInvoiceSettingsIssuer as SubscriptionModifyParamsInvoiceSettingsIssuer, SubscriptionModifyParamsItem as SubscriptionModifyParamsItem, SubscriptionModifyParamsItemBillingThresholds as SubscriptionModifyParamsItemBillingThresholds, + SubscriptionModifyParamsItemCurrentTrial as SubscriptionModifyParamsItemCurrentTrial, SubscriptionModifyParamsItemDiscount as SubscriptionModifyParamsItemDiscount, SubscriptionModifyParamsItemDiscountDiscountEnd as SubscriptionModifyParamsItemDiscountDiscountEnd, SubscriptionModifyParamsItemDiscountDiscountEndDuration as SubscriptionModifyParamsItemDiscountDiscountEndDuration, @@ -5338,6 +5417,7 @@ SubscriptionUpdateParamsInvoiceSettingsIssuer as SubscriptionUpdateParamsInvoiceSettingsIssuer, SubscriptionUpdateParamsItem as SubscriptionUpdateParamsItem, SubscriptionUpdateParamsItemBillingThresholds as SubscriptionUpdateParamsItemBillingThresholds, + SubscriptionUpdateParamsItemCurrentTrial as SubscriptionUpdateParamsItemCurrentTrial, SubscriptionUpdateParamsItemDiscount as SubscriptionUpdateParamsItemDiscount, SubscriptionUpdateParamsItemDiscountDiscountEnd as SubscriptionUpdateParamsItemDiscountDiscountEnd, SubscriptionUpdateParamsItemDiscountDiscountEndDuration as SubscriptionUpdateParamsItemDiscountDiscountEndDuration, @@ -5552,6 +5632,7 @@ "identity": ("stripe.params.identity", True), "issuing": ("stripe.params.issuing", True), "privacy": ("stripe.params.privacy", True), + "product_catalog": ("stripe.params.product_catalog", True), "radar": ("stripe.params.radar", True), "reporting": ("stripe.params.reporting", True), "reserve": ("stripe.params.reserve", True), @@ -5901,6 +5982,10 @@ "stripe.params._account_create_params", False, ), + "AccountCreateParamsCapabilitiesUpiPayments": ( + "stripe.params._account_create_params", + False, + ), "AccountCreateParamsCapabilitiesUsBankAccountAchPayments": ( "stripe.params._account_create_params", False, @@ -7209,6 +7294,10 @@ "stripe.params._account_update_params", False, ), + "AccountUpdateParamsCapabilitiesUpiPayments": ( + "stripe.params._account_update_params", + False, + ), "AccountUpdateParamsCapabilitiesUsBankAccountAchPayments": ( "stripe.params._account_update_params", False, @@ -8728,6 +8817,14 @@ "stripe.params._confirmation_token_create_params", False, ), + "ConfirmationTokenCreateParamsPaymentMethodDataUpi": ( + "stripe.params._confirmation_token_create_params", + False, + ), + "ConfirmationTokenCreateParamsPaymentMethodDataUpiMandateOptions": ( + "stripe.params._confirmation_token_create_params", + False, + ), "ConfirmationTokenCreateParamsPaymentMethodDataUsBankAccount": ( "stripe.params._confirmation_token_create_params", False, @@ -9518,6 +9615,10 @@ "stripe.params._invoice_add_lines_params", False, ), + "InvoiceAddLinesParamsLinePriceDataProductDataTaxDetails": ( + "stripe.params._invoice_add_lines_params", + False, + ), "InvoiceAddLinesParamsLinePricing": ( "stripe.params._invoice_add_lines_params", False, @@ -10087,6 +10188,10 @@ "stripe.params._invoice_create_preview_params", False, ), + "InvoiceCreatePreviewParamsSubscriptionDetailsItemCurrentTrial": ( + "stripe.params._invoice_create_preview_params", + False, + ), "InvoiceCreatePreviewParamsSubscriptionDetailsItemDiscount": ( "stripe.params._invoice_create_preview_params", False, @@ -10252,6 +10357,10 @@ "stripe.params._invoice_line_item_update_params", False, ), + "InvoiceLineItemUpdateParamsPriceDataProductDataTaxDetails": ( + "stripe.params._invoice_line_item_update_params", + False, + ), "InvoiceLineItemUpdateParamsPricing": ( "stripe.params._invoice_line_item_update_params", False, @@ -10523,6 +10632,10 @@ "stripe.params._invoice_update_lines_params", False, ), + "InvoiceUpdateLinesParamsLinePriceDataProductDataTaxDetails": ( + "stripe.params._invoice_update_lines_params", + False, + ), "InvoiceUpdateLinesParamsLinePricing": ( "stripe.params._invoice_update_lines_params", False, @@ -11762,6 +11875,10 @@ "stripe.params._payment_intent_capture_params", False, ), + "PaymentIntentCaptureParamsAmountDetailsSurcharge": ( + "stripe.params._payment_intent_capture_params", + False, + ), "PaymentIntentCaptureParamsAmountDetailsTax": ( "stripe.params._payment_intent_capture_params", False, @@ -12098,6 +12215,10 @@ "stripe.params._payment_intent_confirm_params", False, ), + "PaymentIntentConfirmParamsAmountDetailsSurcharge": ( + "stripe.params._payment_intent_confirm_params", + False, + ), "PaymentIntentConfirmParamsAmountDetailsTax": ( "stripe.params._payment_intent_confirm_params", False, @@ -12646,6 +12767,14 @@ "stripe.params._payment_intent_confirm_params", False, ), + "PaymentIntentConfirmParamsPaymentMethodDataUpi": ( + "stripe.params._payment_intent_confirm_params", + False, + ), + "PaymentIntentConfirmParamsPaymentMethodDataUpiMandateOptions": ( + "stripe.params._payment_intent_confirm_params", + False, + ), "PaymentIntentConfirmParamsPaymentMethodDataUsBankAccount": ( "stripe.params._payment_intent_confirm_params", False, @@ -13114,6 +13243,14 @@ "stripe.params._payment_intent_confirm_params", False, ), + "PaymentIntentConfirmParamsPaymentMethodOptionsUpi": ( + "stripe.params._payment_intent_confirm_params", + False, + ), + "PaymentIntentConfirmParamsPaymentMethodOptionsUpiMandateOptions": ( + "stripe.params._payment_intent_confirm_params", + False, + ), "PaymentIntentConfirmParamsPaymentMethodOptionsUsBankAccount": ( "stripe.params._payment_intent_confirm_params", False, @@ -13198,6 +13335,10 @@ "stripe.params._payment_intent_create_params", False, ), + "PaymentIntentCreateParamsAmountDetailsSurcharge": ( + "stripe.params._payment_intent_create_params", + False, + ), "PaymentIntentCreateParamsAmountDetailsTax": ( "stripe.params._payment_intent_create_params", False, @@ -13750,6 +13891,14 @@ "stripe.params._payment_intent_create_params", False, ), + "PaymentIntentCreateParamsPaymentMethodDataUpi": ( + "stripe.params._payment_intent_create_params", + False, + ), + "PaymentIntentCreateParamsPaymentMethodDataUpiMandateOptions": ( + "stripe.params._payment_intent_create_params", + False, + ), "PaymentIntentCreateParamsPaymentMethodDataUsBankAccount": ( "stripe.params._payment_intent_create_params", False, @@ -14218,6 +14367,14 @@ "stripe.params._payment_intent_create_params", False, ), + "PaymentIntentCreateParamsPaymentMethodOptionsUpi": ( + "stripe.params._payment_intent_create_params", + False, + ), + "PaymentIntentCreateParamsPaymentMethodOptionsUpiMandateOptions": ( + "stripe.params._payment_intent_create_params", + False, + ), "PaymentIntentCreateParamsPaymentMethodOptionsUsBankAccount": ( "stripe.params._payment_intent_create_params", False, @@ -14270,6 +14427,50 @@ "stripe.params._payment_intent_decrement_authorization_params", False, ), + "PaymentIntentDecrementAuthorizationParamsAmountDetails": ( + "stripe.params._payment_intent_decrement_authorization_params", + False, + ), + "PaymentIntentDecrementAuthorizationParamsAmountDetailsLineItem": ( + "stripe.params._payment_intent_decrement_authorization_params", + False, + ), + "PaymentIntentDecrementAuthorizationParamsAmountDetailsLineItemPaymentMethodOptions": ( + "stripe.params._payment_intent_decrement_authorization_params", + False, + ), + "PaymentIntentDecrementAuthorizationParamsAmountDetailsLineItemPaymentMethodOptionsCard": ( + "stripe.params._payment_intent_decrement_authorization_params", + False, + ), + "PaymentIntentDecrementAuthorizationParamsAmountDetailsLineItemPaymentMethodOptionsCardPresent": ( + "stripe.params._payment_intent_decrement_authorization_params", + False, + ), + "PaymentIntentDecrementAuthorizationParamsAmountDetailsLineItemPaymentMethodOptionsKlarna": ( + "stripe.params._payment_intent_decrement_authorization_params", + False, + ), + "PaymentIntentDecrementAuthorizationParamsAmountDetailsLineItemPaymentMethodOptionsPaypal": ( + "stripe.params._payment_intent_decrement_authorization_params", + False, + ), + "PaymentIntentDecrementAuthorizationParamsAmountDetailsLineItemTax": ( + "stripe.params._payment_intent_decrement_authorization_params", + False, + ), + "PaymentIntentDecrementAuthorizationParamsAmountDetailsShipping": ( + "stripe.params._payment_intent_decrement_authorization_params", + False, + ), + "PaymentIntentDecrementAuthorizationParamsAmountDetailsSurcharge": ( + "stripe.params._payment_intent_decrement_authorization_params", + False, + ), + "PaymentIntentDecrementAuthorizationParamsAmountDetailsTax": ( + "stripe.params._payment_intent_decrement_authorization_params", + False, + ), "PaymentIntentDecrementAuthorizationParamsHooks": ( "stripe.params._payment_intent_decrement_authorization_params", False, @@ -14282,6 +14483,10 @@ "stripe.params._payment_intent_decrement_authorization_params", False, ), + "PaymentIntentDecrementAuthorizationParamsPaymentDetails": ( + "stripe.params._payment_intent_decrement_authorization_params", + False, + ), "PaymentIntentDecrementAuthorizationParamsTransferData": ( "stripe.params._payment_intent_decrement_authorization_params", False, @@ -14326,6 +14531,10 @@ "stripe.params._payment_intent_increment_authorization_params", False, ), + "PaymentIntentIncrementAuthorizationParamsAmountDetailsSurcharge": ( + "stripe.params._payment_intent_increment_authorization_params", + False, + ), "PaymentIntentIncrementAuthorizationParamsAmountDetailsTax": ( "stripe.params._payment_intent_increment_authorization_params", False, @@ -14410,6 +14619,10 @@ "stripe.params._payment_intent_modify_params", False, ), + "PaymentIntentModifyParamsAmountDetailsSurcharge": ( + "stripe.params._payment_intent_modify_params", + False, + ), "PaymentIntentModifyParamsAmountDetailsTax": ( "stripe.params._payment_intent_modify_params", False, @@ -14954,6 +15167,14 @@ "stripe.params._payment_intent_modify_params", False, ), + "PaymentIntentModifyParamsPaymentMethodDataUpi": ( + "stripe.params._payment_intent_modify_params", + False, + ), + "PaymentIntentModifyParamsPaymentMethodDataUpiMandateOptions": ( + "stripe.params._payment_intent_modify_params", + False, + ), "PaymentIntentModifyParamsPaymentMethodDataUsBankAccount": ( "stripe.params._payment_intent_modify_params", False, @@ -15422,6 +15643,14 @@ "stripe.params._payment_intent_modify_params", False, ), + "PaymentIntentModifyParamsPaymentMethodOptionsUpi": ( + "stripe.params._payment_intent_modify_params", + False, + ), + "PaymentIntentModifyParamsPaymentMethodOptionsUpiMandateOptions": ( + "stripe.params._payment_intent_modify_params", + False, + ), "PaymentIntentModifyParamsPaymentMethodOptionsUsBankAccount": ( "stripe.params._payment_intent_modify_params", False, @@ -15522,6 +15751,10 @@ "stripe.params._payment_intent_update_params", False, ), + "PaymentIntentUpdateParamsAmountDetailsSurcharge": ( + "stripe.params._payment_intent_update_params", + False, + ), "PaymentIntentUpdateParamsAmountDetailsTax": ( "stripe.params._payment_intent_update_params", False, @@ -16066,6 +16299,14 @@ "stripe.params._payment_intent_update_params", False, ), + "PaymentIntentUpdateParamsPaymentMethodDataUpi": ( + "stripe.params._payment_intent_update_params", + False, + ), + "PaymentIntentUpdateParamsPaymentMethodDataUpiMandateOptions": ( + "stripe.params._payment_intent_update_params", + False, + ), "PaymentIntentUpdateParamsPaymentMethodDataUsBankAccount": ( "stripe.params._payment_intent_update_params", False, @@ -16534,6 +16775,14 @@ "stripe.params._payment_intent_update_params", False, ), + "PaymentIntentUpdateParamsPaymentMethodOptionsUpi": ( + "stripe.params._payment_intent_update_params", + False, + ), + "PaymentIntentUpdateParamsPaymentMethodOptionsUpiMandateOptions": ( + "stripe.params._payment_intent_update_params", + False, + ), "PaymentIntentUpdateParamsPaymentMethodOptionsUsBankAccount": ( "stripe.params._payment_intent_update_params", False, @@ -16694,10 +16943,18 @@ "stripe.params._payment_link_create_params", False, ), + "PaymentLinkCreateParamsLineItemPriceDataProductDataTaxDetails": ( + "stripe.params._payment_link_create_params", + False, + ), "PaymentLinkCreateParamsLineItemPriceDataRecurring": ( "stripe.params._payment_link_create_params", False, ), + "PaymentLinkCreateParamsManagedPayments": ( + "stripe.params._payment_link_create_params", + False, + ), "PaymentLinkCreateParamsNameCollection": ( "stripe.params._payment_link_create_params", False, @@ -17578,6 +17835,14 @@ "stripe.params._payment_method_configuration_create_params", False, ), + "PaymentMethodConfigurationCreateParamsUpi": ( + "stripe.params._payment_method_configuration_create_params", + False, + ), + "PaymentMethodConfigurationCreateParamsUpiDisplayPreference": ( + "stripe.params._payment_method_configuration_create_params", + False, + ), "PaymentMethodConfigurationCreateParamsUsBankAccount": ( "stripe.params._payment_method_configuration_create_params", False, @@ -18074,6 +18339,14 @@ "stripe.params._payment_method_configuration_modify_params", False, ), + "PaymentMethodConfigurationModifyParamsUpi": ( + "stripe.params._payment_method_configuration_modify_params", + False, + ), + "PaymentMethodConfigurationModifyParamsUpiDisplayPreference": ( + "stripe.params._payment_method_configuration_modify_params", + False, + ), "PaymentMethodConfigurationModifyParamsUsBankAccount": ( "stripe.params._payment_method_configuration_modify_params", False, @@ -18570,6 +18843,14 @@ "stripe.params._payment_method_configuration_update_params", False, ), + "PaymentMethodConfigurationUpdateParamsUpi": ( + "stripe.params._payment_method_configuration_update_params", + False, + ), + "PaymentMethodConfigurationUpdateParamsUpiDisplayPreference": ( + "stripe.params._payment_method_configuration_update_params", + False, + ), "PaymentMethodConfigurationUpdateParamsUsBankAccount": ( "stripe.params._payment_method_configuration_update_params", False, @@ -18846,6 +19127,14 @@ "stripe.params._payment_method_create_params", False, ), + "PaymentMethodCreateParamsUpi": ( + "stripe.params._payment_method_create_params", + False, + ), + "PaymentMethodCreateParamsUpiMandateOptions": ( + "stripe.params._payment_method_create_params", + False, + ), "PaymentMethodCreateParamsUsBankAccount": ( "stripe.params._payment_method_create_params", False, @@ -19104,6 +19393,10 @@ "PayoutUpdateParams": ("stripe.params._payout_update_params", False), "PlanCreateParams": ("stripe.params._plan_create_params", False), "PlanCreateParamsProduct": ("stripe.params._plan_create_params", False), + "PlanCreateParamsProductTaxDetails": ( + "stripe.params._plan_create_params", + False, + ), "PlanCreateParamsTier": ("stripe.params._plan_create_params", False), "PlanCreateParamsTransformUsage": ( "stripe.params._plan_create_params", @@ -19136,6 +19429,10 @@ "stripe.params._price_create_params", False, ), + "PriceCreateParamsProductDataTaxDetails": ( + "stripe.params._price_create_params", + False, + ), "PriceCreateParamsRecurring": ( "stripe.params._price_create_params", False, @@ -19221,6 +19518,10 @@ "stripe.params._product_create_params", False, ), + "ProductCreateParamsTaxDetails": ( + "stripe.params._product_create_params", + False, + ), "ProductDeleteFeatureParams": ( "stripe.params._product_delete_feature_params", False, @@ -19257,6 +19558,10 @@ "stripe.params._product_modify_params", False, ), + "ProductModifyParamsTaxDetails": ( + "stripe.params._product_modify_params", + False, + ), "ProductRetrieveFeatureParams": ( "stripe.params._product_retrieve_feature_params", False, @@ -19272,6 +19577,10 @@ "stripe.params._product_update_params", False, ), + "ProductUpdateParamsTaxDetails": ( + "stripe.params._product_update_params", + False, + ), "PromotionCodeCreateParams": ( "stripe.params._promotion_code_create_params", False, @@ -20354,6 +20663,14 @@ "stripe.params._setup_intent_confirm_params", False, ), + "SetupIntentConfirmParamsPaymentMethodDataUpi": ( + "stripe.params._setup_intent_confirm_params", + False, + ), + "SetupIntentConfirmParamsPaymentMethodDataUpiMandateOptions": ( + "stripe.params._setup_intent_confirm_params", + False, + ), "SetupIntentConfirmParamsPaymentMethodDataUsBankAccount": ( "stripe.params._setup_intent_confirm_params", False, @@ -20462,6 +20779,14 @@ "stripe.params._setup_intent_confirm_params", False, ), + "SetupIntentConfirmParamsPaymentMethodOptionsUpi": ( + "stripe.params._setup_intent_confirm_params", + False, + ), + "SetupIntentConfirmParamsPaymentMethodOptionsUpiMandateOptions": ( + "stripe.params._setup_intent_confirm_params", + False, + ), "SetupIntentConfirmParamsPaymentMethodOptionsUsBankAccount": ( "stripe.params._setup_intent_confirm_params", False, @@ -20750,6 +21075,14 @@ "stripe.params._setup_intent_create_params", False, ), + "SetupIntentCreateParamsPaymentMethodDataUpi": ( + "stripe.params._setup_intent_create_params", + False, + ), + "SetupIntentCreateParamsPaymentMethodDataUpiMandateOptions": ( + "stripe.params._setup_intent_create_params", + False, + ), "SetupIntentCreateParamsPaymentMethodDataUsBankAccount": ( "stripe.params._setup_intent_create_params", False, @@ -20858,6 +21191,14 @@ "stripe.params._setup_intent_create_params", False, ), + "SetupIntentCreateParamsPaymentMethodOptionsUpi": ( + "stripe.params._setup_intent_create_params", + False, + ), + "SetupIntentCreateParamsPaymentMethodOptionsUpiMandateOptions": ( + "stripe.params._setup_intent_create_params", + False, + ), "SetupIntentCreateParamsPaymentMethodOptionsUsBankAccount": ( "stripe.params._setup_intent_create_params", False, @@ -21138,6 +21479,14 @@ "stripe.params._setup_intent_modify_params", False, ), + "SetupIntentModifyParamsPaymentMethodDataUpi": ( + "stripe.params._setup_intent_modify_params", + False, + ), + "SetupIntentModifyParamsPaymentMethodDataUpiMandateOptions": ( + "stripe.params._setup_intent_modify_params", + False, + ), "SetupIntentModifyParamsPaymentMethodDataUsBankAccount": ( "stripe.params._setup_intent_modify_params", False, @@ -21246,6 +21595,14 @@ "stripe.params._setup_intent_modify_params", False, ), + "SetupIntentModifyParamsPaymentMethodOptionsUpi": ( + "stripe.params._setup_intent_modify_params", + False, + ), + "SetupIntentModifyParamsPaymentMethodOptionsUpiMandateOptions": ( + "stripe.params._setup_intent_modify_params", + False, + ), "SetupIntentModifyParamsPaymentMethodOptionsUsBankAccount": ( "stripe.params._setup_intent_modify_params", False, @@ -21518,6 +21875,14 @@ "stripe.params._setup_intent_update_params", False, ), + "SetupIntentUpdateParamsPaymentMethodDataUpi": ( + "stripe.params._setup_intent_update_params", + False, + ), + "SetupIntentUpdateParamsPaymentMethodDataUpiMandateOptions": ( + "stripe.params._setup_intent_update_params", + False, + ), "SetupIntentUpdateParamsPaymentMethodDataUsBankAccount": ( "stripe.params._setup_intent_update_params", False, @@ -21626,6 +21991,14 @@ "stripe.params._setup_intent_update_params", False, ), + "SetupIntentUpdateParamsPaymentMethodOptionsUpi": ( + "stripe.params._setup_intent_update_params", + False, + ), + "SetupIntentUpdateParamsPaymentMethodOptionsUpiMandateOptions": ( + "stripe.params._setup_intent_update_params", + False, + ), "SetupIntentUpdateParamsPaymentMethodOptionsUsBankAccount": ( "stripe.params._setup_intent_update_params", False, @@ -21959,6 +22332,10 @@ "stripe.params._subscription_create_params", False, ), + "SubscriptionCreateParamsItemCurrentTrial": ( + "stripe.params._subscription_create_params", + False, + ), "SubscriptionCreateParamsItemDiscount": ( "stripe.params._subscription_create_params", False, @@ -22103,6 +22480,10 @@ "stripe.params._subscription_item_create_params", False, ), + "SubscriptionItemCreateParamsCurrentTrial": ( + "stripe.params._subscription_item_create_params", + False, + ), "SubscriptionItemCreateParamsDiscount": ( "stripe.params._subscription_item_create_params", False, @@ -22143,6 +22524,10 @@ "stripe.params._subscription_item_modify_params", False, ), + "SubscriptionItemModifyParamsCurrentTrial": ( + "stripe.params._subscription_item_modify_params", + False, + ), "SubscriptionItemModifyParamsDiscount": ( "stripe.params._subscription_item_modify_params", False, @@ -22175,6 +22560,10 @@ "stripe.params._subscription_item_update_params", False, ), + "SubscriptionItemUpdateParamsCurrentTrial": ( + "stripe.params._subscription_item_update_params", + False, + ), "SubscriptionItemUpdateParamsDiscount": ( "stripe.params._subscription_item_update_params", False, @@ -22323,6 +22712,10 @@ "stripe.params._subscription_modify_params", False, ), + "SubscriptionModifyParamsItemCurrentTrial": ( + "stripe.params._subscription_modify_params", + False, + ), "SubscriptionModifyParamsItemDiscount": ( "stripe.params._subscription_modify_params", False, @@ -23219,6 +23612,10 @@ "stripe.params._subscription_update_params", False, ), + "SubscriptionUpdateParamsItemCurrentTrial": ( + "stripe.params._subscription_update_params", + False, + ), "SubscriptionUpdateParamsItemDiscount": ( "stripe.params._subscription_update_params", False, diff --git a/stripe/params/_account_create_params.py b/stripe/params/_account_create_params.py index 1b1ca989b..e6fab0635 100644 --- a/stripe/params/_account_create_params.py +++ b/stripe/params/_account_create_params.py @@ -608,6 +608,10 @@ class AccountCreateParamsCapabilities(TypedDict): """ The twint_payments capability. """ + upi_payments: NotRequired["AccountCreateParamsCapabilitiesUpiPayments"] + """ + The upi_payments capability. + """ us_bank_account_ach_payments: NotRequired[ "AccountCreateParamsCapabilitiesUsBankAccountAchPayments" ] @@ -1123,6 +1127,13 @@ class AccountCreateParamsCapabilitiesTwintPayments(TypedDict): """ +class AccountCreateParamsCapabilitiesUpiPayments(TypedDict): + requested: NotRequired[bool] + """ + Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + """ + + class AccountCreateParamsCapabilitiesUsBankAccountAchPayments(TypedDict): requested: NotRequired[bool] """ @@ -2261,7 +2272,7 @@ class AccountCreateParamsSettingsPaypayPayments(TypedDict): """ goods_type: NotRequired[Literal["digital_content", "other"]] """ - Whether your business sells digital content or not. + The type of goods your business sells. Use `digital_content` if you sell digital content. Use `other` for all other types of goods or services. """ site: NotRequired["AccountCreateParamsSettingsPaypayPaymentsSite"] """ diff --git a/stripe/params/_account_update_params.py b/stripe/params/_account_update_params.py index c25f0284a..8cdc5eece 100644 --- a/stripe/params/_account_update_params.py +++ b/stripe/params/_account_update_params.py @@ -595,6 +595,10 @@ class AccountUpdateParamsCapabilities(TypedDict): """ The twint_payments capability. """ + upi_payments: NotRequired["AccountUpdateParamsCapabilitiesUpiPayments"] + """ + The upi_payments capability. + """ us_bank_account_ach_payments: NotRequired[ "AccountUpdateParamsCapabilitiesUsBankAccountAchPayments" ] @@ -1110,6 +1114,13 @@ class AccountUpdateParamsCapabilitiesTwintPayments(TypedDict): """ +class AccountUpdateParamsCapabilitiesUpiPayments(TypedDict): + requested: NotRequired[bool] + """ + Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. + """ + + class AccountUpdateParamsCapabilitiesUsBankAccountAchPayments(TypedDict): requested: NotRequired[bool] """ @@ -2177,7 +2188,7 @@ class AccountUpdateParamsSettingsPaypayPayments(TypedDict): """ goods_type: NotRequired[Literal["digital_content", "other"]] """ - Whether your business sells digital content or not. + The type of goods your business sells. Use `digital_content` if you sell digital content. Use `other` for all other types of goods or services. """ site: NotRequired["AccountUpdateParamsSettingsPaypayPaymentsSite"] """ diff --git a/stripe/params/_confirmation_token_create_params.py b/stripe/params/_confirmation_token_create_params.py index c43ddc192..53ac11f0b 100644 --- a/stripe/params/_confirmation_token_create_params.py +++ b/stripe/params/_confirmation_token_create_params.py @@ -389,6 +389,7 @@ class ConfirmationTokenCreateParamsPaymentMethodData(TypedDict): "stripe_balance", "swish", "twint", + "upi", "us_bank_account", "wechat_pay", "zip", @@ -396,6 +397,10 @@ class ConfirmationTokenCreateParamsPaymentMethodData(TypedDict): """ 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. """ + upi: NotRequired["ConfirmationTokenCreateParamsPaymentMethodDataUpi"] + """ + If this is a `upi` PaymentMethod, this hash contains details about the UPI payment method. + """ us_bank_account: NotRequired[ "ConfirmationTokenCreateParamsPaymentMethodDataUsBankAccount" ] @@ -915,10 +920,6 @@ class ConfirmationTokenCreateParamsPaymentMethodDataStripeBalance(TypedDict): """ The connected account ID whose Stripe balance to use as the source of payment """ - source_type: NotRequired[Literal["bank_account", "card", "fpx"]] - """ - The [source_type](https://docs.stripe.com/api/balance/balance_object#balance_object-available-source_types) of the balance - """ class ConfirmationTokenCreateParamsPaymentMethodDataSwish(TypedDict): @@ -929,6 +930,36 @@ class ConfirmationTokenCreateParamsPaymentMethodDataTwint(TypedDict): pass +class ConfirmationTokenCreateParamsPaymentMethodDataUpi(TypedDict): + mandate_options: NotRequired[ + "ConfirmationTokenCreateParamsPaymentMethodDataUpiMandateOptions" + ] + """ + Configuration options for setting up an eMandate + """ + + +class ConfirmationTokenCreateParamsPaymentMethodDataUpiMandateOptions( + TypedDict, +): + amount: NotRequired[int] + """ + Amount to be charged for future payments. + """ + amount_type: NotRequired[Literal["fixed", "maximum"]] + """ + One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param. + """ + description: NotRequired[str] + """ + A description of the mandate or subscription that is meant to be displayed to the customer. + """ + end_date: NotRequired[int] + """ + End date of the mandate or subscription. + """ + + class ConfirmationTokenCreateParamsPaymentMethodDataUsBankAccount(TypedDict): account_holder_type: NotRequired[Literal["company", "individual"]] """ diff --git a/stripe/params/_credit_note_create_params.py b/stripe/params/_credit_note_create_params.py index 2714e0e6b..4fa2d3df4 100644 --- a/stripe/params/_credit_note_create_params.py +++ b/stripe/params/_credit_note_create_params.py @@ -81,6 +81,10 @@ class CreditNoteCreateParamsLine(TypedDict): """ The invoice line item to credit. Only valid when the `type` is `invoice_line_item`. """ + metadata: NotRequired[Dict[str, 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`. + """ quantity: NotRequired[int] """ The line item quantity to credit. diff --git a/stripe/params/_credit_note_preview_lines_list_params.py b/stripe/params/_credit_note_preview_lines_list_params.py index dc81f33c1..dac37c266 100644 --- a/stripe/params/_credit_note_preview_lines_list_params.py +++ b/stripe/params/_credit_note_preview_lines_list_params.py @@ -92,6 +92,10 @@ class CreditNotePreviewLinesListParamsLine(TypedDict): """ The invoice line item to credit. Only valid when the `type` is `invoice_line_item`. """ + metadata: NotRequired[Dict[str, 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`. + """ quantity: NotRequired[int] """ The line item quantity to credit. diff --git a/stripe/params/_credit_note_preview_lines_params.py b/stripe/params/_credit_note_preview_lines_params.py index 8434b10d8..60016514a 100644 --- a/stripe/params/_credit_note_preview_lines_params.py +++ b/stripe/params/_credit_note_preview_lines_params.py @@ -93,6 +93,10 @@ class CreditNotePreviewLinesParamsLine(TypedDict): """ The invoice line item to credit. Only valid when the `type` is `invoice_line_item`. """ + metadata: NotRequired[Dict[str, 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`. + """ quantity: NotRequired[int] """ The line item quantity to credit. diff --git a/stripe/params/_credit_note_preview_params.py b/stripe/params/_credit_note_preview_params.py index a88442f97..484a3fdaf 100644 --- a/stripe/params/_credit_note_preview_params.py +++ b/stripe/params/_credit_note_preview_params.py @@ -81,6 +81,10 @@ class CreditNotePreviewParamsLine(TypedDict): """ The invoice line item to credit. Only valid when the `type` is `invoice_line_item`. """ + metadata: NotRequired[Dict[str, 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`. + """ quantity: NotRequired[int] """ The line item quantity to credit. diff --git a/stripe/params/_customer_list_payment_methods_params.py b/stripe/params/_customer_list_payment_methods_params.py index 1dfaf8df4..3faba9082 100644 --- a/stripe/params/_customer_list_payment_methods_params.py +++ b/stripe/params/_customer_list_payment_methods_params.py @@ -83,6 +83,7 @@ class CustomerListPaymentMethodsParams(RequestOptions): "stripe_balance", "swish", "twint", + "upi", "us_bank_account", "wechat_pay", "zip", diff --git a/stripe/params/_customer_payment_method_list_params.py b/stripe/params/_customer_payment_method_list_params.py index 3a93cee13..041b4e089 100644 --- a/stripe/params/_customer_payment_method_list_params.py +++ b/stripe/params/_customer_payment_method_list_params.py @@ -82,6 +82,7 @@ class CustomerPaymentMethodListParams(TypedDict): "stripe_balance", "swish", "twint", + "upi", "us_bank_account", "wechat_pay", "zip", diff --git a/stripe/params/_invoice_add_lines_params.py b/stripe/params/_invoice_add_lines_params.py index 0eada73fd..9d4ec226b 100644 --- a/stripe/params/_invoice_add_lines_params.py +++ b/stripe/params/_invoice_add_lines_params.py @@ -65,7 +65,11 @@ class InvoiceAddLinesParamsLine(TypedDict): """ quantity: NotRequired[int] """ - Non-negative integer. The quantity of units for the line item. + Non-negative integer. The quantity of units for the line item. Use `quantity_decimal` instead to provide decimal precision. This field will be deprecated in favor of `quantity_decimal` in a future version. + """ + quantity_decimal: NotRequired[str] + """ + Non-negative decimal with at most 12 decimal places. The quantity of units for the line item. """ tax_amounts: NotRequired[ "Literal['']|List[InvoiceAddLinesParamsLineTaxAmount]" @@ -185,12 +189,29 @@ class InvoiceAddLinesParamsLinePriceDataProductData(TypedDict): """ A [tax code](https://docs.stripe.com/tax/tax-categories) ID. """ + tax_details: NotRequired[ + "InvoiceAddLinesParamsLinePriceDataProductDataTaxDetails" + ] + """ + Tax details for this product, including the [tax code](https://docs.stripe.com/tax/tax-codes) and an optional performance location. + """ unit_label: NotRequired[str] """ A label that represents units of this product. When set, this will be included in customers' receipts, invoices, Checkout, and the customer portal. """ +class InvoiceAddLinesParamsLinePriceDataProductDataTaxDetails(TypedDict): + performance_location: NotRequired[str] + """ + A tax location ID. Depending on the [tax code](https://docs.stripe.com/tax/tax-for-tickets/reference/tax-location-performance), this is required, optional, or not supported. + """ + tax_code: str + """ + A [tax code](https://docs.stripe.com/tax/tax-categories) ID. + """ + + class InvoiceAddLinesParamsLinePricing(TypedDict): price: NotRequired[str] """ diff --git a/stripe/params/_invoice_create_params.py b/stripe/params/_invoice_create_params.py index 16d431a45..37395235d 100644 --- a/stripe/params/_invoice_create_params.py +++ b/stripe/params/_invoice_create_params.py @@ -535,6 +535,10 @@ class InvoiceCreateParamsPaymentSettingsPaymentMethodOptionsPix(TypedDict): """ Determines if the amount includes the IOF tax. Defaults to `never`. """ + expires_after_seconds: NotRequired[int] + """ + The number of seconds (between 10 and 1209600) after which Pix payment will expire. Defaults to 86400 seconds. + """ class InvoiceCreateParamsPaymentSettingsPaymentMethodOptionsSepaDebit( diff --git a/stripe/params/_invoice_create_preview_params.py b/stripe/params/_invoice_create_preview_params.py index ee9bcd848..2aedd8f12 100644 --- a/stripe/params/_invoice_create_preview_params.py +++ b/stripe/params/_invoice_create_preview_params.py @@ -415,7 +415,11 @@ class InvoiceCreatePreviewParamsInvoiceItem(TypedDict): """ quantity: NotRequired[int] """ - Non-negative integer. The quantity of units for the invoice item. + Non-negative integer. The quantity of units for the invoice item. Use `quantity_decimal` instead to provide decimal precision. This field will be deprecated in favor of `quantity_decimal` in a future version. + """ + quantity_decimal: NotRequired[str] + """ + Non-negative decimal with at most 12 decimal places. The quantity of units for the invoice item. """ tax_behavior: NotRequired[Literal["exclusive", "inclusive", "unspecified"]] """ @@ -901,6 +905,10 @@ class InvoiceCreatePreviewParamsScheduleDetailsAmendmentItemActionAdd( """ Options that configure the trial on the subscription item. """ + trial_offer: NotRequired[str] + """ + The ID of the trial offer to apply to the configuration item. + """ class InvoiceCreatePreviewParamsScheduleDetailsAmendmentItemActionAddDiscount( @@ -1013,6 +1021,10 @@ class InvoiceCreatePreviewParamsScheduleDetailsAmendmentItemActionSet( """ If an item with the `price` already exists, passing this will override the `trial` configuration on the subscription item that matches that price. Otherwise, the `items` array is cleared and a single new item is added with the supplied `trial`. """ + trial_offer: NotRequired[str] + """ + The ID of the trial offer to apply to the configuration item. + """ class InvoiceCreatePreviewParamsScheduleDetailsAmendmentItemActionSetDiscount( @@ -1124,7 +1136,7 @@ class InvoiceCreatePreviewParamsScheduleDetailsAmendmentSetPauseCollectionSet( ): behavior: Literal["keep_as_draft", "mark_uncollectible", "void"] """ - The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`. + The payment collection behavior for this subscription while paused. """ @@ -1631,6 +1643,10 @@ class InvoiceCreatePreviewParamsScheduleDetailsPhaseItem(TypedDict): """ Options that configure the trial on the subscription item. """ + trial_offer: NotRequired[str] + """ + The ID of the trial offer to apply to the configuration item. + """ class InvoiceCreatePreviewParamsScheduleDetailsPhaseItemBillingThresholds( @@ -1751,7 +1767,7 @@ class InvoiceCreatePreviewParamsScheduleDetailsPhaseItemTrial(TypedDict): class InvoiceCreatePreviewParamsScheduleDetailsPhasePauseCollection(TypedDict): behavior: Literal["keep_as_draft", "mark_uncollectible", "void"] """ - The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`. + The payment collection behavior for this subscription while paused. """ @@ -2012,6 +2028,12 @@ class InvoiceCreatePreviewParamsSubscriptionDetailsItem(TypedDict): """ Delete all usage for a given subscription item. You must pass this when deleting a usage records subscription item. `clear_usage` has no effect if the plan has a billing meter attached. """ + current_trial: NotRequired[ + "InvoiceCreatePreviewParamsSubscriptionDetailsItemCurrentTrial" + ] + """ + The trial offer to apply to this subscription item. + """ deleted: NotRequired[bool] """ A flag that, if set to `true`, will delete the specified item. @@ -2063,6 +2085,17 @@ class InvoiceCreatePreviewParamsSubscriptionDetailsItemBillingThresholds( """ +class InvoiceCreatePreviewParamsSubscriptionDetailsItemCurrentTrial(TypedDict): + trial_end: NotRequired[int] + """ + Unix timestamp representing the end of the trial offer period. Required when the trial offer has `duration.type=timestamp`. Cannot be specified when `duration.type=relative`. + """ + trial_offer: str + """ + The ID of the trial offer to apply to the subscription item. + """ + + class InvoiceCreatePreviewParamsSubscriptionDetailsItemDiscount(TypedDict): coupon: NotRequired[str] """ diff --git a/stripe/params/_invoice_item_create_params.py b/stripe/params/_invoice_item_create_params.py index 8973bd53a..3f4516fb1 100644 --- a/stripe/params/_invoice_item_create_params.py +++ b/stripe/params/_invoice_item_create_params.py @@ -64,7 +64,11 @@ class InvoiceItemCreateParams(RequestOptions): """ quantity: NotRequired[int] """ - Non-negative integer. The quantity of units for the invoice item. + Non-negative integer. The quantity of units for the invoice item. Use `quantity_decimal` instead to provide decimal precision. This field will be deprecated in favor of `quantity_decimal` in a future version. + """ + quantity_decimal: NotRequired[str] + """ + Non-negative decimal with at most 12 decimal places. The quantity of units for the invoice item. """ subscription: NotRequired[str] """ diff --git a/stripe/params/_invoice_item_modify_params.py b/stripe/params/_invoice_item_modify_params.py index 6a6623db4..580c5d295 100644 --- a/stripe/params/_invoice_item_modify_params.py +++ b/stripe/params/_invoice_item_modify_params.py @@ -48,7 +48,11 @@ class InvoiceItemModifyParams(RequestOptions): """ quantity: NotRequired[int] """ - Non-negative integer. The quantity of units for the invoice item. + Non-negative integer. The quantity of units for the invoice item. Use `quantity_decimal` instead to provide decimal precision. This field will be deprecated in favor of `quantity_decimal` in a future version. + """ + quantity_decimal: NotRequired[str] + """ + Non-negative decimal with at most 12 decimal places. The quantity of units for the line item. """ tax_behavior: NotRequired[Literal["exclusive", "inclusive", "unspecified"]] """ diff --git a/stripe/params/_invoice_item_update_params.py b/stripe/params/_invoice_item_update_params.py index f10d2bef8..ea5260b3b 100644 --- a/stripe/params/_invoice_item_update_params.py +++ b/stripe/params/_invoice_item_update_params.py @@ -47,7 +47,11 @@ class InvoiceItemUpdateParams(TypedDict): """ quantity: NotRequired[int] """ - Non-negative integer. The quantity of units for the invoice item. + Non-negative integer. The quantity of units for the invoice item. Use `quantity_decimal` instead to provide decimal precision. This field will be deprecated in favor of `quantity_decimal` in a future version. + """ + quantity_decimal: NotRequired[str] + """ + Non-negative decimal with at most 12 decimal places. The quantity of units for the line item. """ tax_behavior: NotRequired[Literal["exclusive", "inclusive", "unspecified"]] """ diff --git a/stripe/params/_invoice_line_item_update_params.py b/stripe/params/_invoice_line_item_update_params.py index 31fc52d74..18ea8265d 100644 --- a/stripe/params/_invoice_line_item_update_params.py +++ b/stripe/params/_invoice_line_item_update_params.py @@ -33,7 +33,7 @@ class InvoiceLineItemUpdateParams(TypedDict): """ metadata: NotRequired["Literal['']|Dict[str, 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`. For [type=subscription](https://docs.stripe.com/api/invoices/line_item#invoice_line_item_object-type) line items, the incoming metadata specified on the request is directly used to set this value, in contrast to [type=invoiceitem](api/invoices/line_item#invoice_line_item_object-type) line items, where any existing metadata on the invoice line is merged with the incoming data. + 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`. For [type=subscription](https://docs.stripe.com/api/invoices/line_item) line items, the incoming metadata specified on the request is directly used to set this value, in contrast to [type=invoiceitem](https://docs.stripe.com/api/invoices/line_item) line items, where any existing metadata on the invoice line is merged with the incoming data. """ period: NotRequired["InvoiceLineItemUpdateParamsPeriod"] """ @@ -49,7 +49,11 @@ class InvoiceLineItemUpdateParams(TypedDict): """ quantity: NotRequired[int] """ - Non-negative integer. The quantity of units for the line item. + Non-negative integer. The quantity of units for the line item. Use `quantity_decimal` instead to provide decimal precision. This field will be deprecated in favor of `quantity_decimal` in a future version. + """ + quantity_decimal: NotRequired[str] + """ + Non-negative decimal with at most 12 decimal places. The quantity of units for the line item. """ tax_amounts: NotRequired[ "Literal['']|List[InvoiceLineItemUpdateParamsTaxAmount]" @@ -171,12 +175,29 @@ class InvoiceLineItemUpdateParamsPriceDataProductData(TypedDict): """ A [tax code](https://docs.stripe.com/tax/tax-categories) ID. """ + tax_details: NotRequired[ + "InvoiceLineItemUpdateParamsPriceDataProductDataTaxDetails" + ] + """ + Tax details for this product, including the [tax code](https://docs.stripe.com/tax/tax-codes) and an optional performance location. + """ unit_label: NotRequired[str] """ A label that represents units of this product. When set, this will be included in customers' receipts, invoices, Checkout, and the customer portal. """ +class InvoiceLineItemUpdateParamsPriceDataProductDataTaxDetails(TypedDict): + performance_location: NotRequired[str] + """ + A tax location ID. Depending on the [tax code](https://docs.stripe.com/tax/tax-for-tickets/reference/tax-location-performance), this is required, optional, or not supported. + """ + tax_code: str + """ + A [tax code](https://docs.stripe.com/tax/tax-categories) ID. + """ + + class InvoiceLineItemUpdateParamsPricing(TypedDict): price: NotRequired[str] """ diff --git a/stripe/params/_invoice_modify_params.py b/stripe/params/_invoice_modify_params.py index 975465edd..0bb99f606 100644 --- a/stripe/params/_invoice_modify_params.py +++ b/stripe/params/_invoice_modify_params.py @@ -502,6 +502,10 @@ class InvoiceModifyParamsPaymentSettingsPaymentMethodOptionsPix(TypedDict): """ Determines if the amount includes the IOF tax. Defaults to `never`. """ + expires_after_seconds: NotRequired[int] + """ + The number of seconds (between 10 and 1209600) after which Pix payment will expire. Defaults to 86400 seconds. + """ class InvoiceModifyParamsPaymentSettingsPaymentMethodOptionsSepaDebit( diff --git a/stripe/params/_invoice_update_lines_params.py b/stripe/params/_invoice_update_lines_params.py index c8ebf3e53..a464da73a 100644 --- a/stripe/params/_invoice_update_lines_params.py +++ b/stripe/params/_invoice_update_lines_params.py @@ -65,7 +65,11 @@ class InvoiceUpdateLinesParamsLine(TypedDict): """ quantity: NotRequired[int] """ - Non-negative integer. The quantity of units for the line item. + Non-negative integer. The quantity of units for the line item. Use `quantity_decimal` instead to provide decimal precision. This field will be deprecated in favor of `quantity_decimal` in a future version. + """ + quantity_decimal: NotRequired[str] + """ + Non-negative decimal with at most 12 decimal places. The quantity of units for the line item. """ tax_amounts: NotRequired[ "Literal['']|List[InvoiceUpdateLinesParamsLineTaxAmount]" @@ -189,12 +193,29 @@ class InvoiceUpdateLinesParamsLinePriceDataProductData(TypedDict): """ A [tax code](https://docs.stripe.com/tax/tax-categories) ID. """ + tax_details: NotRequired[ + "InvoiceUpdateLinesParamsLinePriceDataProductDataTaxDetails" + ] + """ + Tax details for this product, including the [tax code](https://docs.stripe.com/tax/tax-codes) and an optional performance location. + """ unit_label: NotRequired[str] """ A label that represents units of this product. When set, this will be included in customers' receipts, invoices, Checkout, and the customer portal. """ +class InvoiceUpdateLinesParamsLinePriceDataProductDataTaxDetails(TypedDict): + performance_location: NotRequired[str] + """ + A tax location ID. Depending on the [tax code](https://docs.stripe.com/tax/tax-for-tickets/reference/tax-location-performance), this is required, optional, or not supported. + """ + tax_code: str + """ + A [tax code](https://docs.stripe.com/tax/tax-categories) ID. + """ + + class InvoiceUpdateLinesParamsLinePricing(TypedDict): price: NotRequired[str] """ diff --git a/stripe/params/_invoice_update_params.py b/stripe/params/_invoice_update_params.py index 5e549cd7c..d5882269a 100644 --- a/stripe/params/_invoice_update_params.py +++ b/stripe/params/_invoice_update_params.py @@ -501,6 +501,10 @@ class InvoiceUpdateParamsPaymentSettingsPaymentMethodOptionsPix(TypedDict): """ Determines if the amount includes the IOF tax. Defaults to `never`. """ + expires_after_seconds: NotRequired[int] + """ + The number of seconds (between 10 and 1209600) after which Pix payment will expire. Defaults to 86400 seconds. + """ class InvoiceUpdateParamsPaymentSettingsPaymentMethodOptionsSepaDebit( diff --git a/stripe/params/_order_create_params.py b/stripe/params/_order_create_params.py index 73bdf1c8f..484dba004 100644 --- a/stripe/params/_order_create_params.py +++ b/stripe/params/_order_create_params.py @@ -467,7 +467,7 @@ class OrderCreateParamsPaymentSettingsPaymentMethodOptionsAcssDebit(TypedDict): Literal["automatic", "instant", "microdeposits"] ] """ - Bank account verification method. + Bank account verification method. The default value is `automatic`. """ diff --git a/stripe/params/_order_modify_params.py b/stripe/params/_order_modify_params.py index dcc5b42d9..b31931a94 100644 --- a/stripe/params/_order_modify_params.py +++ b/stripe/params/_order_modify_params.py @@ -475,7 +475,7 @@ class OrderModifyParamsPaymentSettingsPaymentMethodOptionsAcssDebit(TypedDict): Literal["automatic", "instant", "microdeposits"] ] """ - Bank account verification method. + Bank account verification method. The default value is `automatic`. """ diff --git a/stripe/params/_order_update_params.py b/stripe/params/_order_update_params.py index 83dae8735..3e6b0a689 100644 --- a/stripe/params/_order_update_params.py +++ b/stripe/params/_order_update_params.py @@ -474,7 +474,7 @@ class OrderUpdateParamsPaymentSettingsPaymentMethodOptionsAcssDebit(TypedDict): Literal["automatic", "instant", "microdeposits"] ] """ - Bank account verification method. + Bank account verification method. The default value is `automatic`. """ diff --git a/stripe/params/_payment_intent_capture_params.py b/stripe/params/_payment_intent_capture_params.py index d02be5a0b..5131a7151 100644 --- a/stripe/params/_payment_intent_capture_params.py +++ b/stripe/params/_payment_intent_capture_params.py @@ -84,6 +84,12 @@ class PaymentIntentCaptureParamsAmountDetails(TypedDict): """ Contains information about the shipping portion of the amount. """ + surcharge: NotRequired[ + "Literal['']|PaymentIntentCaptureParamsAmountDetailsSurcharge" + ] + """ + Contains information about the surcharge portion of the amount. + """ tax: NotRequired["Literal['']|PaymentIntentCaptureParamsAmountDetailsTax"] """ Contains information about the tax portion of the amount. @@ -242,6 +248,19 @@ class PaymentIntentCaptureParamsAmountDetailsShipping(TypedDict): """ +class PaymentIntentCaptureParamsAmountDetailsSurcharge(TypedDict): + amount: NotRequired["Literal['']|int"] + """ + Portion of the amount that corresponds to a surcharge. + """ + enforce_validation: NotRequired[ + "Literal['']|Literal['automatic', 'disabled', 'enabled']" + ] + """ + Indicate whether to enforce validations on the surcharge amount. + """ + + class PaymentIntentCaptureParamsAmountDetailsTax(TypedDict): total_tax_amount: int """ diff --git a/stripe/params/_payment_intent_confirm_params.py b/stripe/params/_payment_intent_confirm_params.py index 48f565af2..16a223f3e 100644 --- a/stripe/params/_payment_intent_confirm_params.py +++ b/stripe/params/_payment_intent_confirm_params.py @@ -33,7 +33,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[Literal['acss_debit', 'affirm', 'afterpay_clearpay', 'alipay', 'alma', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'billie', 'blik', 'boleto', 'card', 'cashapp', 'crypto', 'customer_balance', 'eps', 'fpx', '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', 'sepa_debit', 'shopeepay', 'sofort', 'stripe_balance', 'swish', 'twint', 'us_bank_account', 'wechat_pay', 'zip']]" + "Literal['']|List[Literal['acss_debit', 'affirm', 'afterpay_clearpay', 'alipay', 'alma', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'billie', 'blik', 'boleto', 'card', 'cashapp', 'crypto', 'customer_balance', 'eps', 'fpx', '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', 'sepa_debit', 'shopeepay', 'sofort', 'stripe_balance', 'swish', 'twint', 'upi', 'us_bank_account', 'wechat_pay', 'zip']]" ] """ The list of payment method types to exclude from use with this payment. @@ -155,6 +155,12 @@ class PaymentIntentConfirmParamsAmountDetails(TypedDict): """ Contains information about the shipping portion of the amount. """ + surcharge: NotRequired[ + "Literal['']|PaymentIntentConfirmParamsAmountDetailsSurcharge" + ] + """ + Contains information about the surcharge portion of the amount. + """ tax: NotRequired["Literal['']|PaymentIntentConfirmParamsAmountDetailsTax"] """ Contains information about the tax portion of the amount. @@ -313,6 +319,19 @@ class PaymentIntentConfirmParamsAmountDetailsShipping(TypedDict): """ +class PaymentIntentConfirmParamsAmountDetailsSurcharge(TypedDict): + amount: NotRequired["Literal['']|int"] + """ + Portion of the amount that corresponds to a surcharge. + """ + enforce_validation: NotRequired[ + "Literal['']|Literal['automatic', 'disabled', 'enabled']" + ] + """ + Indicate whether to enforce validations on the surcharge amount. + """ + + class PaymentIntentConfirmParamsAmountDetailsTax(TypedDict): total_tax_amount: int """ @@ -2547,6 +2566,7 @@ class PaymentIntentConfirmParamsPaymentMethodData(TypedDict): "stripe_balance", "swish", "twint", + "upi", "us_bank_account", "wechat_pay", "zip", @@ -2554,6 +2574,10 @@ class PaymentIntentConfirmParamsPaymentMethodData(TypedDict): """ 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. """ + upi: NotRequired["PaymentIntentConfirmParamsPaymentMethodDataUpi"] + """ + If this is a `upi` PaymentMethod, this hash contains details about the UPI payment method. + """ us_bank_account: NotRequired[ "PaymentIntentConfirmParamsPaymentMethodDataUsBankAccount" ] @@ -3071,10 +3095,6 @@ class PaymentIntentConfirmParamsPaymentMethodDataStripeBalance(TypedDict): """ The connected account ID whose Stripe balance to use as the source of payment """ - source_type: NotRequired[Literal["bank_account", "card", "fpx"]] - """ - The [source_type](https://docs.stripe.com/api/balance/balance_object#balance_object-available-source_types) of the balance - """ class PaymentIntentConfirmParamsPaymentMethodDataSwish(TypedDict): @@ -3085,6 +3105,34 @@ class PaymentIntentConfirmParamsPaymentMethodDataTwint(TypedDict): pass +class PaymentIntentConfirmParamsPaymentMethodDataUpi(TypedDict): + mandate_options: NotRequired[ + "PaymentIntentConfirmParamsPaymentMethodDataUpiMandateOptions" + ] + """ + Configuration options for setting up an eMandate + """ + + +class PaymentIntentConfirmParamsPaymentMethodDataUpiMandateOptions(TypedDict): + amount: NotRequired[int] + """ + Amount to be charged for future payments. + """ + amount_type: NotRequired[Literal["fixed", "maximum"]] + """ + One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param. + """ + description: NotRequired[str] + """ + A description of the mandate or subscription that is meant to be displayed to the customer. + """ + end_date: NotRequired[int] + """ + End date of the mandate or subscription. + """ + + class PaymentIntentConfirmParamsPaymentMethodDataUsBankAccount(TypedDict): account_holder_type: NotRequired[Literal["company", "individual"]] """ @@ -3453,6 +3501,12 @@ class PaymentIntentConfirmParamsPaymentMethodOptions(TypedDict): """ If this is a `twint` PaymentMethod, this sub-hash contains details about the TWINT payment method options. """ + upi: NotRequired[ + "Literal['']|PaymentIntentConfirmParamsPaymentMethodOptionsUpi" + ] + """ + If this is a `upi` PaymentIntent, this sub-hash contains details about the UPI payment method options. + """ us_bank_account: NotRequired[ "Literal['']|PaymentIntentConfirmParamsPaymentMethodOptionsUsBankAccount" ] @@ -3502,7 +3556,7 @@ class PaymentIntentConfirmParamsPaymentMethodOptionsAcssDebit(TypedDict): Literal["automatic", "instant", "microdeposits"] ] """ - Bank account verification method. + Bank account verification method. The default value is `automatic`. """ @@ -3939,7 +3993,7 @@ class PaymentIntentConfirmParamsPaymentMethodOptionsCardMandateOptions( ): amount: int """ - Amount to be charged for future payments. + Amount to be charged for future payments, specified in the presentment currency. """ amount_type: Literal["fixed", "maximum"] """ @@ -6124,7 +6178,7 @@ class PaymentIntentConfirmParamsPaymentMethodOptionsPixMandateOptions( Literal["halfyearly", "monthly", "quarterly", "weekly", "yearly"] ] """ - Schedule at which the future payments will be charged. Defaults to `weekly`. + Schedule at which the future payments will be charged. Defaults to `monthly`. """ reference: NotRequired[str] """ @@ -6340,6 +6394,39 @@ class PaymentIntentConfirmParamsPaymentMethodOptionsTwint(TypedDict): """ +class PaymentIntentConfirmParamsPaymentMethodOptionsUpi(TypedDict): + mandate_options: NotRequired[ + "PaymentIntentConfirmParamsPaymentMethodOptionsUpiMandateOptions" + ] + """ + Configuration options for setting up an eMandate + """ + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session', 'on_session']" + ] + + +class PaymentIntentConfirmParamsPaymentMethodOptionsUpiMandateOptions( + TypedDict, +): + amount: NotRequired[int] + """ + Amount to be charged for future payments. + """ + amount_type: NotRequired[Literal["fixed", "maximum"]] + """ + One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param. + """ + description: NotRequired[str] + """ + A description of the mandate or subscription that is meant to be displayed to the customer. + """ + end_date: NotRequired[int] + """ + End date of the mandate or subscription. + """ + + class PaymentIntentConfirmParamsPaymentMethodOptionsUsBankAccount(TypedDict): financial_connections: NotRequired[ "PaymentIntentConfirmParamsPaymentMethodOptionsUsBankAccountFinancialConnections" @@ -6387,13 +6474,7 @@ class PaymentIntentConfirmParamsPaymentMethodOptionsUsBankAccount(TypedDict): Literal["automatic", "instant", "microdeposits"] ] """ - Bank account verification method. - """ - preferred_settlement_speed: NotRequired[ - "Literal['']|Literal['fastest', 'standard']" - ] - """ - Preferred transaction settlement speed + Bank account verification method. The default value is `automatic`. """ diff --git a/stripe/params/_payment_intent_create_params.py b/stripe/params/_payment_intent_create_params.py index 029f63475..23d5ef4a9 100644 --- a/stripe/params/_payment_intent_create_params.py +++ b/stripe/params/_payment_intent_create_params.py @@ -128,6 +128,7 @@ class PaymentIntentCreateParams(RequestOptions): "stripe_balance", "swish", "twint", + "upi", "us_bank_account", "wechat_pay", "zip", @@ -287,6 +288,12 @@ class PaymentIntentCreateParamsAmountDetails(TypedDict): """ Contains information about the shipping portion of the amount. """ + surcharge: NotRequired[ + "Literal['']|PaymentIntentCreateParamsAmountDetailsSurcharge" + ] + """ + Contains information about the surcharge portion of the amount. + """ tax: NotRequired["Literal['']|PaymentIntentCreateParamsAmountDetailsTax"] """ Contains information about the tax portion of the amount. @@ -445,6 +452,19 @@ class PaymentIntentCreateParamsAmountDetailsShipping(TypedDict): """ +class PaymentIntentCreateParamsAmountDetailsSurcharge(TypedDict): + amount: NotRequired["Literal['']|int"] + """ + Portion of the amount that corresponds to a surcharge. + """ + enforce_validation: NotRequired[ + "Literal['']|Literal['automatic', 'disabled', 'enabled']" + ] + """ + Indicate whether to enforce validations on the surcharge amount. + """ + + class PaymentIntentCreateParamsAmountDetailsTax(TypedDict): total_tax_amount: int """ @@ -2670,6 +2690,7 @@ class PaymentIntentCreateParamsPaymentMethodData(TypedDict): "stripe_balance", "swish", "twint", + "upi", "us_bank_account", "wechat_pay", "zip", @@ -2677,6 +2698,10 @@ class PaymentIntentCreateParamsPaymentMethodData(TypedDict): """ 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. """ + upi: NotRequired["PaymentIntentCreateParamsPaymentMethodDataUpi"] + """ + If this is a `upi` PaymentMethod, this hash contains details about the UPI payment method. + """ us_bank_account: NotRequired[ "PaymentIntentCreateParamsPaymentMethodDataUsBankAccount" ] @@ -3194,10 +3219,6 @@ class PaymentIntentCreateParamsPaymentMethodDataStripeBalance(TypedDict): """ The connected account ID whose Stripe balance to use as the source of payment """ - source_type: NotRequired[Literal["bank_account", "card", "fpx"]] - """ - The [source_type](https://docs.stripe.com/api/balance/balance_object#balance_object-available-source_types) of the balance - """ class PaymentIntentCreateParamsPaymentMethodDataSwish(TypedDict): @@ -3208,6 +3229,34 @@ class PaymentIntentCreateParamsPaymentMethodDataTwint(TypedDict): pass +class PaymentIntentCreateParamsPaymentMethodDataUpi(TypedDict): + mandate_options: NotRequired[ + "PaymentIntentCreateParamsPaymentMethodDataUpiMandateOptions" + ] + """ + Configuration options for setting up an eMandate + """ + + +class PaymentIntentCreateParamsPaymentMethodDataUpiMandateOptions(TypedDict): + amount: NotRequired[int] + """ + Amount to be charged for future payments. + """ + amount_type: NotRequired[Literal["fixed", "maximum"]] + """ + One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param. + """ + description: NotRequired[str] + """ + A description of the mandate or subscription that is meant to be displayed to the customer. + """ + end_date: NotRequired[int] + """ + End date of the mandate or subscription. + """ + + class PaymentIntentCreateParamsPaymentMethodDataUsBankAccount(TypedDict): account_holder_type: NotRequired[Literal["company", "individual"]] """ @@ -3576,6 +3625,12 @@ class PaymentIntentCreateParamsPaymentMethodOptions(TypedDict): """ If this is a `twint` PaymentMethod, this sub-hash contains details about the TWINT payment method options. """ + upi: NotRequired[ + "Literal['']|PaymentIntentCreateParamsPaymentMethodOptionsUpi" + ] + """ + If this is a `upi` PaymentIntent, this sub-hash contains details about the UPI payment method options. + """ us_bank_account: NotRequired[ "Literal['']|PaymentIntentCreateParamsPaymentMethodOptionsUsBankAccount" ] @@ -3625,7 +3680,7 @@ class PaymentIntentCreateParamsPaymentMethodOptionsAcssDebit(TypedDict): Literal["automatic", "instant", "microdeposits"] ] """ - Bank account verification method. + Bank account verification method. The default value is `automatic`. """ @@ -4058,7 +4113,7 @@ class PaymentIntentCreateParamsPaymentMethodOptionsCardMandateOptions( ): amount: int """ - Amount to be charged for future payments. + Amount to be charged for future payments, specified in the presentment currency. """ amount_type: Literal["fixed", "maximum"] """ @@ -6241,7 +6296,7 @@ class PaymentIntentCreateParamsPaymentMethodOptionsPixMandateOptions( Literal["halfyearly", "monthly", "quarterly", "weekly", "yearly"] ] """ - Schedule at which the future payments will be charged. Defaults to `weekly`. + Schedule at which the future payments will be charged. Defaults to `monthly`. """ reference: NotRequired[str] """ @@ -6457,6 +6512,39 @@ class PaymentIntentCreateParamsPaymentMethodOptionsTwint(TypedDict): """ +class PaymentIntentCreateParamsPaymentMethodOptionsUpi(TypedDict): + mandate_options: NotRequired[ + "PaymentIntentCreateParamsPaymentMethodOptionsUpiMandateOptions" + ] + """ + Configuration options for setting up an eMandate + """ + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session', 'on_session']" + ] + + +class PaymentIntentCreateParamsPaymentMethodOptionsUpiMandateOptions( + TypedDict +): + amount: NotRequired[int] + """ + Amount to be charged for future payments. + """ + amount_type: NotRequired[Literal["fixed", "maximum"]] + """ + One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param. + """ + description: NotRequired[str] + """ + A description of the mandate or subscription that is meant to be displayed to the customer. + """ + end_date: NotRequired[int] + """ + End date of the mandate or subscription. + """ + + class PaymentIntentCreateParamsPaymentMethodOptionsUsBankAccount(TypedDict): financial_connections: NotRequired[ "PaymentIntentCreateParamsPaymentMethodOptionsUsBankAccountFinancialConnections" @@ -6504,13 +6592,7 @@ class PaymentIntentCreateParamsPaymentMethodOptionsUsBankAccount(TypedDict): Literal["automatic", "instant", "microdeposits"] ] """ - Bank account verification method. - """ - preferred_settlement_speed: NotRequired[ - "Literal['']|Literal['fastest', 'standard']" - ] - """ - Preferred transaction settlement speed + Bank account verification method. The default value is `automatic`. """ diff --git a/stripe/params/_payment_intent_decrement_authorization_params.py b/stripe/params/_payment_intent_decrement_authorization_params.py index ea2187c7e..00b2ada20 100644 --- a/stripe/params/_payment_intent_decrement_authorization_params.py +++ b/stripe/params/_payment_intent_decrement_authorization_params.py @@ -10,6 +10,12 @@ class PaymentIntentDecrementAuthorizationParams(RequestOptions): """ The updated total amount that you intend to collect from the cardholder. This amount must be smaller than the currently authorized amount and greater than the already captured amount. """ + amount_details: NotRequired[ + "PaymentIntentDecrementAuthorizationParamsAmountDetails" + ] + """ + Provides industry-specific information about the amount. + """ application_fee_amount: NotRequired[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. The amount of the application fee collected will be capped at the total amount captured. For more information, see the PaymentIntents [use case for connected accounts](https://docs.stripe.com/payments/connected-accounts). @@ -30,6 +36,12 @@ class PaymentIntentDecrementAuthorizationParams(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_details: NotRequired[ + "PaymentIntentDecrementAuthorizationParamsPaymentDetails" + ] + """ + Provides industry-specific information about the charge. + """ transfer_data: NotRequired[ "PaymentIntentDecrementAuthorizationParamsTransferData" ] @@ -39,6 +51,231 @@ class PaymentIntentDecrementAuthorizationParams(RequestOptions): """ +class PaymentIntentDecrementAuthorizationParamsAmountDetails(TypedDict): + discount_amount: NotRequired["Literal['']|int"] + """ + The total discount applied on the transaction represented in the [smallest currency unit](https://docs.stripe.com/currencies#zero-decimal). An integer greater than 0. + + This field is mutually exclusive with the `amount_details[line_items][#][discount_amount]` field. + """ + enforce_arithmetic_validation: NotRequired[bool] + """ + Set to `false` to return arithmetic validation errors in the response without failing the request. Use this when you want the operation to proceed regardless of arithmetic errors in the line item data. + + Omit or set to `true` to immediately return a 400 error when arithmetic validation fails. Use this for strict validation that prevents processing with line item data that has arithmetic inconsistencies. + + For card payments, Stripe doesn't send line item data to card networks if there's an arithmetic validation error. + """ + line_items: NotRequired[ + "Literal['']|List[PaymentIntentDecrementAuthorizationParamsAmountDetailsLineItem]" + ] + """ + A list of line items, each containing information about a product in the PaymentIntent. There is a maximum of 200 line items. + """ + shipping: NotRequired[ + "Literal['']|PaymentIntentDecrementAuthorizationParamsAmountDetailsShipping" + ] + """ + Contains information about the shipping portion of the amount. + """ + surcharge: NotRequired[ + "Literal['']|PaymentIntentDecrementAuthorizationParamsAmountDetailsSurcharge" + ] + """ + Contains information about the surcharge portion of the amount. + """ + tax: NotRequired[ + "Literal['']|PaymentIntentDecrementAuthorizationParamsAmountDetailsTax" + ] + """ + Contains information about the tax portion of the amount. + """ + + +class PaymentIntentDecrementAuthorizationParamsAmountDetailsLineItem( + TypedDict +): + discount_amount: NotRequired[int] + """ + The discount applied on this line item represented in the [smallest currency unit](https://docs.stripe.com/currencies#zero-decimal). An integer greater than 0. + + This field is mutually exclusive with the `amount_details[discount_amount]` field. + """ + payment_method_options: NotRequired[ + "PaymentIntentDecrementAuthorizationParamsAmountDetailsLineItemPaymentMethodOptions" + ] + """ + Payment method-specific information for line items. + """ + product_code: NotRequired[str] + """ + The product code of the line item, such as an SKU. Required for L3 rates. At most 12 characters long. + """ + product_name: str + """ + The product name of the line item. Required for L3 rates. At most 1024 characters long. + + For Cards, this field is truncated to 26 alphanumeric characters before being sent to the card networks. For PayPal, this field is truncated to 127 characters. + """ + quantity: int + """ + The quantity of items. Required for L3 rates. An integer greater than 0. + """ + tax: NotRequired[ + "PaymentIntentDecrementAuthorizationParamsAmountDetailsLineItemTax" + ] + """ + Contains information about the tax on the item. + """ + unit_cost: int + """ + The unit cost of the line item represented in the [smallest currency unit](https://docs.stripe.com/currencies#zero-decimal). Required for L3 rates. An integer greater than or equal to 0. + """ + unit_of_measure: NotRequired[str] + """ + A unit of measure for the line item, such as gallons, feet, meters, etc. + """ + + +class PaymentIntentDecrementAuthorizationParamsAmountDetailsLineItemPaymentMethodOptions( + TypedDict, +): + card: NotRequired[ + "PaymentIntentDecrementAuthorizationParamsAmountDetailsLineItemPaymentMethodOptionsCard" + ] + """ + This sub-hash contains line item details that are specific to the `card` payment method. + """ + card_present: NotRequired[ + "PaymentIntentDecrementAuthorizationParamsAmountDetailsLineItemPaymentMethodOptionsCardPresent" + ] + """ + This sub-hash contains line item details that are specific to the `card_present` payment method. + """ + klarna: NotRequired[ + "PaymentIntentDecrementAuthorizationParamsAmountDetailsLineItemPaymentMethodOptionsKlarna" + ] + """ + This sub-hash contains line item details that are specific to the `klarna` payment method. + """ + paypal: NotRequired[ + "PaymentIntentDecrementAuthorizationParamsAmountDetailsLineItemPaymentMethodOptionsPaypal" + ] + """ + This sub-hash contains line item details that are specific to the `paypal` payment method. + """ + + +class PaymentIntentDecrementAuthorizationParamsAmountDetailsLineItemPaymentMethodOptionsCard( + TypedDict, +): + commodity_code: NotRequired[str] + """ + Identifier that categorizes the items being purchased using a standardized commodity scheme such as (but not limited to) UNSPSC, NAICS, NAPCS, and so on. + """ + + +class PaymentIntentDecrementAuthorizationParamsAmountDetailsLineItemPaymentMethodOptionsCardPresent( + TypedDict, +): + commodity_code: NotRequired[str] + """ + Identifier that categorizes the items being purchased using a standardized commodity scheme such as (but not limited to) UNSPSC, NAICS, NAPCS, and so on. + """ + + +class PaymentIntentDecrementAuthorizationParamsAmountDetailsLineItemPaymentMethodOptionsKlarna( + TypedDict, +): + image_url: NotRequired[str] + """ + URL to an image for the product. Max length, 4096 characters. + """ + product_url: NotRequired[str] + """ + URL to the product page. Max length, 4096 characters. + """ + reference: NotRequired[str] + """ + Unique reference for this line item to correlate it with your system's internal records. The field is displayed in the Klarna Consumer App if passed. + """ + subscription_reference: NotRequired[str] + """ + Reference for the subscription this line item is for. + """ + + +class PaymentIntentDecrementAuthorizationParamsAmountDetailsLineItemPaymentMethodOptionsPaypal( + TypedDict, +): + category: NotRequired[ + Literal["digital_goods", "donation", "physical_goods"] + ] + """ + Type of the line item. + """ + description: NotRequired[str] + """ + Description of the line item. + """ + sold_by: NotRequired[str] + """ + The Stripe account ID of the connected account that sells the item. + """ + + +class PaymentIntentDecrementAuthorizationParamsAmountDetailsLineItemTax( + TypedDict, +): + total_tax_amount: int + """ + The total amount of tax on a single line item represented in the [smallest currency unit](https://docs.stripe.com/currencies#zero-decimal). Required for L3 rates. An integer greater than or equal to 0. + + This field is mutually exclusive with the `amount_details[tax][total_tax_amount]` field. + """ + + +class PaymentIntentDecrementAuthorizationParamsAmountDetailsShipping( + TypedDict +): + amount: NotRequired["Literal['']|int"] + """ + If a physical good is being shipped, the cost of shipping represented in the [smallest currency unit](https://docs.stripe.com/currencies#zero-decimal). An integer greater than or equal to 0. + """ + from_postal_code: NotRequired["Literal['']|str"] + """ + If a physical good is being shipped, the postal code of where it is being shipped from. At most 10 alphanumeric characters long, hyphens are allowed. + """ + to_postal_code: NotRequired["Literal['']|str"] + """ + If a physical good is being shipped, the postal code of where it is being shipped to. At most 10 alphanumeric characters long, hyphens are allowed. + """ + + +class PaymentIntentDecrementAuthorizationParamsAmountDetailsSurcharge( + TypedDict, +): + amount: NotRequired["Literal['']|int"] + """ + Portion of the amount that corresponds to a surcharge. + """ + enforce_validation: NotRequired[ + "Literal['']|Literal['automatic', 'disabled', 'enabled']" + ] + """ + Indicate whether to enforce validations on the surcharge amount. + """ + + +class PaymentIntentDecrementAuthorizationParamsAmountDetailsTax(TypedDict): + total_tax_amount: int + """ + The total amount of tax on the transaction represented in the [smallest currency unit](https://docs.stripe.com/currencies#zero-decimal). Required for L2 rates. An integer greater than or equal to 0. + + This field is mutually exclusive with the `amount_details[line_items][#][tax][total_tax_amount]` field. + """ + + class PaymentIntentDecrementAuthorizationParamsHooks(TypedDict): inputs: NotRequired["PaymentIntentDecrementAuthorizationParamsHooksInputs"] """ @@ -60,6 +297,23 @@ class PaymentIntentDecrementAuthorizationParamsHooksInputsTax(TypedDict): """ +class PaymentIntentDecrementAuthorizationParamsPaymentDetails(TypedDict): + customer_reference: NotRequired["Literal['']|str"] + """ + A unique value to identify the customer. This field is available only for card payments. + + This field is truncated to 25 alphanumeric characters, excluding spaces, before being sent to card networks. + """ + order_reference: NotRequired["Literal['']|str"] + """ + A unique value assigned by the business to identify the transaction. Required for L2 and L3 rates. + + Required when the Payment Method Types array contains `card`, including when [automatic_payment_methods.enabled](https://docs.stripe.com/api/payment_intents/create#create_payment_intent-automatic_payment_methods-enabled) is set to `true`. + + For Cards, this field is truncated to 25 alphanumeric characters, excluding spaces, before being sent to card networks. For Klarna, this field is truncated to 255 characters and is visible to customers when they view the order in the Klarna app. + """ + + class PaymentIntentDecrementAuthorizationParamsTransferData(TypedDict): amount: NotRequired[int] """ diff --git a/stripe/params/_payment_intent_increment_authorization_params.py b/stripe/params/_payment_intent_increment_authorization_params.py index bc9b04da2..b8ccdb53f 100644 --- a/stripe/params/_payment_intent_increment_authorization_params.py +++ b/stripe/params/_payment_intent_increment_authorization_params.py @@ -88,6 +88,12 @@ class PaymentIntentIncrementAuthorizationParamsAmountDetails(TypedDict): """ Contains information about the shipping portion of the amount. """ + surcharge: NotRequired[ + "Literal['']|PaymentIntentIncrementAuthorizationParamsAmountDetailsSurcharge" + ] + """ + Contains information about the surcharge portion of the amount. + """ tax: NotRequired[ "Literal['']|PaymentIntentIncrementAuthorizationParamsAmountDetailsTax" ] @@ -256,6 +262,21 @@ class PaymentIntentIncrementAuthorizationParamsAmountDetailsShipping( """ +class PaymentIntentIncrementAuthorizationParamsAmountDetailsSurcharge( + TypedDict, +): + amount: NotRequired["Literal['']|int"] + """ + Portion of the amount that corresponds to a surcharge. + """ + enforce_validation: NotRequired[ + "Literal['']|Literal['automatic', 'disabled', 'enabled']" + ] + """ + Indicate whether to enforce validations on the surcharge amount. + """ + + class PaymentIntentIncrementAuthorizationParamsAmountDetailsTax(TypedDict): total_tax_amount: int """ diff --git a/stripe/params/_payment_intent_modify_params.py b/stripe/params/_payment_intent_modify_params.py index 2c228f1d6..f4c16482e 100644 --- a/stripe/params/_payment_intent_modify_params.py +++ b/stripe/params/_payment_intent_modify_params.py @@ -51,7 +51,7 @@ class PaymentIntentModifyParams(RequestOptions): An arbitrary string attached to the object. Often useful for displaying to users. """ excluded_payment_method_types: NotRequired[ - "Literal['']|List[Literal['acss_debit', 'affirm', 'afterpay_clearpay', 'alipay', 'alma', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'billie', 'blik', 'boleto', 'card', 'cashapp', 'crypto', 'customer_balance', 'eps', 'fpx', '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', 'sepa_debit', 'shopeepay', 'sofort', 'stripe_balance', 'swish', 'twint', 'us_bank_account', 'wechat_pay', 'zip']]" + "Literal['']|List[Literal['acss_debit', 'affirm', 'afterpay_clearpay', 'alipay', 'alma', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'billie', 'blik', 'boleto', 'card', 'cashapp', 'crypto', 'customer_balance', 'eps', 'fpx', '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', 'sepa_debit', 'shopeepay', 'sofort', 'stripe_balance', 'swish', 'twint', 'upi', 'us_bank_account', 'wechat_pay', 'zip']]" ] """ The list of payment method types to exclude from use with this payment. @@ -174,6 +174,12 @@ class PaymentIntentModifyParamsAmountDetails(TypedDict): """ Contains information about the shipping portion of the amount. """ + surcharge: NotRequired[ + "Literal['']|PaymentIntentModifyParamsAmountDetailsSurcharge" + ] + """ + Contains information about the surcharge portion of the amount. + """ tax: NotRequired["Literal['']|PaymentIntentModifyParamsAmountDetailsTax"] """ Contains information about the tax portion of the amount. @@ -332,6 +338,19 @@ class PaymentIntentModifyParamsAmountDetailsShipping(TypedDict): """ +class PaymentIntentModifyParamsAmountDetailsSurcharge(TypedDict): + amount: NotRequired["Literal['']|int"] + """ + Portion of the amount that corresponds to a surcharge. + """ + enforce_validation: NotRequired[ + "Literal['']|Literal['automatic', 'disabled', 'enabled']" + ] + """ + Indicate whether to enforce validations on the surcharge amount. + """ + + class PaymentIntentModifyParamsAmountDetailsTax(TypedDict): total_tax_amount: int """ @@ -2528,6 +2547,7 @@ class PaymentIntentModifyParamsPaymentMethodData(TypedDict): "stripe_balance", "swish", "twint", + "upi", "us_bank_account", "wechat_pay", "zip", @@ -2535,6 +2555,10 @@ class PaymentIntentModifyParamsPaymentMethodData(TypedDict): """ 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. """ + upi: NotRequired["PaymentIntentModifyParamsPaymentMethodDataUpi"] + """ + If this is a `upi` PaymentMethod, this hash contains details about the UPI payment method. + """ us_bank_account: NotRequired[ "PaymentIntentModifyParamsPaymentMethodDataUsBankAccount" ] @@ -3052,10 +3076,6 @@ class PaymentIntentModifyParamsPaymentMethodDataStripeBalance(TypedDict): """ The connected account ID whose Stripe balance to use as the source of payment """ - source_type: NotRequired[Literal["bank_account", "card", "fpx"]] - """ - The [source_type](https://docs.stripe.com/api/balance/balance_object#balance_object-available-source_types) of the balance - """ class PaymentIntentModifyParamsPaymentMethodDataSwish(TypedDict): @@ -3066,6 +3086,34 @@ class PaymentIntentModifyParamsPaymentMethodDataTwint(TypedDict): pass +class PaymentIntentModifyParamsPaymentMethodDataUpi(TypedDict): + mandate_options: NotRequired[ + "PaymentIntentModifyParamsPaymentMethodDataUpiMandateOptions" + ] + """ + Configuration options for setting up an eMandate + """ + + +class PaymentIntentModifyParamsPaymentMethodDataUpiMandateOptions(TypedDict): + amount: NotRequired[int] + """ + Amount to be charged for future payments. + """ + amount_type: NotRequired[Literal["fixed", "maximum"]] + """ + One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param. + """ + description: NotRequired[str] + """ + A description of the mandate or subscription that is meant to be displayed to the customer. + """ + end_date: NotRequired[int] + """ + End date of the mandate or subscription. + """ + + class PaymentIntentModifyParamsPaymentMethodDataUsBankAccount(TypedDict): account_holder_type: NotRequired[Literal["company", "individual"]] """ @@ -3434,6 +3482,12 @@ class PaymentIntentModifyParamsPaymentMethodOptions(TypedDict): """ If this is a `twint` PaymentMethod, this sub-hash contains details about the TWINT payment method options. """ + upi: NotRequired[ + "Literal['']|PaymentIntentModifyParamsPaymentMethodOptionsUpi" + ] + """ + If this is a `upi` PaymentIntent, this sub-hash contains details about the UPI payment method options. + """ us_bank_account: NotRequired[ "Literal['']|PaymentIntentModifyParamsPaymentMethodOptionsUsBankAccount" ] @@ -3483,7 +3537,7 @@ class PaymentIntentModifyParamsPaymentMethodOptionsAcssDebit(TypedDict): Literal["automatic", "instant", "microdeposits"] ] """ - Bank account verification method. + Bank account verification method. The default value is `automatic`. """ @@ -3916,7 +3970,7 @@ class PaymentIntentModifyParamsPaymentMethodOptionsCardMandateOptions( ): amount: int """ - Amount to be charged for future payments. + Amount to be charged for future payments, specified in the presentment currency. """ amount_type: Literal["fixed", "maximum"] """ @@ -6099,7 +6153,7 @@ class PaymentIntentModifyParamsPaymentMethodOptionsPixMandateOptions( Literal["halfyearly", "monthly", "quarterly", "weekly", "yearly"] ] """ - Schedule at which the future payments will be charged. Defaults to `weekly`. + Schedule at which the future payments will be charged. Defaults to `monthly`. """ reference: NotRequired[str] """ @@ -6315,6 +6369,39 @@ class PaymentIntentModifyParamsPaymentMethodOptionsTwint(TypedDict): """ +class PaymentIntentModifyParamsPaymentMethodOptionsUpi(TypedDict): + mandate_options: NotRequired[ + "PaymentIntentModifyParamsPaymentMethodOptionsUpiMandateOptions" + ] + """ + Configuration options for setting up an eMandate + """ + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session', 'on_session']" + ] + + +class PaymentIntentModifyParamsPaymentMethodOptionsUpiMandateOptions( + TypedDict +): + amount: NotRequired[int] + """ + Amount to be charged for future payments. + """ + amount_type: NotRequired[Literal["fixed", "maximum"]] + """ + One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param. + """ + description: NotRequired[str] + """ + A description of the mandate or subscription that is meant to be displayed to the customer. + """ + end_date: NotRequired[int] + """ + End date of the mandate or subscription. + """ + + class PaymentIntentModifyParamsPaymentMethodOptionsUsBankAccount(TypedDict): financial_connections: NotRequired[ "PaymentIntentModifyParamsPaymentMethodOptionsUsBankAccountFinancialConnections" @@ -6362,13 +6449,7 @@ class PaymentIntentModifyParamsPaymentMethodOptionsUsBankAccount(TypedDict): Literal["automatic", "instant", "microdeposits"] ] """ - Bank account verification method. - """ - preferred_settlement_speed: NotRequired[ - "Literal['']|Literal['fastest', 'standard']" - ] - """ - Preferred transaction settlement speed + Bank account verification method. The default value is `automatic`. """ diff --git a/stripe/params/_payment_intent_update_params.py b/stripe/params/_payment_intent_update_params.py index 8e1033c1a..45b78fc13 100644 --- a/stripe/params/_payment_intent_update_params.py +++ b/stripe/params/_payment_intent_update_params.py @@ -50,7 +50,7 @@ class PaymentIntentUpdateParams(TypedDict): An arbitrary string attached to the object. Often useful for displaying to users. """ excluded_payment_method_types: NotRequired[ - "Literal['']|List[Literal['acss_debit', 'affirm', 'afterpay_clearpay', 'alipay', 'alma', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'billie', 'blik', 'boleto', 'card', 'cashapp', 'crypto', 'customer_balance', 'eps', 'fpx', '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', 'sepa_debit', 'shopeepay', 'sofort', 'stripe_balance', 'swish', 'twint', 'us_bank_account', 'wechat_pay', 'zip']]" + "Literal['']|List[Literal['acss_debit', 'affirm', 'afterpay_clearpay', 'alipay', 'alma', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'billie', 'blik', 'boleto', 'card', 'cashapp', 'crypto', 'customer_balance', 'eps', 'fpx', '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', 'sepa_debit', 'shopeepay', 'sofort', 'stripe_balance', 'swish', 'twint', 'upi', 'us_bank_account', 'wechat_pay', 'zip']]" ] """ The list of payment method types to exclude from use with this payment. @@ -173,6 +173,12 @@ class PaymentIntentUpdateParamsAmountDetails(TypedDict): """ Contains information about the shipping portion of the amount. """ + surcharge: NotRequired[ + "Literal['']|PaymentIntentUpdateParamsAmountDetailsSurcharge" + ] + """ + Contains information about the surcharge portion of the amount. + """ tax: NotRequired["Literal['']|PaymentIntentUpdateParamsAmountDetailsTax"] """ Contains information about the tax portion of the amount. @@ -331,6 +337,19 @@ class PaymentIntentUpdateParamsAmountDetailsShipping(TypedDict): """ +class PaymentIntentUpdateParamsAmountDetailsSurcharge(TypedDict): + amount: NotRequired["Literal['']|int"] + """ + Portion of the amount that corresponds to a surcharge. + """ + enforce_validation: NotRequired[ + "Literal['']|Literal['automatic', 'disabled', 'enabled']" + ] + """ + Indicate whether to enforce validations on the surcharge amount. + """ + + class PaymentIntentUpdateParamsAmountDetailsTax(TypedDict): total_tax_amount: int """ @@ -2527,6 +2546,7 @@ class PaymentIntentUpdateParamsPaymentMethodData(TypedDict): "stripe_balance", "swish", "twint", + "upi", "us_bank_account", "wechat_pay", "zip", @@ -2534,6 +2554,10 @@ class PaymentIntentUpdateParamsPaymentMethodData(TypedDict): """ 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. """ + upi: NotRequired["PaymentIntentUpdateParamsPaymentMethodDataUpi"] + """ + If this is a `upi` PaymentMethod, this hash contains details about the UPI payment method. + """ us_bank_account: NotRequired[ "PaymentIntentUpdateParamsPaymentMethodDataUsBankAccount" ] @@ -3051,10 +3075,6 @@ class PaymentIntentUpdateParamsPaymentMethodDataStripeBalance(TypedDict): """ The connected account ID whose Stripe balance to use as the source of payment """ - source_type: NotRequired[Literal["bank_account", "card", "fpx"]] - """ - The [source_type](https://docs.stripe.com/api/balance/balance_object#balance_object-available-source_types) of the balance - """ class PaymentIntentUpdateParamsPaymentMethodDataSwish(TypedDict): @@ -3065,6 +3085,34 @@ class PaymentIntentUpdateParamsPaymentMethodDataTwint(TypedDict): pass +class PaymentIntentUpdateParamsPaymentMethodDataUpi(TypedDict): + mandate_options: NotRequired[ + "PaymentIntentUpdateParamsPaymentMethodDataUpiMandateOptions" + ] + """ + Configuration options for setting up an eMandate + """ + + +class PaymentIntentUpdateParamsPaymentMethodDataUpiMandateOptions(TypedDict): + amount: NotRequired[int] + """ + Amount to be charged for future payments. + """ + amount_type: NotRequired[Literal["fixed", "maximum"]] + """ + One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param. + """ + description: NotRequired[str] + """ + A description of the mandate or subscription that is meant to be displayed to the customer. + """ + end_date: NotRequired[int] + """ + End date of the mandate or subscription. + """ + + class PaymentIntentUpdateParamsPaymentMethodDataUsBankAccount(TypedDict): account_holder_type: NotRequired[Literal["company", "individual"]] """ @@ -3433,6 +3481,12 @@ class PaymentIntentUpdateParamsPaymentMethodOptions(TypedDict): """ If this is a `twint` PaymentMethod, this sub-hash contains details about the TWINT payment method options. """ + upi: NotRequired[ + "Literal['']|PaymentIntentUpdateParamsPaymentMethodOptionsUpi" + ] + """ + If this is a `upi` PaymentIntent, this sub-hash contains details about the UPI payment method options. + """ us_bank_account: NotRequired[ "Literal['']|PaymentIntentUpdateParamsPaymentMethodOptionsUsBankAccount" ] @@ -3482,7 +3536,7 @@ class PaymentIntentUpdateParamsPaymentMethodOptionsAcssDebit(TypedDict): Literal["automatic", "instant", "microdeposits"] ] """ - Bank account verification method. + Bank account verification method. The default value is `automatic`. """ @@ -3915,7 +3969,7 @@ class PaymentIntentUpdateParamsPaymentMethodOptionsCardMandateOptions( ): amount: int """ - Amount to be charged for future payments. + Amount to be charged for future payments, specified in the presentment currency. """ amount_type: Literal["fixed", "maximum"] """ @@ -6098,7 +6152,7 @@ class PaymentIntentUpdateParamsPaymentMethodOptionsPixMandateOptions( Literal["halfyearly", "monthly", "quarterly", "weekly", "yearly"] ] """ - Schedule at which the future payments will be charged. Defaults to `weekly`. + Schedule at which the future payments will be charged. Defaults to `monthly`. """ reference: NotRequired[str] """ @@ -6314,6 +6368,39 @@ class PaymentIntentUpdateParamsPaymentMethodOptionsTwint(TypedDict): """ +class PaymentIntentUpdateParamsPaymentMethodOptionsUpi(TypedDict): + mandate_options: NotRequired[ + "PaymentIntentUpdateParamsPaymentMethodOptionsUpiMandateOptions" + ] + """ + Configuration options for setting up an eMandate + """ + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session', 'on_session']" + ] + + +class PaymentIntentUpdateParamsPaymentMethodOptionsUpiMandateOptions( + TypedDict +): + amount: NotRequired[int] + """ + Amount to be charged for future payments. + """ + amount_type: NotRequired[Literal["fixed", "maximum"]] + """ + One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param. + """ + description: NotRequired[str] + """ + A description of the mandate or subscription that is meant to be displayed to the customer. + """ + end_date: NotRequired[int] + """ + End date of the mandate or subscription. + """ + + class PaymentIntentUpdateParamsPaymentMethodOptionsUsBankAccount(TypedDict): financial_connections: NotRequired[ "PaymentIntentUpdateParamsPaymentMethodOptionsUsBankAccountFinancialConnections" @@ -6361,13 +6448,7 @@ class PaymentIntentUpdateParamsPaymentMethodOptionsUsBankAccount(TypedDict): Literal["automatic", "instant", "microdeposits"] ] """ - Bank account verification method. - """ - preferred_settlement_speed: NotRequired[ - "Literal['']|Literal['fastest', 'standard']" - ] - """ - Preferred transaction settlement speed + Bank account verification method. The default value is `automatic`. """ diff --git a/stripe/params/_payment_link_create_params.py b/stripe/params/_payment_link_create_params.py index c78606ad8..fb6cacf02 100644 --- a/stripe/params/_payment_link_create_params.py +++ b/stripe/params/_payment_link_create_params.py @@ -66,6 +66,10 @@ class PaymentLinkCreateParams(RequestOptions): """ The line items representing what is being sold. Each line item represents an item being sold. Up to 20 line items are supported. """ + managed_payments: NotRequired["PaymentLinkCreateParamsManagedPayments"] + """ + Settings for Managed Payments for this Payment Link and resulting [CheckoutSessions](https://docs.stripe.com/api/checkout/sessions/object), [PaymentIntents](https://docs.stripe.com/api/payment_intents/object), [Invoices](https://docs.stripe.com/api/invoices/object), and [Subscriptions](https://docs.stripe.com/api/subscriptions/object). + """ metadata: NotRequired[Dict[str, 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`. Metadata associated with this Payment Link will automatically be copied to [checkout sessions](https://docs.stripe.com/api/checkout/sessions) created by this payment link. @@ -142,6 +146,7 @@ class PaymentLinkCreateParams(RequestOptions): "sofort", "swish", "twint", + "upi", "us_bank_account", "wechat_pay", "zip", @@ -604,12 +609,29 @@ class PaymentLinkCreateParamsLineItemPriceDataProductData(TypedDict): """ A [tax code](https://docs.stripe.com/tax/tax-categories) ID. """ + tax_details: NotRequired[ + "PaymentLinkCreateParamsLineItemPriceDataProductDataTaxDetails" + ] + """ + Tax details for this product, including the [tax code](https://docs.stripe.com/tax/tax-codes) and an optional performance location. + """ unit_label: NotRequired[str] """ A label that represents units of this product. When set, this will be included in customers' receipts, invoices, Checkout, and the customer portal. """ +class PaymentLinkCreateParamsLineItemPriceDataProductDataTaxDetails(TypedDict): + performance_location: NotRequired[str] + """ + A tax location ID. Depending on the [tax code](https://docs.stripe.com/tax/tax-for-tickets/reference/tax-location-performance), this is required, optional, or not supported. + """ + tax_code: str + """ + A [tax code](https://docs.stripe.com/tax/tax-categories) ID. + """ + + class PaymentLinkCreateParamsLineItemPriceDataRecurring(TypedDict): interval: Literal["day", "month", "week", "year"] """ @@ -621,6 +643,13 @@ class PaymentLinkCreateParamsLineItemPriceDataRecurring(TypedDict): """ +class PaymentLinkCreateParamsManagedPayments(TypedDict): + enabled: NotRequired[bool] + """ + Set to `true` to enable [Managed Payments](https://docs.stripe.com/payments/managed-payments), Stripe's merchant of record solution, for this session. + """ + + class PaymentLinkCreateParamsNameCollection(TypedDict): business: NotRequired["PaymentLinkCreateParamsNameCollectionBusiness"] """ diff --git a/stripe/params/_payment_link_modify_params.py b/stripe/params/_payment_link_modify_params.py index e17816730..15b471f2e 100644 --- a/stripe/params/_payment_link_modify_params.py +++ b/stripe/params/_payment_link_modify_params.py @@ -89,7 +89,7 @@ class PaymentLinkModifyParams(RequestOptions): If you'd like information on how to collect a payment method outside of Checkout, read the guide on [configuring subscriptions with a free trial](https://docs.stripe.com/payments/checkout/free-trials). """ payment_method_types: NotRequired[ - "Literal['']|List[Literal['affirm', 'afterpay_clearpay', 'alipay', 'alma', 'au_becs_debit', 'bacs_debit', 'bancontact', 'billie', 'blik', 'boleto', 'card', 'cashapp', 'eps', 'fpx', 'giropay', 'gopay', 'grabpay', 'ideal', 'klarna', 'konbini', 'link', 'mb_way', 'mobilepay', 'multibanco', 'oxxo', 'p24', 'pay_by_bank', 'paynow', 'paypal', 'paypay', 'payto', 'pix', 'promptpay', 'qris', 'rechnung', 'satispay', 'sepa_debit', 'shopeepay', 'sofort', 'swish', 'twint', 'us_bank_account', 'wechat_pay', 'zip']]" + "Literal['']|List[Literal['affirm', 'afterpay_clearpay', 'alipay', 'alma', 'au_becs_debit', 'bacs_debit', 'bancontact', 'billie', 'blik', 'boleto', 'card', 'cashapp', 'eps', 'fpx', 'giropay', 'gopay', 'grabpay', 'ideal', 'klarna', 'konbini', 'link', 'mb_way', 'mobilepay', 'multibanco', 'oxxo', 'p24', 'pay_by_bank', 'paynow', 'paypal', 'paypay', 'payto', 'pix', 'promptpay', 'qris', 'rechnung', 'satispay', 'sepa_debit', 'shopeepay', 'sofort', 'swish', 'twint', 'upi', 'us_bank_account', 'wechat_pay', 'zip']]" ] """ The list of payment method types that customers can use. Pass an empty string to enable dynamic payment methods that use your [payment method settings](https://dashboard.stripe.com/settings/payment_methods). diff --git a/stripe/params/_payment_link_update_params.py b/stripe/params/_payment_link_update_params.py index 03c5b493f..60b8a6173 100644 --- a/stripe/params/_payment_link_update_params.py +++ b/stripe/params/_payment_link_update_params.py @@ -88,7 +88,7 @@ class PaymentLinkUpdateParams(TypedDict): If you'd like information on how to collect a payment method outside of Checkout, read the guide on [configuring subscriptions with a free trial](https://docs.stripe.com/payments/checkout/free-trials). """ payment_method_types: NotRequired[ - "Literal['']|List[Literal['affirm', 'afterpay_clearpay', 'alipay', 'alma', 'au_becs_debit', 'bacs_debit', 'bancontact', 'billie', 'blik', 'boleto', 'card', 'cashapp', 'eps', 'fpx', 'giropay', 'gopay', 'grabpay', 'ideal', 'klarna', 'konbini', 'link', 'mb_way', 'mobilepay', 'multibanco', 'oxxo', 'p24', 'pay_by_bank', 'paynow', 'paypal', 'paypay', 'payto', 'pix', 'promptpay', 'qris', 'rechnung', 'satispay', 'sepa_debit', 'shopeepay', 'sofort', 'swish', 'twint', 'us_bank_account', 'wechat_pay', 'zip']]" + "Literal['']|List[Literal['affirm', 'afterpay_clearpay', 'alipay', 'alma', 'au_becs_debit', 'bacs_debit', 'bancontact', 'billie', 'blik', 'boleto', 'card', 'cashapp', 'eps', 'fpx', 'giropay', 'gopay', 'grabpay', 'ideal', 'klarna', 'konbini', 'link', 'mb_way', 'mobilepay', 'multibanco', 'oxxo', 'p24', 'pay_by_bank', 'paynow', 'paypal', 'paypay', 'payto', 'pix', 'promptpay', 'qris', 'rechnung', 'satispay', 'sepa_debit', 'shopeepay', 'sofort', 'swish', 'twint', 'upi', 'us_bank_account', 'wechat_pay', 'zip']]" ] """ The list of payment method types that customers can use. Pass an empty string to enable dynamic payment methods that use your [payment method settings](https://dashboard.stripe.com/settings/payment_methods). diff --git a/stripe/params/_payment_method_configuration_create_params.py b/stripe/params/_payment_method_configuration_create_params.py index a415d23ed..1dcf3a869 100644 --- a/stripe/params/_payment_method_configuration_create_params.py +++ b/stripe/params/_payment_method_configuration_create_params.py @@ -270,6 +270,10 @@ class PaymentMethodConfigurationCreateParams(RequestOptions): """ Twint is a payment method popular in Switzerland. It allows customers to pay using their mobile phone. Check this [page](https://docs.stripe.com/payments/twint) for more details. """ + upi: NotRequired["PaymentMethodConfigurationCreateParamsUpi"] + """ + Unified Payment Interface (UPI) is India's leading payment method with exponential growth since it launched in 2016. + """ us_bank_account: NotRequired[ "PaymentMethodConfigurationCreateParamsUsBankAccount" ] @@ -1272,6 +1276,22 @@ class PaymentMethodConfigurationCreateParamsTwintDisplayPreference(TypedDict): """ +class PaymentMethodConfigurationCreateParamsUpi(TypedDict): + display_preference: NotRequired[ + "PaymentMethodConfigurationCreateParamsUpiDisplayPreference" + ] + """ + Whether or not the payment method should be displayed. + """ + + +class PaymentMethodConfigurationCreateParamsUpiDisplayPreference(TypedDict): + preference: NotRequired[Literal["none", "off", "on"]] + """ + The account's preference for whether or not to display this payment method. + """ + + class PaymentMethodConfigurationCreateParamsUsBankAccount(TypedDict): display_preference: NotRequired[ "PaymentMethodConfigurationCreateParamsUsBankAccountDisplayPreference" diff --git a/stripe/params/_payment_method_configuration_modify_params.py b/stripe/params/_payment_method_configuration_modify_params.py index 8606dc5dd..e2299d562 100644 --- a/stripe/params/_payment_method_configuration_modify_params.py +++ b/stripe/params/_payment_method_configuration_modify_params.py @@ -270,6 +270,10 @@ class PaymentMethodConfigurationModifyParams(RequestOptions): """ Twint is a payment method popular in Switzerland. It allows customers to pay using their mobile phone. Check this [page](https://docs.stripe.com/payments/twint) for more details. """ + upi: NotRequired["PaymentMethodConfigurationModifyParamsUpi"] + """ + Unified Payment Interface (UPI) is India's leading payment method with exponential growth since it launched in 2016. + """ us_bank_account: NotRequired[ "PaymentMethodConfigurationModifyParamsUsBankAccount" ] @@ -1272,6 +1276,22 @@ class PaymentMethodConfigurationModifyParamsTwintDisplayPreference(TypedDict): """ +class PaymentMethodConfigurationModifyParamsUpi(TypedDict): + display_preference: NotRequired[ + "PaymentMethodConfigurationModifyParamsUpiDisplayPreference" + ] + """ + Whether or not the payment method should be displayed. + """ + + +class PaymentMethodConfigurationModifyParamsUpiDisplayPreference(TypedDict): + preference: NotRequired[Literal["none", "off", "on"]] + """ + The account's preference for whether or not to display this payment method. + """ + + class PaymentMethodConfigurationModifyParamsUsBankAccount(TypedDict): display_preference: NotRequired[ "PaymentMethodConfigurationModifyParamsUsBankAccountDisplayPreference" diff --git a/stripe/params/_payment_method_configuration_update_params.py b/stripe/params/_payment_method_configuration_update_params.py index 0f230d2f2..1cd4b70c2 100644 --- a/stripe/params/_payment_method_configuration_update_params.py +++ b/stripe/params/_payment_method_configuration_update_params.py @@ -269,6 +269,10 @@ class PaymentMethodConfigurationUpdateParams(TypedDict): """ Twint is a payment method popular in Switzerland. It allows customers to pay using their mobile phone. Check this [page](https://docs.stripe.com/payments/twint) for more details. """ + upi: NotRequired["PaymentMethodConfigurationUpdateParamsUpi"] + """ + Unified Payment Interface (UPI) is India's leading payment method with exponential growth since it launched in 2016. + """ us_bank_account: NotRequired[ "PaymentMethodConfigurationUpdateParamsUsBankAccount" ] @@ -1271,6 +1275,22 @@ class PaymentMethodConfigurationUpdateParamsTwintDisplayPreference(TypedDict): """ +class PaymentMethodConfigurationUpdateParamsUpi(TypedDict): + display_preference: NotRequired[ + "PaymentMethodConfigurationUpdateParamsUpiDisplayPreference" + ] + """ + Whether or not the payment method should be displayed. + """ + + +class PaymentMethodConfigurationUpdateParamsUpiDisplayPreference(TypedDict): + preference: NotRequired[Literal["none", "off", "on"]] + """ + The account's preference for whether or not to display this payment method. + """ + + class PaymentMethodConfigurationUpdateParamsUsBankAccount(TypedDict): display_preference: NotRequired[ "PaymentMethodConfigurationUpdateParamsUsBankAccountDisplayPreference" diff --git a/stripe/params/_payment_method_create_params.py b/stripe/params/_payment_method_create_params.py index c4dd762af..73a9b6f46 100644 --- a/stripe/params/_payment_method_create_params.py +++ b/stripe/params/_payment_method_create_params.py @@ -315,6 +315,7 @@ class PaymentMethodCreateParams(RequestOptions): "stripe_balance", "swish", "twint", + "upi", "us_bank_account", "wechat_pay", "zip", @@ -323,6 +324,10 @@ class PaymentMethodCreateParams(RequestOptions): """ 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. """ + upi: NotRequired["PaymentMethodCreateParamsUpi"] + """ + If this is a `upi` PaymentMethod, this hash contains details about the UPI payment method. + """ us_bank_account: NotRequired["PaymentMethodCreateParamsUsBankAccount"] """ If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method. @@ -875,10 +880,6 @@ class PaymentMethodCreateParamsStripeBalance(TypedDict): """ The connected account ID whose Stripe balance to use as the source of payment """ - source_type: NotRequired[Literal["bank_account", "card", "fpx"]] - """ - The [source_type](https://docs.stripe.com/api/balance/balance_object#balance_object-available-source_types) of the balance - """ class PaymentMethodCreateParamsSwish(TypedDict): @@ -889,6 +890,32 @@ class PaymentMethodCreateParamsTwint(TypedDict): pass +class PaymentMethodCreateParamsUpi(TypedDict): + mandate_options: NotRequired["PaymentMethodCreateParamsUpiMandateOptions"] + """ + Configuration options for setting up an eMandate + """ + + +class PaymentMethodCreateParamsUpiMandateOptions(TypedDict): + amount: NotRequired[int] + """ + Amount to be charged for future payments. + """ + amount_type: NotRequired[Literal["fixed", "maximum"]] + """ + One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param. + """ + description: NotRequired[str] + """ + A description of the mandate or subscription that is meant to be displayed to the customer. + """ + end_date: NotRequired[int] + """ + End date of the mandate or subscription. + """ + + class PaymentMethodCreateParamsUsBankAccount(TypedDict): account_holder_type: NotRequired[Literal["company", "individual"]] """ diff --git a/stripe/params/_payment_method_list_params.py b/stripe/params/_payment_method_list_params.py index 50d1608d0..f748432cc 100644 --- a/stripe/params/_payment_method_list_params.py +++ b/stripe/params/_payment_method_list_params.py @@ -91,6 +91,7 @@ class PaymentMethodListParams(RequestOptions): "stripe_balance", "swish", "twint", + "upi", "us_bank_account", "wechat_pay", "zip", diff --git a/stripe/params/_plan_create_params.py b/stripe/params/_plan_create_params.py index d3cdabcdf..5c912c4bc 100644 --- a/stripe/params/_plan_create_params.py +++ b/stripe/params/_plan_create_params.py @@ -104,12 +104,27 @@ class PlanCreateParamsProduct(TypedDict): """ A [tax code](https://docs.stripe.com/tax/tax-categories) ID. """ + tax_details: NotRequired["PlanCreateParamsProductTaxDetails"] + """ + Tax details for this product, including the [tax code](https://docs.stripe.com/tax/tax-codes) and an optional performance location. + """ unit_label: NotRequired[str] """ A label that represents units of this product. When set, this will be included in customers' receipts, invoices, Checkout, and the customer portal. """ +class PlanCreateParamsProductTaxDetails(TypedDict): + performance_location: NotRequired[str] + """ + A tax location ID. Depending on the [tax code](https://docs.stripe.com/tax/tax-for-tickets/reference/tax-location-performance), this is required, optional, or not supported. + """ + tax_code: str + """ + A [tax code](https://docs.stripe.com/tax/tax-categories) ID. + """ + + class PlanCreateParamsTier(TypedDict): flat_amount: NotRequired[int] """ diff --git a/stripe/params/_price_create_params.py b/stripe/params/_price_create_params.py index b584425ca..eb5417c77 100644 --- a/stripe/params/_price_create_params.py +++ b/stripe/params/_price_create_params.py @@ -199,12 +199,27 @@ class PriceCreateParamsProductData(TypedDict): """ A [tax code](https://docs.stripe.com/tax/tax-categories) ID. """ + tax_details: NotRequired["PriceCreateParamsProductDataTaxDetails"] + """ + Tax details for this product, including the [tax code](https://docs.stripe.com/tax/tax-codes) and an optional performance location. + """ unit_label: NotRequired[str] """ A label that represents units of this product. When set, this will be included in customers' receipts, invoices, Checkout, and the customer portal. """ +class PriceCreateParamsProductDataTaxDetails(TypedDict): + performance_location: NotRequired[str] + """ + A tax location ID. Depending on the [tax code](https://docs.stripe.com/tax/tax-for-tickets/reference/tax-location-performance), this is required, optional, or not supported. + """ + tax_code: str + """ + A [tax code](https://docs.stripe.com/tax/tax-categories) ID. + """ + + class PriceCreateParamsRecurring(TypedDict): interval: Literal["day", "month", "week", "year"] """ diff --git a/stripe/params/_product_create_params.py b/stripe/params/_product_create_params.py index d8fb6cbb1..e0fc1ec9b 100644 --- a/stripe/params/_product_create_params.py +++ b/stripe/params/_product_create_params.py @@ -63,6 +63,10 @@ class ProductCreateParams(RequestOptions): """ A [tax code](https://docs.stripe.com/tax/tax-categories) ID. """ + tax_details: NotRequired["ProductCreateParamsTaxDetails"] + """ + Tax details for this product, including the [tax code](https://docs.stripe.com/tax/tax-codes) and an optional performance location. + """ type: NotRequired[Literal["good", "service"]] """ The type of the product. Defaults to `service` if not explicitly specified, enabling use of this product with Subscriptions and Plans. Set this parameter to `good` to use this product with Orders and SKUs. On API versions before `2018-02-05`, this field defaults to `good` for compatibility reasons. @@ -241,3 +245,14 @@ class ProductCreateParamsPackageDimensions(TypedDict): """ Width, in inches. Maximum precision is 2 decimal places. """ + + +class ProductCreateParamsTaxDetails(TypedDict): + performance_location: NotRequired[str] + """ + A tax location ID. Depending on the [tax code](https://docs.stripe.com/tax/tax-for-tickets/reference/tax-location-performance), this is required, optional, or not supported. + """ + tax_code: str + """ + A [tax code](https://docs.stripe.com/tax/tax-categories) ID. + """ diff --git a/stripe/params/_product_modify_params.py b/stripe/params/_product_modify_params.py index 7db18ce7d..9b5bd8e33 100644 --- a/stripe/params/_product_modify_params.py +++ b/stripe/params/_product_modify_params.py @@ -61,6 +61,10 @@ class ProductModifyParams(RequestOptions): """ A [tax code](https://docs.stripe.com/tax/tax-categories) ID. """ + tax_details: NotRequired["Literal['']|ProductModifyParamsTaxDetails"] + """ + Tax details for this product, including the [tax code](https://docs.stripe.com/tax/tax-codes) and an optional performance location. + """ unit_label: NotRequired["Literal['']|str"] """ A label that represents units of this product. When set, this will be included in customers' receipts, invoices, Checkout, and the customer portal. May only be set if `type=service`. @@ -95,3 +99,14 @@ class ProductModifyParamsPackageDimensions(TypedDict): """ Width, in inches. Maximum precision is 2 decimal places. """ + + +class ProductModifyParamsTaxDetails(TypedDict): + performance_location: NotRequired[str] + """ + A tax location ID. Depending on the [tax code](https://docs.stripe.com/tax/tax-for-tickets/reference/tax-location-performance), this is required, optional, or not supported. + """ + tax_code: str + """ + A [tax code](https://docs.stripe.com/tax/tax-categories) ID. + """ diff --git a/stripe/params/_product_update_params.py b/stripe/params/_product_update_params.py index dbda248a2..d2472bfc1 100644 --- a/stripe/params/_product_update_params.py +++ b/stripe/params/_product_update_params.py @@ -60,6 +60,10 @@ class ProductUpdateParams(TypedDict): """ A [tax code](https://docs.stripe.com/tax/tax-categories) ID. """ + tax_details: NotRequired["Literal['']|ProductUpdateParamsTaxDetails"] + """ + Tax details for this product, including the [tax code](https://docs.stripe.com/tax/tax-codes) and an optional performance location. + """ unit_label: NotRequired["Literal['']|str"] """ A label that represents units of this product. When set, this will be included in customers' receipts, invoices, Checkout, and the customer portal. May only be set if `type=service`. @@ -94,3 +98,14 @@ class ProductUpdateParamsPackageDimensions(TypedDict): """ Width, in inches. Maximum precision is 2 decimal places. """ + + +class ProductUpdateParamsTaxDetails(TypedDict): + performance_location: NotRequired[str] + """ + A tax location ID. Depending on the [tax code](https://docs.stripe.com/tax/tax-for-tickets/reference/tax-location-performance), this is required, optional, or not supported. + """ + tax_code: str + """ + A [tax code](https://docs.stripe.com/tax/tax-categories) ID. + """ diff --git a/stripe/params/_quote_create_params.py b/stripe/params/_quote_create_params.py index 630521f09..3a9441d27 100644 --- a/stripe/params/_quote_create_params.py +++ b/stripe/params/_quote_create_params.py @@ -479,6 +479,10 @@ class QuoteCreateParamsLineActionAddItem(TypedDict): """ Options that configure the trial on the subscription item. """ + trial_offer: NotRequired[str] + """ + The ID of the trial offer to apply to the configuration item. + """ class QuoteCreateParamsLineActionAddItemDiscount(TypedDict): @@ -603,6 +607,10 @@ class QuoteCreateParamsLineActionSetItem(TypedDict): """ If an item with the `price` already exists, passing this will override the `trial` configuration on the subscription item that matches that price. Otherwise, the `items` array is cleared and a single new item is added with the supplied `trial`. """ + trial_offer: NotRequired[str] + """ + The ID of the trial offer to apply to the configuration item. + """ class QuoteCreateParamsLineActionSetItemDiscount(TypedDict): @@ -754,7 +762,7 @@ class QuoteCreateParamsLineSetPauseCollection(TypedDict): class QuoteCreateParamsLineSetPauseCollectionSet(TypedDict): behavior: Literal["keep_as_draft", "mark_uncollectible", "void"] """ - The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`. + The payment collection behavior for this subscription while paused. """ diff --git a/stripe/params/_quote_modify_params.py b/stripe/params/_quote_modify_params.py index a0f40795f..5e3601ee9 100644 --- a/stripe/params/_quote_modify_params.py +++ b/stripe/params/_quote_modify_params.py @@ -468,6 +468,10 @@ class QuoteModifyParamsLineActionAddItem(TypedDict): """ Options that configure the trial on the subscription item. """ + trial_offer: NotRequired[str] + """ + The ID of the trial offer to apply to the configuration item. + """ class QuoteModifyParamsLineActionAddItemDiscount(TypedDict): @@ -592,6 +596,10 @@ class QuoteModifyParamsLineActionSetItem(TypedDict): """ If an item with the `price` already exists, passing this will override the `trial` configuration on the subscription item that matches that price. Otherwise, the `items` array is cleared and a single new item is added with the supplied `trial`. """ + trial_offer: NotRequired[str] + """ + The ID of the trial offer to apply to the configuration item. + """ class QuoteModifyParamsLineActionSetItemDiscount(TypedDict): @@ -743,7 +751,7 @@ class QuoteModifyParamsLineSetPauseCollection(TypedDict): class QuoteModifyParamsLineSetPauseCollectionSet(TypedDict): behavior: Literal["keep_as_draft", "mark_uncollectible", "void"] """ - The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`. + The payment collection behavior for this subscription while paused. """ diff --git a/stripe/params/_quote_update_params.py b/stripe/params/_quote_update_params.py index e17e88e36..3df9a55a4 100644 --- a/stripe/params/_quote_update_params.py +++ b/stripe/params/_quote_update_params.py @@ -467,6 +467,10 @@ class QuoteUpdateParamsLineActionAddItem(TypedDict): """ Options that configure the trial on the subscription item. """ + trial_offer: NotRequired[str] + """ + The ID of the trial offer to apply to the configuration item. + """ class QuoteUpdateParamsLineActionAddItemDiscount(TypedDict): @@ -591,6 +595,10 @@ class QuoteUpdateParamsLineActionSetItem(TypedDict): """ If an item with the `price` already exists, passing this will override the `trial` configuration on the subscription item that matches that price. Otherwise, the `items` array is cleared and a single new item is added with the supplied `trial`. """ + trial_offer: NotRequired[str] + """ + The ID of the trial offer to apply to the configuration item. + """ class QuoteUpdateParamsLineActionSetItemDiscount(TypedDict): @@ -742,7 +750,7 @@ class QuoteUpdateParamsLineSetPauseCollection(TypedDict): class QuoteUpdateParamsLineSetPauseCollectionSet(TypedDict): behavior: Literal["keep_as_draft", "mark_uncollectible", "void"] """ - The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`. + The payment collection behavior for this subscription while paused. """ diff --git a/stripe/params/_setup_intent_confirm_params.py b/stripe/params/_setup_intent_confirm_params.py index 0d226463e..fb856043a 100644 --- a/stripe/params/_setup_intent_confirm_params.py +++ b/stripe/params/_setup_intent_confirm_params.py @@ -424,6 +424,7 @@ class SetupIntentConfirmParamsPaymentMethodData(TypedDict): "stripe_balance", "swish", "twint", + "upi", "us_bank_account", "wechat_pay", "zip", @@ -431,6 +432,10 @@ class SetupIntentConfirmParamsPaymentMethodData(TypedDict): """ 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. """ + upi: NotRequired["SetupIntentConfirmParamsPaymentMethodDataUpi"] + """ + If this is a `upi` PaymentMethod, this hash contains details about the UPI payment method. + """ us_bank_account: NotRequired[ "SetupIntentConfirmParamsPaymentMethodDataUsBankAccount" ] @@ -948,10 +953,6 @@ class SetupIntentConfirmParamsPaymentMethodDataStripeBalance(TypedDict): """ The connected account ID whose Stripe balance to use as the source of payment """ - source_type: NotRequired[Literal["bank_account", "card", "fpx"]] - """ - The [source_type](https://docs.stripe.com/api/balance/balance_object#balance_object-available-source_types) of the balance - """ class SetupIntentConfirmParamsPaymentMethodDataSwish(TypedDict): @@ -962,6 +963,34 @@ class SetupIntentConfirmParamsPaymentMethodDataTwint(TypedDict): pass +class SetupIntentConfirmParamsPaymentMethodDataUpi(TypedDict): + mandate_options: NotRequired[ + "SetupIntentConfirmParamsPaymentMethodDataUpiMandateOptions" + ] + """ + Configuration options for setting up an eMandate + """ + + +class SetupIntentConfirmParamsPaymentMethodDataUpiMandateOptions(TypedDict): + amount: NotRequired[int] + """ + Amount to be charged for future payments. + """ + amount_type: NotRequired[Literal["fixed", "maximum"]] + """ + One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param. + """ + description: NotRequired[str] + """ + A description of the mandate or subscription that is meant to be displayed to the customer. + """ + end_date: NotRequired[int] + """ + End date of the mandate or subscription. + """ + + class SetupIntentConfirmParamsPaymentMethodDataUsBankAccount(TypedDict): account_holder_type: NotRequired[Literal["company", "individual"]] """ @@ -1048,6 +1077,10 @@ class SetupIntentConfirmParamsPaymentMethodOptions(TypedDict): """ If this is a `sepa_debit` SetupIntent, this sub-hash contains details about the SEPA Debit payment method options. """ + upi: NotRequired["SetupIntentConfirmParamsPaymentMethodOptionsUpi"] + """ + If this is a `upi` SetupIntent, this sub-hash contains details about the UPI payment method options. + """ us_bank_account: NotRequired[ "SetupIntentConfirmParamsPaymentMethodOptionsUsBankAccount" ] @@ -1071,7 +1104,7 @@ class SetupIntentConfirmParamsPaymentMethodOptionsAcssDebit(TypedDict): Literal["automatic", "instant", "microdeposits"] ] """ - Bank account verification method. + Bank account verification method. The default value is `automatic`. """ @@ -1177,7 +1210,7 @@ class SetupIntentConfirmParamsPaymentMethodOptionsCardMandateOptions( ): amount: int """ - Amount to be charged for future payments. + Amount to be charged for future payments, specified in the presentment currency. """ amount_type: Literal["fixed", "maximum"] """ @@ -1530,7 +1563,7 @@ class SetupIntentConfirmParamsPaymentMethodOptionsPixMandateOptions(TypedDict): Literal["halfyearly", "monthly", "quarterly", "weekly", "yearly"] ] """ - Schedule at which the future payments will be charged. Defaults to `weekly`. + Schedule at which the future payments will be charged. Defaults to `monthly`. """ reference: NotRequired[str] """ @@ -1560,6 +1593,37 @@ class SetupIntentConfirmParamsPaymentMethodOptionsSepaDebitMandateOptions( """ +class SetupIntentConfirmParamsPaymentMethodOptionsUpi(TypedDict): + mandate_options: NotRequired[ + "SetupIntentConfirmParamsPaymentMethodOptionsUpiMandateOptions" + ] + """ + Configuration options for setting up an eMandate + """ + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session', 'on_session']" + ] + + +class SetupIntentConfirmParamsPaymentMethodOptionsUpiMandateOptions(TypedDict): + amount: NotRequired[int] + """ + Amount to be charged for future payments. + """ + amount_type: NotRequired[Literal["fixed", "maximum"]] + """ + One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param. + """ + description: NotRequired[str] + """ + A description of the mandate or subscription that is meant to be displayed to the customer. + """ + end_date: NotRequired[int] + """ + End date of the mandate or subscription. + """ + + class SetupIntentConfirmParamsPaymentMethodOptionsUsBankAccount(TypedDict): financial_connections: NotRequired[ "SetupIntentConfirmParamsPaymentMethodOptionsUsBankAccountFinancialConnections" @@ -1583,7 +1647,7 @@ class SetupIntentConfirmParamsPaymentMethodOptionsUsBankAccount(TypedDict): Literal["automatic", "instant", "microdeposits"] ] """ - Bank account verification method. + Bank account verification method. The default value is `automatic`. """ diff --git a/stripe/params/_setup_intent_create_params.py b/stripe/params/_setup_intent_create_params.py index 140c54661..f3bc6ffe9 100644 --- a/stripe/params/_setup_intent_create_params.py +++ b/stripe/params/_setup_intent_create_params.py @@ -100,6 +100,7 @@ class SetupIntentCreateParams(RequestOptions): "stripe_balance", "swish", "twint", + "upi", "us_bank_account", "wechat_pay", "zip", @@ -557,6 +558,7 @@ class SetupIntentCreateParamsPaymentMethodData(TypedDict): "stripe_balance", "swish", "twint", + "upi", "us_bank_account", "wechat_pay", "zip", @@ -564,6 +566,10 @@ class SetupIntentCreateParamsPaymentMethodData(TypedDict): """ 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. """ + upi: NotRequired["SetupIntentCreateParamsPaymentMethodDataUpi"] + """ + If this is a `upi` PaymentMethod, this hash contains details about the UPI payment method. + """ us_bank_account: NotRequired[ "SetupIntentCreateParamsPaymentMethodDataUsBankAccount" ] @@ -1079,10 +1085,6 @@ class SetupIntentCreateParamsPaymentMethodDataStripeBalance(TypedDict): """ The connected account ID whose Stripe balance to use as the source of payment """ - source_type: NotRequired[Literal["bank_account", "card", "fpx"]] - """ - The [source_type](https://docs.stripe.com/api/balance/balance_object#balance_object-available-source_types) of the balance - """ class SetupIntentCreateParamsPaymentMethodDataSwish(TypedDict): @@ -1093,6 +1095,34 @@ class SetupIntentCreateParamsPaymentMethodDataTwint(TypedDict): pass +class SetupIntentCreateParamsPaymentMethodDataUpi(TypedDict): + mandate_options: NotRequired[ + "SetupIntentCreateParamsPaymentMethodDataUpiMandateOptions" + ] + """ + Configuration options for setting up an eMandate + """ + + +class SetupIntentCreateParamsPaymentMethodDataUpiMandateOptions(TypedDict): + amount: NotRequired[int] + """ + Amount to be charged for future payments. + """ + amount_type: NotRequired[Literal["fixed", "maximum"]] + """ + One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param. + """ + description: NotRequired[str] + """ + A description of the mandate or subscription that is meant to be displayed to the customer. + """ + end_date: NotRequired[int] + """ + End date of the mandate or subscription. + """ + + class SetupIntentCreateParamsPaymentMethodDataUsBankAccount(TypedDict): account_holder_type: NotRequired[Literal["company", "individual"]] """ @@ -1179,6 +1209,10 @@ class SetupIntentCreateParamsPaymentMethodOptions(TypedDict): """ If this is a `sepa_debit` SetupIntent, this sub-hash contains details about the SEPA Debit payment method options. """ + upi: NotRequired["SetupIntentCreateParamsPaymentMethodOptionsUpi"] + """ + If this is a `upi` SetupIntent, this sub-hash contains details about the UPI payment method options. + """ us_bank_account: NotRequired[ "SetupIntentCreateParamsPaymentMethodOptionsUsBankAccount" ] @@ -1202,7 +1236,7 @@ class SetupIntentCreateParamsPaymentMethodOptionsAcssDebit(TypedDict): Literal["automatic", "instant", "microdeposits"] ] """ - Bank account verification method. + Bank account verification method. The default value is `automatic`. """ @@ -1306,7 +1340,7 @@ class SetupIntentCreateParamsPaymentMethodOptionsCard(TypedDict): class SetupIntentCreateParamsPaymentMethodOptionsCardMandateOptions(TypedDict): amount: int """ - Amount to be charged for future payments. + Amount to be charged for future payments, specified in the presentment currency. """ amount_type: Literal["fixed", "maximum"] """ @@ -1657,7 +1691,7 @@ class SetupIntentCreateParamsPaymentMethodOptionsPixMandateOptions(TypedDict): Literal["halfyearly", "monthly", "quarterly", "weekly", "yearly"] ] """ - Schedule at which the future payments will be charged. Defaults to `weekly`. + Schedule at which the future payments will be charged. Defaults to `monthly`. """ reference: NotRequired[str] """ @@ -1687,6 +1721,37 @@ class SetupIntentCreateParamsPaymentMethodOptionsSepaDebitMandateOptions( """ +class SetupIntentCreateParamsPaymentMethodOptionsUpi(TypedDict): + mandate_options: NotRequired[ + "SetupIntentCreateParamsPaymentMethodOptionsUpiMandateOptions" + ] + """ + Configuration options for setting up an eMandate + """ + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session', 'on_session']" + ] + + +class SetupIntentCreateParamsPaymentMethodOptionsUpiMandateOptions(TypedDict): + amount: NotRequired[int] + """ + Amount to be charged for future payments. + """ + amount_type: NotRequired[Literal["fixed", "maximum"]] + """ + One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param. + """ + description: NotRequired[str] + """ + A description of the mandate or subscription that is meant to be displayed to the customer. + """ + end_date: NotRequired[int] + """ + End date of the mandate or subscription. + """ + + class SetupIntentCreateParamsPaymentMethodOptionsUsBankAccount(TypedDict): financial_connections: NotRequired[ "SetupIntentCreateParamsPaymentMethodOptionsUsBankAccountFinancialConnections" @@ -1710,7 +1775,7 @@ class SetupIntentCreateParamsPaymentMethodOptionsUsBankAccount(TypedDict): Literal["automatic", "instant", "microdeposits"] ] """ - Bank account verification method. + Bank account verification method. The default value is `automatic`. """ diff --git a/stripe/params/_setup_intent_modify_params.py b/stripe/params/_setup_intent_modify_params.py index 94be2c559..7def47b0d 100644 --- a/stripe/params/_setup_intent_modify_params.py +++ b/stripe/params/_setup_intent_modify_params.py @@ -29,7 +29,7 @@ class SetupIntentModifyParams(RequestOptions): An arbitrary string attached to the object. Often useful for displaying to users. """ excluded_payment_method_types: NotRequired[ - "Literal['']|List[Literal['acss_debit', 'affirm', 'afterpay_clearpay', 'alipay', 'alma', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'billie', 'blik', 'boleto', 'card', 'cashapp', 'crypto', 'customer_balance', 'eps', 'fpx', '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', 'sepa_debit', 'shopeepay', 'sofort', 'stripe_balance', 'swish', 'twint', 'us_bank_account', 'wechat_pay', 'zip']]" + "Literal['']|List[Literal['acss_debit', 'affirm', 'afterpay_clearpay', 'alipay', 'alma', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'billie', 'blik', 'boleto', 'card', 'cashapp', 'crypto', 'customer_balance', 'eps', 'fpx', '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', 'sepa_debit', 'shopeepay', 'sofort', 'stripe_balance', 'swish', 'twint', 'upi', 'us_bank_account', 'wechat_pay', 'zip']]" ] """ The list of payment method types to exclude from use with this SetupIntent. @@ -398,6 +398,7 @@ class SetupIntentModifyParamsPaymentMethodData(TypedDict): "stripe_balance", "swish", "twint", + "upi", "us_bank_account", "wechat_pay", "zip", @@ -405,6 +406,10 @@ class SetupIntentModifyParamsPaymentMethodData(TypedDict): """ 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. """ + upi: NotRequired["SetupIntentModifyParamsPaymentMethodDataUpi"] + """ + If this is a `upi` PaymentMethod, this hash contains details about the UPI payment method. + """ us_bank_account: NotRequired[ "SetupIntentModifyParamsPaymentMethodDataUsBankAccount" ] @@ -920,10 +925,6 @@ class SetupIntentModifyParamsPaymentMethodDataStripeBalance(TypedDict): """ The connected account ID whose Stripe balance to use as the source of payment """ - source_type: NotRequired[Literal["bank_account", "card", "fpx"]] - """ - The [source_type](https://docs.stripe.com/api/balance/balance_object#balance_object-available-source_types) of the balance - """ class SetupIntentModifyParamsPaymentMethodDataSwish(TypedDict): @@ -934,6 +935,34 @@ class SetupIntentModifyParamsPaymentMethodDataTwint(TypedDict): pass +class SetupIntentModifyParamsPaymentMethodDataUpi(TypedDict): + mandate_options: NotRequired[ + "SetupIntentModifyParamsPaymentMethodDataUpiMandateOptions" + ] + """ + Configuration options for setting up an eMandate + """ + + +class SetupIntentModifyParamsPaymentMethodDataUpiMandateOptions(TypedDict): + amount: NotRequired[int] + """ + Amount to be charged for future payments. + """ + amount_type: NotRequired[Literal["fixed", "maximum"]] + """ + One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param. + """ + description: NotRequired[str] + """ + A description of the mandate or subscription that is meant to be displayed to the customer. + """ + end_date: NotRequired[int] + """ + End date of the mandate or subscription. + """ + + class SetupIntentModifyParamsPaymentMethodDataUsBankAccount(TypedDict): account_holder_type: NotRequired[Literal["company", "individual"]] """ @@ -1020,6 +1049,10 @@ class SetupIntentModifyParamsPaymentMethodOptions(TypedDict): """ If this is a `sepa_debit` SetupIntent, this sub-hash contains details about the SEPA Debit payment method options. """ + upi: NotRequired["SetupIntentModifyParamsPaymentMethodOptionsUpi"] + """ + If this is a `upi` SetupIntent, this sub-hash contains details about the UPI payment method options. + """ us_bank_account: NotRequired[ "SetupIntentModifyParamsPaymentMethodOptionsUsBankAccount" ] @@ -1043,7 +1076,7 @@ class SetupIntentModifyParamsPaymentMethodOptionsAcssDebit(TypedDict): Literal["automatic", "instant", "microdeposits"] ] """ - Bank account verification method. + Bank account verification method. The default value is `automatic`. """ @@ -1147,7 +1180,7 @@ class SetupIntentModifyParamsPaymentMethodOptionsCard(TypedDict): class SetupIntentModifyParamsPaymentMethodOptionsCardMandateOptions(TypedDict): amount: int """ - Amount to be charged for future payments. + Amount to be charged for future payments, specified in the presentment currency. """ amount_type: Literal["fixed", "maximum"] """ @@ -1498,7 +1531,7 @@ class SetupIntentModifyParamsPaymentMethodOptionsPixMandateOptions(TypedDict): Literal["halfyearly", "monthly", "quarterly", "weekly", "yearly"] ] """ - Schedule at which the future payments will be charged. Defaults to `weekly`. + Schedule at which the future payments will be charged. Defaults to `monthly`. """ reference: NotRequired[str] """ @@ -1528,6 +1561,37 @@ class SetupIntentModifyParamsPaymentMethodOptionsSepaDebitMandateOptions( """ +class SetupIntentModifyParamsPaymentMethodOptionsUpi(TypedDict): + mandate_options: NotRequired[ + "SetupIntentModifyParamsPaymentMethodOptionsUpiMandateOptions" + ] + """ + Configuration options for setting up an eMandate + """ + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session', 'on_session']" + ] + + +class SetupIntentModifyParamsPaymentMethodOptionsUpiMandateOptions(TypedDict): + amount: NotRequired[int] + """ + Amount to be charged for future payments. + """ + amount_type: NotRequired[Literal["fixed", "maximum"]] + """ + One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param. + """ + description: NotRequired[str] + """ + A description of the mandate or subscription that is meant to be displayed to the customer. + """ + end_date: NotRequired[int] + """ + End date of the mandate or subscription. + """ + + class SetupIntentModifyParamsPaymentMethodOptionsUsBankAccount(TypedDict): financial_connections: NotRequired[ "SetupIntentModifyParamsPaymentMethodOptionsUsBankAccountFinancialConnections" @@ -1551,7 +1615,7 @@ class SetupIntentModifyParamsPaymentMethodOptionsUsBankAccount(TypedDict): Literal["automatic", "instant", "microdeposits"] ] """ - Bank account verification method. + Bank account verification method. The default value is `automatic`. """ diff --git a/stripe/params/_setup_intent_update_params.py b/stripe/params/_setup_intent_update_params.py index 2264b435c..86061a670 100644 --- a/stripe/params/_setup_intent_update_params.py +++ b/stripe/params/_setup_intent_update_params.py @@ -28,7 +28,7 @@ class SetupIntentUpdateParams(TypedDict): An arbitrary string attached to the object. Often useful for displaying to users. """ excluded_payment_method_types: NotRequired[ - "Literal['']|List[Literal['acss_debit', 'affirm', 'afterpay_clearpay', 'alipay', 'alma', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'billie', 'blik', 'boleto', 'card', 'cashapp', 'crypto', 'customer_balance', 'eps', 'fpx', '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', 'sepa_debit', 'shopeepay', 'sofort', 'stripe_balance', 'swish', 'twint', 'us_bank_account', 'wechat_pay', 'zip']]" + "Literal['']|List[Literal['acss_debit', 'affirm', 'afterpay_clearpay', 'alipay', 'alma', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'billie', 'blik', 'boleto', 'card', 'cashapp', 'crypto', 'customer_balance', 'eps', 'fpx', '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', 'sepa_debit', 'shopeepay', 'sofort', 'stripe_balance', 'swish', 'twint', 'upi', 'us_bank_account', 'wechat_pay', 'zip']]" ] """ The list of payment method types to exclude from use with this SetupIntent. @@ -397,6 +397,7 @@ class SetupIntentUpdateParamsPaymentMethodData(TypedDict): "stripe_balance", "swish", "twint", + "upi", "us_bank_account", "wechat_pay", "zip", @@ -404,6 +405,10 @@ class SetupIntentUpdateParamsPaymentMethodData(TypedDict): """ 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. """ + upi: NotRequired["SetupIntentUpdateParamsPaymentMethodDataUpi"] + """ + If this is a `upi` PaymentMethod, this hash contains details about the UPI payment method. + """ us_bank_account: NotRequired[ "SetupIntentUpdateParamsPaymentMethodDataUsBankAccount" ] @@ -919,10 +924,6 @@ class SetupIntentUpdateParamsPaymentMethodDataStripeBalance(TypedDict): """ The connected account ID whose Stripe balance to use as the source of payment """ - source_type: NotRequired[Literal["bank_account", "card", "fpx"]] - """ - The [source_type](https://docs.stripe.com/api/balance/balance_object#balance_object-available-source_types) of the balance - """ class SetupIntentUpdateParamsPaymentMethodDataSwish(TypedDict): @@ -933,6 +934,34 @@ class SetupIntentUpdateParamsPaymentMethodDataTwint(TypedDict): pass +class SetupIntentUpdateParamsPaymentMethodDataUpi(TypedDict): + mandate_options: NotRequired[ + "SetupIntentUpdateParamsPaymentMethodDataUpiMandateOptions" + ] + """ + Configuration options for setting up an eMandate + """ + + +class SetupIntentUpdateParamsPaymentMethodDataUpiMandateOptions(TypedDict): + amount: NotRequired[int] + """ + Amount to be charged for future payments. + """ + amount_type: NotRequired[Literal["fixed", "maximum"]] + """ + One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param. + """ + description: NotRequired[str] + """ + A description of the mandate or subscription that is meant to be displayed to the customer. + """ + end_date: NotRequired[int] + """ + End date of the mandate or subscription. + """ + + class SetupIntentUpdateParamsPaymentMethodDataUsBankAccount(TypedDict): account_holder_type: NotRequired[Literal["company", "individual"]] """ @@ -1019,6 +1048,10 @@ class SetupIntentUpdateParamsPaymentMethodOptions(TypedDict): """ If this is a `sepa_debit` SetupIntent, this sub-hash contains details about the SEPA Debit payment method options. """ + upi: NotRequired["SetupIntentUpdateParamsPaymentMethodOptionsUpi"] + """ + If this is a `upi` SetupIntent, this sub-hash contains details about the UPI payment method options. + """ us_bank_account: NotRequired[ "SetupIntentUpdateParamsPaymentMethodOptionsUsBankAccount" ] @@ -1042,7 +1075,7 @@ class SetupIntentUpdateParamsPaymentMethodOptionsAcssDebit(TypedDict): Literal["automatic", "instant", "microdeposits"] ] """ - Bank account verification method. + Bank account verification method. The default value is `automatic`. """ @@ -1146,7 +1179,7 @@ class SetupIntentUpdateParamsPaymentMethodOptionsCard(TypedDict): class SetupIntentUpdateParamsPaymentMethodOptionsCardMandateOptions(TypedDict): amount: int """ - Amount to be charged for future payments. + Amount to be charged for future payments, specified in the presentment currency. """ amount_type: Literal["fixed", "maximum"] """ @@ -1497,7 +1530,7 @@ class SetupIntentUpdateParamsPaymentMethodOptionsPixMandateOptions(TypedDict): Literal["halfyearly", "monthly", "quarterly", "weekly", "yearly"] ] """ - Schedule at which the future payments will be charged. Defaults to `weekly`. + Schedule at which the future payments will be charged. Defaults to `monthly`. """ reference: NotRequired[str] """ @@ -1527,6 +1560,37 @@ class SetupIntentUpdateParamsPaymentMethodOptionsSepaDebitMandateOptions( """ +class SetupIntentUpdateParamsPaymentMethodOptionsUpi(TypedDict): + mandate_options: NotRequired[ + "SetupIntentUpdateParamsPaymentMethodOptionsUpiMandateOptions" + ] + """ + Configuration options for setting up an eMandate + """ + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session', 'on_session']" + ] + + +class SetupIntentUpdateParamsPaymentMethodOptionsUpiMandateOptions(TypedDict): + amount: NotRequired[int] + """ + Amount to be charged for future payments. + """ + amount_type: NotRequired[Literal["fixed", "maximum"]] + """ + One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param. + """ + description: NotRequired[str] + """ + A description of the mandate or subscription that is meant to be displayed to the customer. + """ + end_date: NotRequired[int] + """ + End date of the mandate or subscription. + """ + + class SetupIntentUpdateParamsPaymentMethodOptionsUsBankAccount(TypedDict): financial_connections: NotRequired[ "SetupIntentUpdateParamsPaymentMethodOptionsUsBankAccountFinancialConnections" @@ -1550,7 +1614,7 @@ class SetupIntentUpdateParamsPaymentMethodOptionsUsBankAccount(TypedDict): Literal["automatic", "instant", "microdeposits"] ] """ - Bank account verification method. + Bank account verification method. The default value is `automatic`. """ diff --git a/stripe/params/_subscription_create_params.py b/stripe/params/_subscription_create_params.py index b6c71790a..2cda3a633 100644 --- a/stripe/params/_subscription_create_params.py +++ b/stripe/params/_subscription_create_params.py @@ -155,7 +155,7 @@ class SubscriptionCreateParams(RequestOptions): "Literal['']|SubscriptionCreateParamsPendingInvoiceItemInterval" ] """ - Specifies an interval for how often to bill for any pending invoice items. It is analogous to calling [Create an invoice](https://docs.stripe.com/api#create_invoice) for the given subscription at the specified interval. + Specifies an interval for how often to bill for any pending invoice items. It is analogous to calling [Create an invoice](https://docs.stripe.com/api/invoices/create) for the given subscription at the specified interval. """ prebilling: NotRequired["SubscriptionCreateParamsPrebilling"] """ @@ -535,6 +535,10 @@ class SubscriptionCreateParamsItem(TypedDict): """ Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. Pass an empty string to remove previously-defined thresholds. """ + current_trial: NotRequired["SubscriptionCreateParamsItemCurrentTrial"] + """ + The trial offer to apply to this subscription item. + """ discounts: NotRequired[ "Literal['']|List[SubscriptionCreateParamsItemDiscount]" ] @@ -578,6 +582,17 @@ class SubscriptionCreateParamsItemBillingThresholds(TypedDict): """ +class SubscriptionCreateParamsItemCurrentTrial(TypedDict): + trial_end: NotRequired[int] + """ + Unix timestamp representing the end of the trial offer period. Required when the trial offer has `duration.type=timestamp`. Cannot be specified when `duration.type=relative`. + """ + trial_offer: str + """ + The ID of the trial offer to apply to the subscription item. + """ + + class SubscriptionCreateParamsItemDiscount(TypedDict): coupon: NotRequired[str] """ @@ -841,7 +856,7 @@ class SubscriptionCreateParamsPaymentSettingsPaymentMethodOptionsCardMandateOpti ): amount: NotRequired[int] """ - Amount to be charged for future payments. + Amount to be charged for future payments, specified in the presentment currency. """ amount_type: NotRequired[Literal["fixed", "maximum"]] """ @@ -945,6 +960,10 @@ class SubscriptionCreateParamsPaymentSettingsPaymentMethodOptionsPaytoMandateOpt class SubscriptionCreateParamsPaymentSettingsPaymentMethodOptionsPix( TypedDict ): + expires_after_seconds: NotRequired[int] + """ + The number of seconds (between 10 and 1209600) after which Pix payment will expire. Defaults to 86400 seconds. + """ mandate_options: NotRequired[ "SubscriptionCreateParamsPaymentSettingsPaymentMethodOptionsPixMandateOptions" ] @@ -972,7 +991,7 @@ class SubscriptionCreateParamsPaymentSettingsPaymentMethodOptionsPixMandateOptio Literal["halfyearly", "monthly", "quarterly", "weekly", "yearly"] ] """ - Schedule at which the future payments will be charged. Defaults to `weekly`. + Schedule at which the future payments will be charged. Defaults to `monthly`. """ @@ -1114,6 +1133,10 @@ class SubscriptionCreateParamsTrialSettings(TypedDict): class SubscriptionCreateParamsTrialSettingsEndBehavior(TypedDict): + billing_cycle_anchor: NotRequired[Literal["now", "unchanged"]] + """ + Indicates how the subscription's billing cycle anchor is reset when a trial ends. Defaults to `now`. + """ missing_payment_method: Literal["cancel", "create_invoice", "pause"] """ Indicates how the subscription should change when the trial ends if the user did not provide a payment method. diff --git a/stripe/params/_subscription_item_create_params.py b/stripe/params/_subscription_item_create_params.py index 42fc65de7..4670ad4e6 100644 --- a/stripe/params/_subscription_item_create_params.py +++ b/stripe/params/_subscription_item_create_params.py @@ -12,6 +12,10 @@ class SubscriptionItemCreateParams(RequestOptions): """ Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. Pass an empty string to remove previously-defined thresholds. """ + current_trial: NotRequired["SubscriptionItemCreateParamsCurrentTrial"] + """ + The trial offer to apply to this subscription item. + """ discounts: NotRequired[ "Literal['']|List[SubscriptionItemCreateParamsDiscount]" ] @@ -63,7 +67,7 @@ class SubscriptionItemCreateParams(RequestOptions): """ proration_date: NotRequired[int] """ - If set, the proration will be calculated as though the subscription was updated at the given time. This can be used to apply the same proration that was previewed with the [upcoming invoice](https://api.stripe.com#retrieve_customer_invoice) endpoint. + If set, the proration will be calculated as though the subscription was updated at the given time. This can be used to apply the same proration that was previewed with the [upcoming invoice](https://docs.stripe.com/api/invoices/create_preview) endpoint. """ quantity: NotRequired[int] """ @@ -90,6 +94,17 @@ class SubscriptionItemCreateParamsBillingThresholds(TypedDict): """ +class SubscriptionItemCreateParamsCurrentTrial(TypedDict): + trial_end: NotRequired[int] + """ + Unix timestamp representing the end of the trial offer period. Required when the trial offer has `duration.type=timestamp`. Cannot be specified when `duration.type=relative`. + """ + trial_offer: str + """ + The ID of the trial offer to apply to the subscription item. + """ + + class SubscriptionItemCreateParamsDiscount(TypedDict): coupon: NotRequired[str] """ diff --git a/stripe/params/_subscription_item_delete_params.py b/stripe/params/_subscription_item_delete_params.py index 746aa91a7..82aea8fea 100644 --- a/stripe/params/_subscription_item_delete_params.py +++ b/stripe/params/_subscription_item_delete_params.py @@ -34,5 +34,5 @@ class SubscriptionItemDeleteParams(RequestOptions): """ proration_date: NotRequired[int] """ - If set, the proration will be calculated as though the subscription was updated at the given time. This can be used to apply the same proration that was previewed with the [upcoming invoice](https://api.stripe.com#retrieve_customer_invoice) endpoint. + If set, the proration will be calculated as though the subscription was updated at the given time. This can be used to apply the same proration that was previewed with the [upcoming invoice](https://docs.stripe.com/api/invoices/create_preview) endpoint. """ diff --git a/stripe/params/_subscription_item_modify_params.py b/stripe/params/_subscription_item_modify_params.py index a0724f78f..37408bc85 100644 --- a/stripe/params/_subscription_item_modify_params.py +++ b/stripe/params/_subscription_item_modify_params.py @@ -12,6 +12,10 @@ class SubscriptionItemModifyParams(RequestOptions): """ Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. Pass an empty string to remove previously-defined thresholds. """ + current_trial: NotRequired["SubscriptionItemModifyParamsCurrentTrial"] + """ + The trial offer to apply to this subscription item. + """ discounts: NotRequired[ "Literal['']|List[SubscriptionItemModifyParamsDiscount]" ] @@ -67,7 +71,7 @@ class SubscriptionItemModifyParams(RequestOptions): """ proration_date: NotRequired[int] """ - If set, the proration will be calculated as though the subscription was updated at the given time. This can be used to apply the same proration that was previewed with the [upcoming invoice](https://api.stripe.com#retrieve_customer_invoice) endpoint. + If set, the proration will be calculated as though the subscription was updated at the given time. This can be used to apply the same proration that was previewed with the [upcoming invoice](https://docs.stripe.com/api/invoices/create_preview) endpoint. """ quantity: NotRequired[int] """ @@ -86,6 +90,17 @@ class SubscriptionItemModifyParamsBillingThresholds(TypedDict): """ +class SubscriptionItemModifyParamsCurrentTrial(TypedDict): + trial_end: NotRequired[int] + """ + Unix timestamp representing the end of the trial offer period. Required when the trial offer has `duration.type=timestamp`. Cannot be specified when `duration.type=relative`. + """ + trial_offer: str + """ + The ID of the trial offer to apply to the subscription item. + """ + + class SubscriptionItemModifyParamsDiscount(TypedDict): coupon: NotRequired[str] """ diff --git a/stripe/params/_subscription_item_update_params.py b/stripe/params/_subscription_item_update_params.py index e5dadc505..b85697d95 100644 --- a/stripe/params/_subscription_item_update_params.py +++ b/stripe/params/_subscription_item_update_params.py @@ -11,6 +11,10 @@ class SubscriptionItemUpdateParams(TypedDict): """ Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. Pass an empty string to remove previously-defined thresholds. """ + current_trial: NotRequired["SubscriptionItemUpdateParamsCurrentTrial"] + """ + The trial offer to apply to this subscription item. + """ discounts: NotRequired[ "Literal['']|List[SubscriptionItemUpdateParamsDiscount]" ] @@ -66,7 +70,7 @@ class SubscriptionItemUpdateParams(TypedDict): """ proration_date: NotRequired[int] """ - If set, the proration will be calculated as though the subscription was updated at the given time. This can be used to apply the same proration that was previewed with the [upcoming invoice](https://api.stripe.com#retrieve_customer_invoice) endpoint. + If set, the proration will be calculated as though the subscription was updated at the given time. This can be used to apply the same proration that was previewed with the [upcoming invoice](https://docs.stripe.com/api/invoices/create_preview) endpoint. """ quantity: NotRequired[int] """ @@ -85,6 +89,17 @@ class SubscriptionItemUpdateParamsBillingThresholds(TypedDict): """ +class SubscriptionItemUpdateParamsCurrentTrial(TypedDict): + trial_end: NotRequired[int] + """ + Unix timestamp representing the end of the trial offer period. Required when the trial offer has `duration.type=timestamp`. Cannot be specified when `duration.type=relative`. + """ + trial_offer: str + """ + The ID of the trial offer to apply to the subscription item. + """ + + class SubscriptionItemUpdateParamsDiscount(TypedDict): coupon: NotRequired[str] """ diff --git a/stripe/params/_subscription_modify_params.py b/stripe/params/_subscription_modify_params.py index 7ef4f3038..0b8799bf3 100644 --- a/stripe/params/_subscription_modify_params.py +++ b/stripe/params/_subscription_modify_params.py @@ -139,7 +139,7 @@ class SubscriptionModifyParams(RequestOptions): "Literal['']|SubscriptionModifyParamsPendingInvoiceItemInterval" ] """ - Specifies an interval for how often to bill for any pending invoice items. It is analogous to calling [Create an invoice](https://docs.stripe.com/api#create_invoice) for the given subscription at the specified interval. + Specifies an interval for how often to bill for any pending invoice items. It is analogous to calling [Create an invoice](https://docs.stripe.com/api/invoices/create) for the given subscription at the specified interval. """ prebilling: NotRequired["SubscriptionModifyParamsPrebilling"] """ @@ -497,6 +497,10 @@ class SubscriptionModifyParamsItem(TypedDict): """ Delete all usage for a given subscription item. You must pass this when deleting a usage records subscription item. `clear_usage` has no effect if the plan has a billing meter attached. """ + current_trial: NotRequired["SubscriptionModifyParamsItemCurrentTrial"] + """ + The trial offer to apply to this subscription item. + """ deleted: NotRequired[bool] """ A flag that, if set to `true`, will delete the specified item. @@ -544,6 +548,17 @@ class SubscriptionModifyParamsItemBillingThresholds(TypedDict): """ +class SubscriptionModifyParamsItemCurrentTrial(TypedDict): + trial_end: NotRequired[int] + """ + Unix timestamp representing the end of the trial offer period. Required when the trial offer has `duration.type=timestamp`. Cannot be specified when `duration.type=relative`. + """ + trial_offer: str + """ + The ID of the trial offer to apply to the subscription item. + """ + + class SubscriptionModifyParamsItemDiscount(TypedDict): coupon: NotRequired[str] """ @@ -634,7 +649,7 @@ class SubscriptionModifyParamsItemPriceDataRecurring(TypedDict): class SubscriptionModifyParamsPauseCollection(TypedDict): behavior: Literal["keep_as_draft", "mark_uncollectible", "void"] """ - The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`. + The payment collection behavior for this subscription while paused. """ resumes_at: NotRequired[int] """ @@ -807,7 +822,7 @@ class SubscriptionModifyParamsPaymentSettingsPaymentMethodOptionsCardMandateOpti ): amount: NotRequired[int] """ - Amount to be charged for future payments. + Amount to be charged for future payments, specified in the presentment currency. """ amount_type: NotRequired[Literal["fixed", "maximum"]] """ @@ -911,6 +926,10 @@ class SubscriptionModifyParamsPaymentSettingsPaymentMethodOptionsPaytoMandateOpt class SubscriptionModifyParamsPaymentSettingsPaymentMethodOptionsPix( TypedDict ): + expires_after_seconds: NotRequired[int] + """ + The number of seconds (between 10 and 1209600) after which Pix payment will expire. Defaults to 86400 seconds. + """ mandate_options: NotRequired[ "SubscriptionModifyParamsPaymentSettingsPaymentMethodOptionsPixMandateOptions" ] @@ -938,7 +957,7 @@ class SubscriptionModifyParamsPaymentSettingsPaymentMethodOptionsPixMandateOptio Literal["halfyearly", "monthly", "quarterly", "weekly", "yearly"] ] """ - Schedule at which the future payments will be charged. Defaults to `weekly`. + Schedule at which the future payments will be charged. Defaults to `monthly`. """ @@ -1080,6 +1099,10 @@ class SubscriptionModifyParamsTrialSettings(TypedDict): class SubscriptionModifyParamsTrialSettingsEndBehavior(TypedDict): + billing_cycle_anchor: NotRequired[Literal["now", "unchanged"]] + """ + Indicates how the subscription's billing cycle anchor is reset when a trial ends. Defaults to `now`. + """ missing_payment_method: Literal["cancel", "create_invoice", "pause"] """ Indicates how the subscription should change when the trial ends if the user did not provide a payment method. diff --git a/stripe/params/_subscription_schedule_amend_params.py b/stripe/params/_subscription_schedule_amend_params.py index 3c0e7032f..87a92b099 100644 --- a/stripe/params/_subscription_schedule_amend_params.py +++ b/stripe/params/_subscription_schedule_amend_params.py @@ -332,6 +332,10 @@ class SubscriptionScheduleAmendParamsAmendmentItemActionAdd(TypedDict): """ Options that configure the trial on the subscription item. """ + trial_offer: NotRequired[str] + """ + The ID of the trial offer to apply to the configuration item. + """ class SubscriptionScheduleAmendParamsAmendmentItemActionAddDiscount(TypedDict): @@ -434,6 +438,10 @@ class SubscriptionScheduleAmendParamsAmendmentItemActionSet(TypedDict): """ If an item with the `price` already exists, passing this will override the `trial` configuration on the subscription item that matches that price. Otherwise, the `items` array is cleared and a single new item is added with the supplied `trial`. """ + trial_offer: NotRequired[str] + """ + The ID of the trial offer to apply to the configuration item. + """ class SubscriptionScheduleAmendParamsAmendmentItemActionSetDiscount(TypedDict): @@ -535,7 +543,7 @@ class SubscriptionScheduleAmendParamsAmendmentSetPauseCollection(TypedDict): class SubscriptionScheduleAmendParamsAmendmentSetPauseCollectionSet(TypedDict): behavior: Literal["keep_as_draft", "mark_uncollectible", "void"] """ - The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`. + The payment collection behavior for this subscription while paused. """ diff --git a/stripe/params/_subscription_schedule_create_params.py b/stripe/params/_subscription_schedule_create_params.py index 486d645ee..5eb9c3d11 100644 --- a/stripe/params/_subscription_schedule_create_params.py +++ b/stripe/params/_subscription_schedule_create_params.py @@ -650,6 +650,10 @@ class SubscriptionScheduleCreateParamsPhaseItem(TypedDict): """ Options that configure the trial on the subscription item. """ + trial_offer: NotRequired[str] + """ + The ID of the trial offer to apply to the configuration item. + """ class SubscriptionScheduleCreateParamsPhaseItemBillingThresholds(TypedDict): @@ -762,7 +766,7 @@ class SubscriptionScheduleCreateParamsPhaseItemTrial(TypedDict): class SubscriptionScheduleCreateParamsPhasePauseCollection(TypedDict): behavior: Literal["keep_as_draft", "mark_uncollectible", "void"] """ - The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`. + The payment collection behavior for this subscription while paused. """ diff --git a/stripe/params/_subscription_schedule_modify_params.py b/stripe/params/_subscription_schedule_modify_params.py index 95582da3e..c15aff00c 100644 --- a/stripe/params/_subscription_schedule_modify_params.py +++ b/stripe/params/_subscription_schedule_modify_params.py @@ -620,6 +620,10 @@ class SubscriptionScheduleModifyParamsPhaseItem(TypedDict): """ Options that configure the trial on the subscription item. """ + trial_offer: NotRequired[str] + """ + The ID of the trial offer to apply to the configuration item. + """ class SubscriptionScheduleModifyParamsPhaseItemBillingThresholds(TypedDict): @@ -732,7 +736,7 @@ class SubscriptionScheduleModifyParamsPhaseItemTrial(TypedDict): class SubscriptionScheduleModifyParamsPhasePauseCollection(TypedDict): behavior: Literal["keep_as_draft", "mark_uncollectible", "void"] """ - The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`. + The payment collection behavior for this subscription while paused. """ diff --git a/stripe/params/_subscription_schedule_update_params.py b/stripe/params/_subscription_schedule_update_params.py index cb7a2eb66..41d03e113 100644 --- a/stripe/params/_subscription_schedule_update_params.py +++ b/stripe/params/_subscription_schedule_update_params.py @@ -619,6 +619,10 @@ class SubscriptionScheduleUpdateParamsPhaseItem(TypedDict): """ Options that configure the trial on the subscription item. """ + trial_offer: NotRequired[str] + """ + The ID of the trial offer to apply to the configuration item. + """ class SubscriptionScheduleUpdateParamsPhaseItemBillingThresholds(TypedDict): @@ -731,7 +735,7 @@ class SubscriptionScheduleUpdateParamsPhaseItemTrial(TypedDict): class SubscriptionScheduleUpdateParamsPhasePauseCollection(TypedDict): behavior: Literal["keep_as_draft", "mark_uncollectible", "void"] """ - The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`. + The payment collection behavior for this subscription while paused. """ diff --git a/stripe/params/_subscription_update_params.py b/stripe/params/_subscription_update_params.py index ae7e590e7..025fb0a7b 100644 --- a/stripe/params/_subscription_update_params.py +++ b/stripe/params/_subscription_update_params.py @@ -138,7 +138,7 @@ class SubscriptionUpdateParams(TypedDict): "Literal['']|SubscriptionUpdateParamsPendingInvoiceItemInterval" ] """ - Specifies an interval for how often to bill for any pending invoice items. It is analogous to calling [Create an invoice](https://docs.stripe.com/api#create_invoice) for the given subscription at the specified interval. + Specifies an interval for how often to bill for any pending invoice items. It is analogous to calling [Create an invoice](https://docs.stripe.com/api/invoices/create) for the given subscription at the specified interval. """ prebilling: NotRequired["SubscriptionUpdateParamsPrebilling"] """ @@ -496,6 +496,10 @@ class SubscriptionUpdateParamsItem(TypedDict): """ Delete all usage for a given subscription item. You must pass this when deleting a usage records subscription item. `clear_usage` has no effect if the plan has a billing meter attached. """ + current_trial: NotRequired["SubscriptionUpdateParamsItemCurrentTrial"] + """ + The trial offer to apply to this subscription item. + """ deleted: NotRequired[bool] """ A flag that, if set to `true`, will delete the specified item. @@ -543,6 +547,17 @@ class SubscriptionUpdateParamsItemBillingThresholds(TypedDict): """ +class SubscriptionUpdateParamsItemCurrentTrial(TypedDict): + trial_end: NotRequired[int] + """ + Unix timestamp representing the end of the trial offer period. Required when the trial offer has `duration.type=timestamp`. Cannot be specified when `duration.type=relative`. + """ + trial_offer: str + """ + The ID of the trial offer to apply to the subscription item. + """ + + class SubscriptionUpdateParamsItemDiscount(TypedDict): coupon: NotRequired[str] """ @@ -633,7 +648,7 @@ class SubscriptionUpdateParamsItemPriceDataRecurring(TypedDict): class SubscriptionUpdateParamsPauseCollection(TypedDict): behavior: Literal["keep_as_draft", "mark_uncollectible", "void"] """ - The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`. + The payment collection behavior for this subscription while paused. """ resumes_at: NotRequired[int] """ @@ -806,7 +821,7 @@ class SubscriptionUpdateParamsPaymentSettingsPaymentMethodOptionsCardMandateOpti ): amount: NotRequired[int] """ - Amount to be charged for future payments. + Amount to be charged for future payments, specified in the presentment currency. """ amount_type: NotRequired[Literal["fixed", "maximum"]] """ @@ -910,6 +925,10 @@ class SubscriptionUpdateParamsPaymentSettingsPaymentMethodOptionsPaytoMandateOpt class SubscriptionUpdateParamsPaymentSettingsPaymentMethodOptionsPix( TypedDict ): + expires_after_seconds: NotRequired[int] + """ + The number of seconds (between 10 and 1209600) after which Pix payment will expire. Defaults to 86400 seconds. + """ mandate_options: NotRequired[ "SubscriptionUpdateParamsPaymentSettingsPaymentMethodOptionsPixMandateOptions" ] @@ -937,7 +956,7 @@ class SubscriptionUpdateParamsPaymentSettingsPaymentMethodOptionsPixMandateOptio Literal["halfyearly", "monthly", "quarterly", "weekly", "yearly"] ] """ - Schedule at which the future payments will be charged. Defaults to `weekly`. + Schedule at which the future payments will be charged. Defaults to `monthly`. """ @@ -1079,6 +1098,10 @@ class SubscriptionUpdateParamsTrialSettings(TypedDict): class SubscriptionUpdateParamsTrialSettingsEndBehavior(TypedDict): + billing_cycle_anchor: NotRequired[Literal["now", "unchanged"]] + """ + Indicates how the subscription's billing cycle anchor is reset when a trial ends. Defaults to `now`. + """ missing_payment_method: Literal["cancel", "create_invoice", "pause"] """ Indicates how the subscription should change when the trial ends if the user did not provide a payment method. diff --git a/stripe/params/_webhook_endpoint_create_params.py b/stripe/params/_webhook_endpoint_create_params.py index c52fbff68..963d0416d 100644 --- a/stripe/params/_webhook_endpoint_create_params.py +++ b/stripe/params/_webhook_endpoint_create_params.py @@ -129,6 +129,7 @@ class WebhookEndpointCreateParams(RequestOptions): "2025-12-15.clover", "2026-01-28.clover", "2026-02-25.clover", + "2026-03-25.dahlia", ] ] """ diff --git a/stripe/params/checkout/__init__.py b/stripe/params/checkout/__init__.py index 2a5f72f2b..615836817 100644 --- a/stripe/params/checkout/__init__.py +++ b/stripe/params/checkout/__init__.py @@ -39,6 +39,7 @@ SessionCreateParamsLineItemAdjustableQuantity as SessionCreateParamsLineItemAdjustableQuantity, SessionCreateParamsLineItemPriceData as SessionCreateParamsLineItemPriceData, SessionCreateParamsLineItemPriceDataProductData as SessionCreateParamsLineItemPriceDataProductData, + SessionCreateParamsLineItemPriceDataProductDataTaxDetails as SessionCreateParamsLineItemPriceDataProductDataTaxDetails, SessionCreateParamsLineItemPriceDataRecurring as SessionCreateParamsLineItemPriceDataRecurring, SessionCreateParamsManagedPayments as SessionCreateParamsManagedPayments, SessionCreateParamsNameCollection as SessionCreateParamsNameCollection, @@ -69,6 +70,7 @@ SessionCreateParamsPaymentMethodOptionsCardInstallments as SessionCreateParamsPaymentMethodOptionsCardInstallments, SessionCreateParamsPaymentMethodOptionsCardRestrictions as SessionCreateParamsPaymentMethodOptionsCardRestrictions, SessionCreateParamsPaymentMethodOptionsCashapp as SessionCreateParamsPaymentMethodOptionsCashapp, + SessionCreateParamsPaymentMethodOptionsCrypto as SessionCreateParamsPaymentMethodOptionsCrypto, SessionCreateParamsPaymentMethodOptionsCustomerBalance as SessionCreateParamsPaymentMethodOptionsCustomerBalance, SessionCreateParamsPaymentMethodOptionsCustomerBalanceBankTransfer as SessionCreateParamsPaymentMethodOptionsCustomerBalanceBankTransfer, SessionCreateParamsPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer as SessionCreateParamsPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer, @@ -106,6 +108,8 @@ SessionCreateParamsPaymentMethodOptionsSofort as SessionCreateParamsPaymentMethodOptionsSofort, SessionCreateParamsPaymentMethodOptionsSwish as SessionCreateParamsPaymentMethodOptionsSwish, SessionCreateParamsPaymentMethodOptionsTwint as SessionCreateParamsPaymentMethodOptionsTwint, + SessionCreateParamsPaymentMethodOptionsUpi as SessionCreateParamsPaymentMethodOptionsUpi, + SessionCreateParamsPaymentMethodOptionsUpiMandateOptions as SessionCreateParamsPaymentMethodOptionsUpiMandateOptions, SessionCreateParamsPaymentMethodOptionsUsBankAccount as SessionCreateParamsPaymentMethodOptionsUsBankAccount, SessionCreateParamsPaymentMethodOptionsUsBankAccountFinancialConnections as SessionCreateParamsPaymentMethodOptionsUsBankAccountFinancialConnections, SessionCreateParamsPaymentMethodOptionsWechatPay as SessionCreateParamsPaymentMethodOptionsWechatPay, @@ -127,6 +131,7 @@ SessionCreateParamsSubscriptionDataBillingModeFlexible as SessionCreateParamsSubscriptionDataBillingModeFlexible, SessionCreateParamsSubscriptionDataInvoiceSettings as SessionCreateParamsSubscriptionDataInvoiceSettings, SessionCreateParamsSubscriptionDataInvoiceSettingsIssuer as SessionCreateParamsSubscriptionDataInvoiceSettingsIssuer, + SessionCreateParamsSubscriptionDataPendingInvoiceItemInterval as SessionCreateParamsSubscriptionDataPendingInvoiceItemInterval, SessionCreateParamsSubscriptionDataTransferData as SessionCreateParamsSubscriptionDataTransferData, SessionCreateParamsSubscriptionDataTrialSettings as SessionCreateParamsSubscriptionDataTrialSettings, SessionCreateParamsSubscriptionDataTrialSettingsEndBehavior as SessionCreateParamsSubscriptionDataTrialSettingsEndBehavior, @@ -164,6 +169,7 @@ SessionModifyParamsLineItemAdjustableQuantity as SessionModifyParamsLineItemAdjustableQuantity, SessionModifyParamsLineItemPriceData as SessionModifyParamsLineItemPriceData, SessionModifyParamsLineItemPriceDataProductData as SessionModifyParamsLineItemPriceDataProductData, + SessionModifyParamsLineItemPriceDataProductDataTaxDetails as SessionModifyParamsLineItemPriceDataProductDataTaxDetails, SessionModifyParamsLineItemPriceDataRecurring as SessionModifyParamsLineItemPriceDataRecurring, SessionModifyParamsShippingOption as SessionModifyParamsShippingOption, SessionModifyParamsShippingOptionShippingRateData as SessionModifyParamsShippingOptionShippingRateData, @@ -175,6 +181,7 @@ SessionModifyParamsSubscriptionData as SessionModifyParamsSubscriptionData, SessionModifyParamsSubscriptionDataInvoiceSettings as SessionModifyParamsSubscriptionDataInvoiceSettings, SessionModifyParamsSubscriptionDataInvoiceSettingsIssuer as SessionModifyParamsSubscriptionDataInvoiceSettingsIssuer, + SessionModifyParamsSubscriptionDataPendingInvoiceItemInterval as SessionModifyParamsSubscriptionDataPendingInvoiceItemInterval, ) from stripe.params.checkout._session_retrieve_params import ( SessionRetrieveParams as SessionRetrieveParams, @@ -195,6 +202,7 @@ SessionUpdateParamsLineItemAdjustableQuantity as SessionUpdateParamsLineItemAdjustableQuantity, SessionUpdateParamsLineItemPriceData as SessionUpdateParamsLineItemPriceData, SessionUpdateParamsLineItemPriceDataProductData as SessionUpdateParamsLineItemPriceDataProductData, + SessionUpdateParamsLineItemPriceDataProductDataTaxDetails as SessionUpdateParamsLineItemPriceDataProductDataTaxDetails, SessionUpdateParamsLineItemPriceDataRecurring as SessionUpdateParamsLineItemPriceDataRecurring, SessionUpdateParamsShippingOption as SessionUpdateParamsShippingOption, SessionUpdateParamsShippingOptionShippingRateData as SessionUpdateParamsShippingOptionShippingRateData, @@ -206,6 +214,7 @@ SessionUpdateParamsSubscriptionData as SessionUpdateParamsSubscriptionData, SessionUpdateParamsSubscriptionDataInvoiceSettings as SessionUpdateParamsSubscriptionDataInvoiceSettings, SessionUpdateParamsSubscriptionDataInvoiceSettingsIssuer as SessionUpdateParamsSubscriptionDataInvoiceSettingsIssuer, + SessionUpdateParamsSubscriptionDataPendingInvoiceItemInterval as SessionUpdateParamsSubscriptionDataPendingInvoiceItemInterval, ) # name -> (import_target, is_submodule) @@ -346,6 +355,10 @@ "stripe.params.checkout._session_create_params", False, ), + "SessionCreateParamsLineItemPriceDataProductDataTaxDetails": ( + "stripe.params.checkout._session_create_params", + False, + ), "SessionCreateParamsLineItemPriceDataRecurring": ( "stripe.params.checkout._session_create_params", False, @@ -466,6 +479,10 @@ "stripe.params.checkout._session_create_params", False, ), + "SessionCreateParamsPaymentMethodOptionsCrypto": ( + "stripe.params.checkout._session_create_params", + False, + ), "SessionCreateParamsPaymentMethodOptionsCustomerBalance": ( "stripe.params.checkout._session_create_params", False, @@ -614,6 +631,14 @@ "stripe.params.checkout._session_create_params", False, ), + "SessionCreateParamsPaymentMethodOptionsUpi": ( + "stripe.params.checkout._session_create_params", + False, + ), + "SessionCreateParamsPaymentMethodOptionsUpiMandateOptions": ( + "stripe.params.checkout._session_create_params", + False, + ), "SessionCreateParamsPaymentMethodOptionsUsBankAccount": ( "stripe.params.checkout._session_create_params", False, @@ -698,6 +723,10 @@ "stripe.params.checkout._session_create_params", False, ), + "SessionCreateParamsSubscriptionDataPendingInvoiceItemInterval": ( + "stripe.params.checkout._session_create_params", + False, + ), "SessionCreateParamsSubscriptionDataTransferData": ( "stripe.params.checkout._session_create_params", False, @@ -806,6 +835,10 @@ "stripe.params.checkout._session_modify_params", False, ), + "SessionModifyParamsLineItemPriceDataProductDataTaxDetails": ( + "stripe.params.checkout._session_modify_params", + False, + ), "SessionModifyParamsLineItemPriceDataRecurring": ( "stripe.params.checkout._session_modify_params", False, @@ -850,6 +883,10 @@ "stripe.params.checkout._session_modify_params", False, ), + "SessionModifyParamsSubscriptionDataPendingInvoiceItemInterval": ( + "stripe.params.checkout._session_modify_params", + False, + ), "SessionRetrieveParams": ( "stripe.params.checkout._session_retrieve_params", False, @@ -914,6 +951,10 @@ "stripe.params.checkout._session_update_params", False, ), + "SessionUpdateParamsLineItemPriceDataProductDataTaxDetails": ( + "stripe.params.checkout._session_update_params", + False, + ), "SessionUpdateParamsLineItemPriceDataRecurring": ( "stripe.params.checkout._session_update_params", False, @@ -958,6 +999,10 @@ "stripe.params.checkout._session_update_params", False, ), + "SessionUpdateParamsSubscriptionDataPendingInvoiceItemInterval": ( + "stripe.params.checkout._session_update_params", + False, + ), } if not TYPE_CHECKING: diff --git a/stripe/params/checkout/_session_create_params.py b/stripe/params/checkout/_session_create_params.py index 33b89a99c..d02e88775 100644 --- a/stripe/params/checkout/_session_create_params.py +++ b/stripe/params/checkout/_session_create_params.py @@ -156,6 +156,7 @@ class SessionCreateParams(RequestOptions): "sofort", "swish", "twint", + "upi", "us_bank_account", "wechat_pay", "zip", @@ -173,6 +174,10 @@ class SessionCreateParams(RequestOptions): """ The Epoch time in seconds at which the Checkout Session will expire. It can be anywhere from 30 minutes to 24 hours after Checkout Session creation. By default, this value is 24 hours from creation. """ + integration_identifier: NotRequired[str] + """ + The integration identifier for this Checkout Session. Multiple Checkout Sessions can have the same integration identifier. + """ invoice_creation: NotRequired["SessionCreateParamsInvoiceCreation"] """ Generate a post-purchase Invoice for one-time payments. @@ -353,6 +358,7 @@ class SessionCreateParams(RequestOptions): "sofort", "swish", "twint", + "upi", "us_bank_account", "wechat_pay", "zip", @@ -445,7 +451,17 @@ class SessionCreateParams(RequestOptions): """ Controls tax ID collection during checkout. """ - ui_mode: NotRequired[Literal["custom", "embedded", "hosted"]] + ui_mode: NotRequired[ + Literal[ + "custom", + "elements", + "embedded", + "embedded_page", + "form", + "hosted", + "hosted_page", + ] + ] """ The UI mode of the Session. Defaults to `hosted`. """ @@ -990,12 +1006,29 @@ class SessionCreateParamsLineItemPriceDataProductData(TypedDict): """ A [tax code](https://docs.stripe.com/tax/tax-categories) ID. """ + tax_details: NotRequired[ + "SessionCreateParamsLineItemPriceDataProductDataTaxDetails" + ] + """ + Tax details for this product, including the [tax code](https://docs.stripe.com/tax/tax-codes) and an optional performance location. + """ unit_label: NotRequired[str] """ A label that represents units of this product. When set, this will be included in customers' receipts, invoices, Checkout, and the customer portal. """ +class SessionCreateParamsLineItemPriceDataProductDataTaxDetails(TypedDict): + performance_location: NotRequired[str] + """ + A tax location ID. Depending on the [tax code](https://docs.stripe.com/tax/tax-for-tickets/reference/tax-location-performance), this is required, optional, or not supported. + """ + tax_code: str + """ + A [tax code](https://docs.stripe.com/tax/tax-categories) ID. + """ + + class SessionCreateParamsLineItemPriceDataRecurring(TypedDict): interval: Literal["day", "month", "week", "year"] """ @@ -1288,6 +1321,10 @@ class SessionCreateParamsPaymentMethodOptions(TypedDict): """ contains details about the Cashapp Pay payment method options. """ + crypto: NotRequired["SessionCreateParamsPaymentMethodOptionsCrypto"] + """ + contains details about the Crypto payment method options. + """ customer_balance: NotRequired[ "SessionCreateParamsPaymentMethodOptionsCustomerBalance" ] @@ -1418,6 +1455,10 @@ class SessionCreateParamsPaymentMethodOptions(TypedDict): """ contains details about the TWINT payment method options. """ + upi: NotRequired["SessionCreateParamsPaymentMethodOptionsUpi"] + """ + contains details about the UPI payment method options. + """ us_bank_account: NotRequired[ "SessionCreateParamsPaymentMethodOptionsUsBankAccount" ] @@ -1765,6 +1806,19 @@ class SessionCreateParamsPaymentMethodOptionsCashapp(TypedDict): """ +class SessionCreateParamsPaymentMethodOptionsCrypto(TypedDict): + setup_future_usage: NotRequired[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 SessionCreateParamsPaymentMethodOptionsCustomerBalance(TypedDict): bank_transfer: NotRequired[ "SessionCreateParamsPaymentMethodOptionsCustomerBalanceBankTransfer" @@ -2313,7 +2367,7 @@ class SessionCreateParamsPaymentMethodOptionsPixMandateOptions(TypedDict): Literal["halfyearly", "monthly", "quarterly", "weekly", "yearly"] ] """ - Schedule at which the future payments will be charged. Defaults to `weekly`. + Schedule at which the future payments will be charged. Defaults to `monthly`. """ reference: NotRequired[str] """ @@ -2423,6 +2477,37 @@ class SessionCreateParamsPaymentMethodOptionsTwint(TypedDict): """ +class SessionCreateParamsPaymentMethodOptionsUpi(TypedDict): + mandate_options: NotRequired[ + "SessionCreateParamsPaymentMethodOptionsUpiMandateOptions" + ] + """ + Additional fields for Mandate creation + """ + setup_future_usage: NotRequired[ + "Literal['']|Literal['none', 'off_session', 'on_session']" + ] + + +class SessionCreateParamsPaymentMethodOptionsUpiMandateOptions(TypedDict): + amount: NotRequired[int] + """ + Amount to be charged for future payments. + """ + amount_type: NotRequired[Literal["fixed", "maximum"]] + """ + One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param. + """ + description: NotRequired[str] + """ + A description of the mandate or subscription that is meant to be displayed to the customer. + """ + end_date: NotRequired[int] + """ + End date of the mandate or subscription. + """ + + class SessionCreateParamsPaymentMethodOptionsUsBankAccount(TypedDict): financial_connections: NotRequired[ "SessionCreateParamsPaymentMethodOptionsUsBankAccountFinancialConnections" @@ -2997,6 +3082,12 @@ class SessionCreateParamsSubscriptionData(TypedDict): """ The account on behalf of which to charge, for each of the subscription's invoices. """ + pending_invoice_item_interval: NotRequired[ + "SessionCreateParamsSubscriptionDataPendingInvoiceItemInterval" + ] + """ + Specifies an interval for how often to bill for any pending invoice items. It is analogous to calling [Create an invoice](https://docs.stripe.com/api#create_invoice) for the given subscription at the specified interval. + """ proration_behavior: NotRequired[Literal["create_prorations", "none"]] """ Determines how to handle prorations resulting from the `billing_cycle_anchor`. If no value is passed, the default is `create_prorations`. @@ -3063,6 +3154,17 @@ class SessionCreateParamsSubscriptionDataInvoiceSettingsIssuer(TypedDict): """ +class SessionCreateParamsSubscriptionDataPendingInvoiceItemInterval(TypedDict): + interval: Literal["day", "month", "week", "year"] + """ + Specifies invoicing frequency. Either `day`, `week`, `month` or `year`. + """ + interval_count: NotRequired[int] + """ + The number of intervals between invoices. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). + """ + + class SessionCreateParamsSubscriptionDataTransferData(TypedDict): amount_percent: NotRequired[float] """ diff --git a/stripe/params/checkout/_session_modify_params.py b/stripe/params/checkout/_session_modify_params.py index 5772cccac..fbfb18f1c 100644 --- a/stripe/params/checkout/_session_modify_params.py +++ b/stripe/params/checkout/_session_modify_params.py @@ -290,12 +290,29 @@ class SessionModifyParamsLineItemPriceDataProductData(TypedDict): """ A [tax code](https://docs.stripe.com/tax/tax-categories) ID. """ + tax_details: NotRequired[ + "SessionModifyParamsLineItemPriceDataProductDataTaxDetails" + ] + """ + Tax details for this product, including the [tax code](https://docs.stripe.com/tax/tax-codes) and an optional performance location. + """ unit_label: NotRequired[str] """ A label that represents units of this product. When set, this will be included in customers' receipts, invoices, Checkout, and the customer portal. """ +class SessionModifyParamsLineItemPriceDataProductDataTaxDetails(TypedDict): + performance_location: NotRequired[str] + """ + A tax location ID. Depending on the [tax code](https://docs.stripe.com/tax/tax-for-tickets/reference/tax-location-performance), this is required, optional, or not supported. + """ + tax_code: str + """ + A [tax code](https://docs.stripe.com/tax/tax-categories) ID. + """ + + class SessionModifyParamsLineItemPriceDataRecurring(TypedDict): interval: Literal["day", "month", "week", "year"] """ @@ -438,6 +455,12 @@ class SessionModifyParamsSubscriptionData(TypedDict): """ All invoices will be billed using the specified settings. """ + pending_invoice_item_interval: NotRequired[ + "Literal['']|SessionModifyParamsSubscriptionDataPendingInvoiceItemInterval" + ] + """ + Specifies an interval for how often to bill for any pending invoice items. It is analogous to calling [Create an invoice](https://docs.stripe.com/api#create_invoice) for the given subscription at the specified interval. + """ trial_end: NotRequired[int] """ Unix timestamp representing the end of the trial period the customer will get before being charged for the first time. Has to be at least 48 hours in the future. @@ -466,3 +489,14 @@ class SessionModifyParamsSubscriptionDataInvoiceSettingsIssuer(TypedDict): """ Type of the account referenced in the request. """ + + +class SessionModifyParamsSubscriptionDataPendingInvoiceItemInterval(TypedDict): + interval: Literal["day", "month", "week", "year"] + """ + Specifies invoicing frequency. Either `day`, `week`, `month` or `year`. + """ + interval_count: NotRequired[int] + """ + The number of intervals between invoices. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). + """ diff --git a/stripe/params/checkout/_session_update_params.py b/stripe/params/checkout/_session_update_params.py index f6eabc23a..238245d72 100644 --- a/stripe/params/checkout/_session_update_params.py +++ b/stripe/params/checkout/_session_update_params.py @@ -289,12 +289,29 @@ class SessionUpdateParamsLineItemPriceDataProductData(TypedDict): """ A [tax code](https://docs.stripe.com/tax/tax-categories) ID. """ + tax_details: NotRequired[ + "SessionUpdateParamsLineItemPriceDataProductDataTaxDetails" + ] + """ + Tax details for this product, including the [tax code](https://docs.stripe.com/tax/tax-codes) and an optional performance location. + """ unit_label: NotRequired[str] """ A label that represents units of this product. When set, this will be included in customers' receipts, invoices, Checkout, and the customer portal. """ +class SessionUpdateParamsLineItemPriceDataProductDataTaxDetails(TypedDict): + performance_location: NotRequired[str] + """ + A tax location ID. Depending on the [tax code](https://docs.stripe.com/tax/tax-for-tickets/reference/tax-location-performance), this is required, optional, or not supported. + """ + tax_code: str + """ + A [tax code](https://docs.stripe.com/tax/tax-categories) ID. + """ + + class SessionUpdateParamsLineItemPriceDataRecurring(TypedDict): interval: Literal["day", "month", "week", "year"] """ @@ -437,6 +454,12 @@ class SessionUpdateParamsSubscriptionData(TypedDict): """ All invoices will be billed using the specified settings. """ + pending_invoice_item_interval: NotRequired[ + "Literal['']|SessionUpdateParamsSubscriptionDataPendingInvoiceItemInterval" + ] + """ + Specifies an interval for how often to bill for any pending invoice items. It is analogous to calling [Create an invoice](https://docs.stripe.com/api#create_invoice) for the given subscription at the specified interval. + """ trial_end: NotRequired[int] """ Unix timestamp representing the end of the trial period the customer will get before being charged for the first time. Has to be at least 48 hours in the future. @@ -465,3 +488,14 @@ class SessionUpdateParamsSubscriptionDataInvoiceSettingsIssuer(TypedDict): """ Type of the account referenced in the request. """ + + +class SessionUpdateParamsSubscriptionDataPendingInvoiceItemInterval(TypedDict): + interval: Literal["day", "month", "week", "year"] + """ + Specifies invoicing frequency. Either `day`, `week`, `month` or `year`. + """ + interval_count: NotRequired[int] + """ + The number of intervals between invoices. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). + """ diff --git a/stripe/params/financial_connections/__init__.py b/stripe/params/financial_connections/__init__.py index f5a64095d..21494b139 100644 --- a/stripe/params/financial_connections/__init__.py +++ b/stripe/params/financial_connections/__init__.py @@ -51,6 +51,7 @@ SessionCreateParams as SessionCreateParams, SessionCreateParamsAccountHolder as SessionCreateParamsAccountHolder, SessionCreateParamsFilters as SessionCreateParamsFilters, + SessionCreateParamsHosted as SessionCreateParamsHosted, SessionCreateParamsLimits as SessionCreateParamsLimits, SessionCreateParamsManualEntry as SessionCreateParamsManualEntry, SessionCreateParamsRelinkOptions as SessionCreateParamsRelinkOptions, @@ -141,6 +142,10 @@ "stripe.params.financial_connections._session_create_params", False, ), + "SessionCreateParamsHosted": ( + "stripe.params.financial_connections._session_create_params", + False, + ), "SessionCreateParamsLimits": ( "stripe.params.financial_connections._session_create_params", False, diff --git a/stripe/params/financial_connections/_session_create_params.py b/stripe/params/financial_connections/_session_create_params.py index 14c7373be..a827b236b 100644 --- a/stripe/params/financial_connections/_session_create_params.py +++ b/stripe/params/financial_connections/_session_create_params.py @@ -18,6 +18,10 @@ class SessionCreateParams(RequestOptions): """ Filters to restrict the kinds of accounts to collect. """ + hosted: NotRequired["SessionCreateParamsHosted"] + """ + Settings for hosted Sessions. Required if `ui_mode` is `hosted`. + """ limits: NotRequired["SessionCreateParamsLimits"] """ Settings for configuring Session-specific limits. @@ -52,6 +56,10 @@ class SessionCreateParams(RequestOptions): """ For webview integrations only. Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app. """ + ui_mode: NotRequired[Literal["hosted", "modal"]] + """ + The UI mode of the Session. Defaults to `modal`. + """ class SessionCreateParamsAccountHolder(TypedDict): @@ -98,6 +106,13 @@ class SessionCreateParamsFilters(TypedDict): """ +class SessionCreateParamsHosted(TypedDict): + delivery_method: NotRequired[Literal["email", "url"]] + """ + How the user should enter the hosted flow. The values `email` and `url` can only be used if `relink_options` is provided. + """ + + class SessionCreateParamsLimits(TypedDict): accounts: int """ diff --git a/stripe/params/issuing/__init__.py b/stripe/params/issuing/__init__.py index c1c613c49..ea97b3a13 100644 --- a/stripe/params/issuing/__init__.py +++ b/stripe/params/issuing/__init__.py @@ -82,6 +82,8 @@ ) from stripe.params.issuing._card_create_params import ( CardCreateParams as CardCreateParams, + CardCreateParamsLifecycleControls as CardCreateParamsLifecycleControls, + CardCreateParamsLifecycleControlsCancelAfter as CardCreateParamsLifecycleControlsCancelAfter, CardCreateParamsPin as CardCreateParamsPin, CardCreateParamsShipping as CardCreateParamsShipping, CardCreateParamsShippingAddress as CardCreateParamsShippingAddress, @@ -582,6 +584,14 @@ False, ), "CardCreateParams": ("stripe.params.issuing._card_create_params", False), + "CardCreateParamsLifecycleControls": ( + "stripe.params.issuing._card_create_params", + False, + ), + "CardCreateParamsLifecycleControlsCancelAfter": ( + "stripe.params.issuing._card_create_params", + False, + ), "CardCreateParamsPin": ( "stripe.params.issuing._card_create_params", False, diff --git a/stripe/params/issuing/_authorization_create_params.py b/stripe/params/issuing/_authorization_create_params.py index c20825cd5..17ab73799 100644 --- a/stripe/params/issuing/_authorization_create_params.py +++ b/stripe/params/issuing/_authorization_create_params.py @@ -598,7 +598,7 @@ class AuthorizationCreateParamsRiskAssessmentCardTestingRisk(TypedDict): """ The % of declines due to incorrect verification data (like CVV or expiry) in the past hour, taking place at the same merchant. Higher rates correspond to a greater probability of bad actors attempting to utilize valid card credentials at merchants with verification requirements. Takes on values between 0 and 100. """ - risk_level: Literal[ + level: Literal[ "elevated", "highest", "low", "normal", "not_assessed", "unknown" ] """ @@ -624,7 +624,7 @@ class AuthorizationCreateParamsRiskAssessmentMerchantDisputeRisk(TypedDict): """ The dispute rate observed across all Stripe Issuing authorizations for this merchant. For example, a value of 50 means 50% of authorizations from this merchant on Stripe Issuing have resulted in a dispute. Higher values mean a higher likelihood the authorization is disputed. Takes on values between 0 and 100. """ - risk_level: Literal[ + level: Literal[ "elevated", "highest", "low", "normal", "not_assessed", "unknown" ] """ diff --git a/stripe/params/issuing/_card_create_params.py b/stripe/params/issuing/_card_create_params.py index ed8b0c5b1..7f8c6032a 100644 --- a/stripe/params/issuing/_card_create_params.py +++ b/stripe/params/issuing/_card_create_params.py @@ -30,6 +30,10 @@ class CardCreateParams(RequestOptions): """ The new financial account ID the card will be associated with. This field allows a card to be reassigned to a different financial account. """ + lifecycle_controls: NotRequired["CardCreateParamsLifecycleControls"] + """ + Rules that control the lifecycle of this card, such as automatic cancellation. Refer to our [documentation](https://docs.stripe.com/issuing/controls/lifecycle-controls) for more details. + """ metadata: NotRequired[Dict[str, 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`. @@ -74,6 +78,20 @@ class CardCreateParams(RequestOptions): """ +class CardCreateParamsLifecycleControls(TypedDict): + cancel_after: "CardCreateParamsLifecycleControlsCancelAfter" + """ + Cancels the card after the specified conditions are met. + """ + + +class CardCreateParamsLifecycleControlsCancelAfter(TypedDict): + payment_count: int + """ + The card is automatically cancelled when it makes this number of non-zero payment authorizations and transactions. The count includes penny authorizations, but doesn't include non-payment actions, such as authorization advice. + """ + + class CardCreateParamsPin(TypedDict): encrypted_number: NotRequired[str] """ diff --git a/stripe/params/issuing/_cardholder_create_params.py b/stripe/params/issuing/_cardholder_create_params.py index c115aaf9f..1e50794be 100644 --- a/stripe/params/issuing/_cardholder_create_params.py +++ b/stripe/params/issuing/_cardholder_create_params.py @@ -136,11 +136,11 @@ class CardholderCreateParamsIndividualCardIssuingUserTermsAcceptance( ): date: NotRequired[int] """ - The Unix timestamp marking when the cardholder accepted the Authorized User Terms. Required for Celtic Spend Card users. + The Unix timestamp marking when the cardholder accepted the Authorized User Terms. """ ip: NotRequired[str] """ - The IP address from which the cardholder accepted the Authorized User Terms. Required for Celtic Spend Card users. + The IP address from which the cardholder accepted the Authorized User Terms. """ user_agent: NotRequired["Literal['']|str"] """ diff --git a/stripe/params/issuing/_cardholder_modify_params.py b/stripe/params/issuing/_cardholder_modify_params.py index d3b0361bb..40579b905 100644 --- a/stripe/params/issuing/_cardholder_modify_params.py +++ b/stripe/params/issuing/_cardholder_modify_params.py @@ -127,11 +127,11 @@ class CardholderModifyParamsIndividualCardIssuingUserTermsAcceptance( ): date: NotRequired[int] """ - The Unix timestamp marking when the cardholder accepted the Authorized User Terms. Required for Celtic Spend Card users. + The Unix timestamp marking when the cardholder accepted the Authorized User Terms. """ ip: NotRequired[str] """ - The IP address from which the cardholder accepted the Authorized User Terms. Required for Celtic Spend Card users. + The IP address from which the cardholder accepted the Authorized User Terms. """ user_agent: NotRequired["Literal['']|str"] """ diff --git a/stripe/params/issuing/_cardholder_update_params.py b/stripe/params/issuing/_cardholder_update_params.py index 9e1d6ceae..352828995 100644 --- a/stripe/params/issuing/_cardholder_update_params.py +++ b/stripe/params/issuing/_cardholder_update_params.py @@ -126,11 +126,11 @@ class CardholderUpdateParamsIndividualCardIssuingUserTermsAcceptance( ): date: NotRequired[int] """ - The Unix timestamp marking when the cardholder accepted the Authorized User Terms. Required for Celtic Spend Card users. + The Unix timestamp marking when the cardholder accepted the Authorized User Terms. """ ip: NotRequired[str] """ - The IP address from which the cardholder accepted the Authorized User Terms. Required for Celtic Spend Card users. + The IP address from which the cardholder accepted the Authorized User Terms. """ user_agent: NotRequired["Literal['']|str"] """ diff --git a/stripe/params/product_catalog/__init__.py b/stripe/params/product_catalog/__init__.py new file mode 100644 index 000000000..f07d44c67 --- /dev/null +++ b/stripe/params/product_catalog/__init__.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from importlib import import_module +from typing_extensions import TYPE_CHECKING + +if TYPE_CHECKING: + from stripe.params.product_catalog._trial_offer_create_params import ( + TrialOfferCreateParams as TrialOfferCreateParams, + TrialOfferCreateParamsDuration as TrialOfferCreateParamsDuration, + TrialOfferCreateParamsDurationRelative as TrialOfferCreateParamsDurationRelative, + TrialOfferCreateParamsEndBehavior as TrialOfferCreateParamsEndBehavior, + TrialOfferCreateParamsEndBehaviorTransition as TrialOfferCreateParamsEndBehaviorTransition, + ) + +# name -> (import_target, is_submodule) +_import_map = { + "TrialOfferCreateParams": ( + "stripe.params.product_catalog._trial_offer_create_params", + False, + ), + "TrialOfferCreateParamsDuration": ( + "stripe.params.product_catalog._trial_offer_create_params", + False, + ), + "TrialOfferCreateParamsDurationRelative": ( + "stripe.params.product_catalog._trial_offer_create_params", + False, + ), + "TrialOfferCreateParamsEndBehavior": ( + "stripe.params.product_catalog._trial_offer_create_params", + False, + ), + "TrialOfferCreateParamsEndBehaviorTransition": ( + "stripe.params.product_catalog._trial_offer_create_params", + False, + ), +} +if not TYPE_CHECKING: + + def __getattr__(name): + try: + target, is_submodule = _import_map[name] + module = import_module(target) + if is_submodule: + return module + + return getattr( + module, + name, + ) + except KeyError: + raise AttributeError() diff --git a/stripe/params/product_catalog/_trial_offer_create_params.py b/stripe/params/product_catalog/_trial_offer_create_params.py new file mode 100644 index 000000000..21b9b8297 --- /dev/null +++ b/stripe/params/product_catalog/_trial_offer_create_params.py @@ -0,0 +1,60 @@ +# -*- 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, TypedDict + + +class TrialOfferCreateParams(RequestOptions): + duration: "TrialOfferCreateParamsDuration" + """ + Duration of one service period of the trial. + """ + end_behavior: "TrialOfferCreateParamsEndBehavior" + """ + Define behavior that occurs at the end of the trial. + """ + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + name: NotRequired[str] + """ + A brief, user-friendly name for the trial offer-for identification purposes. + """ + price: str + """ + Price configuration during the trial period (amount, billing scheme, etc). + """ + + +class TrialOfferCreateParamsDuration(TypedDict): + relative: NotRequired["TrialOfferCreateParamsDurationRelative"] + """ + The relative duration of the trial period computed as the number of recurring price intervals. + """ + type: Literal["relative", "timestamp"] + """ + Specifies how the trial offer duration is determined. + """ + + +class TrialOfferCreateParamsDurationRelative(TypedDict): + iterations: int + """ + The number of recurring price's interval to apply for the trial period. + """ + + +class TrialOfferCreateParamsEndBehavior(TypedDict): + transition: "TrialOfferCreateParamsEndBehaviorTransition" + """ + The transition to apply when the trial offer ends. + """ + + +class TrialOfferCreateParamsEndBehaviorTransition(TypedDict): + price: str + """ + The price to transition the recurring item to when the trial offer ends. + """ diff --git a/stripe/params/radar/_value_list_create_params.py b/stripe/params/radar/_value_list_create_params.py index a91570312..073d25da9 100644 --- a/stripe/params/radar/_value_list_create_params.py +++ b/stripe/params/radar/_value_list_create_params.py @@ -20,6 +20,7 @@ class ValueListCreateParams(RequestOptions): "card_fingerprint", "case_sensitive_string", "country", + "crypto_fingerprint", "customer_id", "email", "ip_address", @@ -29,7 +30,7 @@ class ValueListCreateParams(RequestOptions): ] ] """ - Type of the items in the value list. One of `card_fingerprint`, `card_bin`, `email`, `ip_address`, `country`, `string`, `case_sensitive_string`, `customer_id`, `sepa_debit_fingerprint`, or `us_bank_account_fingerprint`. Use `string` if the item type is unknown or mixed. + Type of the items in the value list. One of `card_fingerprint`, `card_bin`, `crypto_fingerprint`, `email`, `ip_address`, `country`, `string`, `case_sensitive_string`, `customer_id`, `sepa_debit_fingerprint`, or `us_bank_account_fingerprint`. Use `string` if the item type is unknown or mixed. """ metadata: NotRequired[Dict[str, str]] """ diff --git a/stripe/params/tax/__init__.py b/stripe/params/tax/__init__.py index f54fe1d59..24062fd37 100644 --- a/stripe/params/tax/__init__.py +++ b/stripe/params/tax/__init__.py @@ -36,6 +36,16 @@ from stripe.params.tax._form_retrieve_params import ( FormRetrieveParams as FormRetrieveParams, ) + from stripe.params.tax._location_create_params import ( + LocationCreateParams as LocationCreateParams, + LocationCreateParamsAddress as LocationCreateParamsAddress, + ) + from stripe.params.tax._location_list_params import ( + LocationListParams as LocationListParams, + ) + from stripe.params.tax._location_retrieve_params import ( + LocationRetrieveParams as LocationRetrieveParams, + ) from stripe.params.tax._registration_create_params import ( RegistrationCreateParams as RegistrationCreateParams, RegistrationCreateParamsCountryOptions as RegistrationCreateParamsCountryOptions, @@ -302,6 +312,19 @@ "FormListParamsPayee": ("stripe.params.tax._form_list_params", False), "FormPdfParams": ("stripe.params.tax._form_pdf_params", False), "FormRetrieveParams": ("stripe.params.tax._form_retrieve_params", False), + "LocationCreateParams": ( + "stripe.params.tax._location_create_params", + False, + ), + "LocationCreateParamsAddress": ( + "stripe.params.tax._location_create_params", + False, + ), + "LocationListParams": ("stripe.params.tax._location_list_params", False), + "LocationRetrieveParams": ( + "stripe.params.tax._location_retrieve_params", + False, + ), "RegistrationCreateParams": ( "stripe.params.tax._registration_create_params", False, diff --git a/stripe/params/tax/_calculation_create_params.py b/stripe/params/tax/_calculation_create_params.py index 90d7925eb..ce73522c1 100644 --- a/stripe/params/tax/_calculation_create_params.py +++ b/stripe/params/tax/_calculation_create_params.py @@ -219,13 +219,17 @@ class CalculationCreateParamsCustomerDetailsTaxId(TypedDict): class CalculationCreateParamsLineItem(TypedDict): amount: int """ - A positive integer representing the line item's total price in the [smallest currency unit](https://docs.stripe.com/currencies#zero-decimal). + A positive integer representing the line item's total price in the [smallest currency unit](https://docs.stripe.com/currencies#minor-units). If `tax_behavior=inclusive`, then this amount includes taxes. Otherwise, taxes are calculated on top of this amount. """ metadata: NotRequired[Dict[str, 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. """ + performance_location: NotRequired[str] + """ + A tax location ID. Depending on the [tax code](https://docs.stripe.com/tax/tax-for-tickets/reference/tax-location-performance), this is required, optional, or not supported. + """ product: NotRequired[str] """ If provided, the product's `tax_code` will be used as the line item's `tax_code`. @@ -285,7 +289,7 @@ class CalculationCreateParamsShipFromDetailsAddress(TypedDict): class CalculationCreateParamsShippingCost(TypedDict): amount: NotRequired[int] """ - A positive integer in the [smallest currency unit](https://docs.stripe.com/currencies#zero-decimal) representing the shipping charge. If `tax_behavior=inclusive`, then this amount includes taxes. Otherwise, taxes are calculated on top of this amount. + A positive integer in the [smallest currency unit](https://docs.stripe.com/currencies#minor-units) representing the shipping charge. If `tax_behavior=inclusive`, then this amount includes taxes. Otherwise, taxes are calculated on top of this amount. """ shipping_rate: NotRequired[str] """ diff --git a/stripe/params/tax/_location_create_params.py b/stripe/params/tax/_location_create_params.py new file mode 100644 index 000000000..8aa5abfca --- /dev/null +++ b/stripe/params/tax/_location_create_params.py @@ -0,0 +1,51 @@ +# -*- 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, TypedDict + + +class LocationCreateParams(RequestOptions): + address: "LocationCreateParamsAddress" + """ + The physical address of the tax location. + """ + description: NotRequired[str] + """ + Details to identify the tax location by its venue, types of events held, or available services, such as "A spacious auditorium suitable for large concerts and events.". + """ + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ + type: Literal["performance"] + """ + The type of tax location. The only supported value is "performance". + """ + + +class LocationCreateParamsAddress(TypedDict): + city: NotRequired["Literal['']|str"] + """ + City, district, suburb, town, or village. + """ + country: str + """ + Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + """ + line1: NotRequired["Literal['']|str"] + """ + Address line 1, such as the street, PO Box, or company name. + """ + line2: NotRequired["Literal['']|str"] + """ + Address line 2, such as the apartment, suite, unit, or building. + """ + postal_code: NotRequired["Literal['']|str"] + """ + ZIP or postal code. + """ + state: NotRequired["Literal['']|str"] + """ + State/province as an [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) subdivision code, without country prefix, such as "NY" or "TX". + """ diff --git a/stripe/params/tax/_location_list_params.py b/stripe/params/tax/_location_list_params.py new file mode 100644 index 000000000..cbe266706 --- /dev/null +++ b/stripe/params/tax/_location_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 LocationListParams(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. + """ + type: Literal["performance"] + """ + Type of the tax location. Currently the only option is `performance`. + """ diff --git a/stripe/params/tax/_location_retrieve_params.py b/stripe/params/tax/_location_retrieve_params.py new file mode 100644 index 000000000..107563bb5 --- /dev/null +++ b/stripe/params/tax/_location_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 LocationRetrieveParams(RequestOptions): + expand: NotRequired[List[str]] + """ + Specifies which fields in the response should be expanded. + """ diff --git a/stripe/params/tax/_registration_create_params.py b/stripe/params/tax/_registration_create_params.py index 13a24f564..03ab52b23 100644 --- a/stripe/params/tax/_registration_create_params.py +++ b/stripe/params/tax/_registration_create_params.py @@ -1781,11 +1781,19 @@ class RegistrationCreateParamsCountryOptionsUs(TypedDict): Options for the state sales tax registration. """ type: Literal[ + "admissions_tax", + "attendance_tax", + "entertainment_tax", + "gross_receipts_tax", + "hospitality_tax", "local_amusement_tax", "local_lease_tax", + "luxury_tax", + "resort_tax", "state_communications_tax", "state_retail_delivery_fee", "state_sales_tax", + "tourism_tax", ] """ Type of registration to be created in the US. diff --git a/stripe/params/tax/_transaction_create_reversal_params.py b/stripe/params/tax/_transaction_create_reversal_params.py index 48764a84a..469258dbd 100644 --- a/stripe/params/tax/_transaction_create_reversal_params.py +++ b/stripe/params/tax/_transaction_create_reversal_params.py @@ -12,7 +12,7 @@ class TransactionCreateReversalParams(RequestOptions): """ flat_amount: NotRequired[int] """ - A flat amount to reverse across the entire transaction, in the [smallest currency unit](https://docs.stripe.com/currencies#zero-decimal) in negative. This value represents the total amount to refund from the transaction, including taxes. + A flat amount to reverse across the entire transaction, in the [smallest currency unit](https://docs.stripe.com/currencies#minor-units) in negative. This value represents the total amount to refund from the transaction, including taxes. """ line_items: NotRequired[List["TransactionCreateReversalParamsLineItem"]] """ @@ -43,11 +43,11 @@ class TransactionCreateReversalParams(RequestOptions): class TransactionCreateReversalParamsLineItem(TypedDict): amount: int """ - The amount to reverse, in the [smallest currency unit](https://docs.stripe.com/currencies#zero-decimal) in negative. + The amount to reverse, in the [smallest currency unit](https://docs.stripe.com/currencies#minor-units) in negative. """ amount_tax: int """ - The amount of tax to reverse, in the [smallest currency unit](https://docs.stripe.com/currencies#zero-decimal) in negative. + The amount of tax to reverse, in the [smallest currency unit](https://docs.stripe.com/currencies#minor-units) in negative. """ metadata: NotRequired[Dict[str, str]] """ @@ -70,9 +70,9 @@ class TransactionCreateReversalParamsLineItem(TypedDict): class TransactionCreateReversalParamsShippingCost(TypedDict): amount: int """ - The amount to reverse, in the [smallest currency unit](https://docs.stripe.com/currencies#zero-decimal) in negative. + The amount to reverse, in the [smallest currency unit](https://docs.stripe.com/currencies#minor-units) in negative. """ amount_tax: int """ - The amount of tax to reverse, in the [smallest currency unit](https://docs.stripe.com/currencies#zero-decimal) in negative. + The amount of tax to reverse, in the [smallest currency unit](https://docs.stripe.com/currencies#minor-units) in negative. """ diff --git a/stripe/params/test_helpers/__init__.py b/stripe/params/test_helpers/__init__.py index bf44f46ce..8beb5a1bb 100644 --- a/stripe/params/test_helpers/__init__.py +++ b/stripe/params/test_helpers/__init__.py @@ -71,6 +71,8 @@ ConfirmationTokenCreateParamsPaymentMethodDataStripeBalance as ConfirmationTokenCreateParamsPaymentMethodDataStripeBalance, ConfirmationTokenCreateParamsPaymentMethodDataSwish as ConfirmationTokenCreateParamsPaymentMethodDataSwish, ConfirmationTokenCreateParamsPaymentMethodDataTwint as ConfirmationTokenCreateParamsPaymentMethodDataTwint, + ConfirmationTokenCreateParamsPaymentMethodDataUpi as ConfirmationTokenCreateParamsPaymentMethodDataUpi, + ConfirmationTokenCreateParamsPaymentMethodDataUpiMandateOptions as ConfirmationTokenCreateParamsPaymentMethodDataUpiMandateOptions, ConfirmationTokenCreateParamsPaymentMethodDataUsBankAccount as ConfirmationTokenCreateParamsPaymentMethodDataUsBankAccount, ConfirmationTokenCreateParamsPaymentMethodDataWechatPay as ConfirmationTokenCreateParamsPaymentMethodDataWechatPay, ConfirmationTokenCreateParamsPaymentMethodDataZip as ConfirmationTokenCreateParamsPaymentMethodDataZip, @@ -352,6 +354,14 @@ "stripe.params.test_helpers._confirmation_token_create_params", False, ), + "ConfirmationTokenCreateParamsPaymentMethodDataUpi": ( + "stripe.params.test_helpers._confirmation_token_create_params", + False, + ), + "ConfirmationTokenCreateParamsPaymentMethodDataUpiMandateOptions": ( + "stripe.params.test_helpers._confirmation_token_create_params", + False, + ), "ConfirmationTokenCreateParamsPaymentMethodDataUsBankAccount": ( "stripe.params.test_helpers._confirmation_token_create_params", False, diff --git a/stripe/params/test_helpers/_confirmation_token_create_params.py b/stripe/params/test_helpers/_confirmation_token_create_params.py index 249b57193..aeb284827 100644 --- a/stripe/params/test_helpers/_confirmation_token_create_params.py +++ b/stripe/params/test_helpers/_confirmation_token_create_params.py @@ -388,6 +388,7 @@ class ConfirmationTokenCreateParamsPaymentMethodData(TypedDict): "stripe_balance", "swish", "twint", + "upi", "us_bank_account", "wechat_pay", "zip", @@ -395,6 +396,10 @@ class ConfirmationTokenCreateParamsPaymentMethodData(TypedDict): """ 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. """ + upi: NotRequired["ConfirmationTokenCreateParamsPaymentMethodDataUpi"] + """ + If this is a `upi` PaymentMethod, this hash contains details about the UPI payment method. + """ us_bank_account: NotRequired[ "ConfirmationTokenCreateParamsPaymentMethodDataUsBankAccount" ] @@ -914,10 +919,6 @@ class ConfirmationTokenCreateParamsPaymentMethodDataStripeBalance(TypedDict): """ The connected account ID whose Stripe balance to use as the source of payment """ - source_type: NotRequired[Literal["bank_account", "card", "fpx"]] - """ - The [source_type](https://docs.stripe.com/api/balance/balance_object#balance_object-available-source_types) of the balance - """ class ConfirmationTokenCreateParamsPaymentMethodDataSwish(TypedDict): @@ -928,6 +929,36 @@ class ConfirmationTokenCreateParamsPaymentMethodDataTwint(TypedDict): pass +class ConfirmationTokenCreateParamsPaymentMethodDataUpi(TypedDict): + mandate_options: NotRequired[ + "ConfirmationTokenCreateParamsPaymentMethodDataUpiMandateOptions" + ] + """ + Configuration options for setting up an eMandate + """ + + +class ConfirmationTokenCreateParamsPaymentMethodDataUpiMandateOptions( + TypedDict, +): + amount: NotRequired[int] + """ + Amount to be charged for future payments. + """ + amount_type: NotRequired[Literal["fixed", "maximum"]] + """ + One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param. + """ + description: NotRequired[str] + """ + A description of the mandate or subscription that is meant to be displayed to the customer. + """ + end_date: NotRequired[int] + """ + End date of the mandate or subscription. + """ + + class ConfirmationTokenCreateParamsPaymentMethodDataUsBankAccount(TypedDict): account_holder_type: NotRequired[Literal["company", "individual"]] """ diff --git a/stripe/params/test_helpers/issuing/_authorization_create_params.py b/stripe/params/test_helpers/issuing/_authorization_create_params.py index 92a39a655..2d9f677ab 100644 --- a/stripe/params/test_helpers/issuing/_authorization_create_params.py +++ b/stripe/params/test_helpers/issuing/_authorization_create_params.py @@ -597,7 +597,7 @@ class AuthorizationCreateParamsRiskAssessmentCardTestingRisk(TypedDict): """ The % of declines due to incorrect verification data (like CVV or expiry) in the past hour, taking place at the same merchant. Higher rates correspond to a greater probability of bad actors attempting to utilize valid card credentials at merchants with verification requirements. Takes on values between 0 and 100. """ - risk_level: Literal[ + level: Literal[ "elevated", "highest", "low", "normal", "not_assessed", "unknown" ] """ @@ -623,7 +623,7 @@ class AuthorizationCreateParamsRiskAssessmentMerchantDisputeRisk(TypedDict): """ The dispute rate observed across all Stripe Issuing authorizations for this merchant. For example, a value of 50 means 50% of authorizations from this merchant on Stripe Issuing have resulted in a dispute. Higher values mean a higher likelihood the authorization is disputed. Takes on values between 0 and 100. """ - risk_level: Literal[ + level: Literal[ "elevated", "highest", "low", "normal", "not_assessed", "unknown" ] """ diff --git a/stripe/params/v2/core/__init__.py b/stripe/params/v2/core/__init__.py index af84448f4..d2c634817 100644 --- a/stripe/params/v2/core/__init__.py +++ b/stripe/params/v2/core/__init__.py @@ -122,7 +122,6 @@ AccountCreateParamsIdentityBusinessDetails as AccountCreateParamsIdentityBusinessDetails, AccountCreateParamsIdentityBusinessDetailsAddress as AccountCreateParamsIdentityBusinessDetailsAddress, AccountCreateParamsIdentityBusinessDetailsAnnualRevenue as AccountCreateParamsIdentityBusinessDetailsAnnualRevenue, - AccountCreateParamsIdentityBusinessDetailsAnnualRevenueAmount as AccountCreateParamsIdentityBusinessDetailsAnnualRevenueAmount, AccountCreateParamsIdentityBusinessDetailsDocuments as AccountCreateParamsIdentityBusinessDetailsDocuments, AccountCreateParamsIdentityBusinessDetailsDocumentsBankAccountOwnershipVerification as AccountCreateParamsIdentityBusinessDetailsDocumentsBankAccountOwnershipVerification, AccountCreateParamsIdentityBusinessDetailsDocumentsCompanyLicense as AccountCreateParamsIdentityBusinessDetailsDocumentsCompanyLicense, @@ -137,7 +136,6 @@ AccountCreateParamsIdentityBusinessDetailsDocumentsProofOfUltimateBeneficialOwnership as AccountCreateParamsIdentityBusinessDetailsDocumentsProofOfUltimateBeneficialOwnership, AccountCreateParamsIdentityBusinessDetailsIdNumber as AccountCreateParamsIdentityBusinessDetailsIdNumber, AccountCreateParamsIdentityBusinessDetailsMonthlyEstimatedRevenue as AccountCreateParamsIdentityBusinessDetailsMonthlyEstimatedRevenue, - AccountCreateParamsIdentityBusinessDetailsMonthlyEstimatedRevenueAmount as AccountCreateParamsIdentityBusinessDetailsMonthlyEstimatedRevenueAmount, AccountCreateParamsIdentityBusinessDetailsRegistrationDate as AccountCreateParamsIdentityBusinessDetailsRegistrationDate, AccountCreateParamsIdentityBusinessDetailsScriptAddresses as AccountCreateParamsIdentityBusinessDetailsScriptAddresses, AccountCreateParamsIdentityBusinessDetailsScriptAddressesKana as AccountCreateParamsIdentityBusinessDetailsScriptAddressesKana, @@ -195,7 +193,6 @@ AccountTokenCreateParamsIdentityBusinessDetails as AccountTokenCreateParamsIdentityBusinessDetails, AccountTokenCreateParamsIdentityBusinessDetailsAddress as AccountTokenCreateParamsIdentityBusinessDetailsAddress, AccountTokenCreateParamsIdentityBusinessDetailsAnnualRevenue as AccountTokenCreateParamsIdentityBusinessDetailsAnnualRevenue, - AccountTokenCreateParamsIdentityBusinessDetailsAnnualRevenueAmount as AccountTokenCreateParamsIdentityBusinessDetailsAnnualRevenueAmount, AccountTokenCreateParamsIdentityBusinessDetailsDocuments as AccountTokenCreateParamsIdentityBusinessDetailsDocuments, AccountTokenCreateParamsIdentityBusinessDetailsDocumentsBankAccountOwnershipVerification as AccountTokenCreateParamsIdentityBusinessDetailsDocumentsBankAccountOwnershipVerification, AccountTokenCreateParamsIdentityBusinessDetailsDocumentsCompanyLicense as AccountTokenCreateParamsIdentityBusinessDetailsDocumentsCompanyLicense, @@ -210,7 +207,6 @@ AccountTokenCreateParamsIdentityBusinessDetailsDocumentsProofOfUltimateBeneficialOwnership as AccountTokenCreateParamsIdentityBusinessDetailsDocumentsProofOfUltimateBeneficialOwnership, AccountTokenCreateParamsIdentityBusinessDetailsIdNumber as AccountTokenCreateParamsIdentityBusinessDetailsIdNumber, AccountTokenCreateParamsIdentityBusinessDetailsMonthlyEstimatedRevenue as AccountTokenCreateParamsIdentityBusinessDetailsMonthlyEstimatedRevenue, - AccountTokenCreateParamsIdentityBusinessDetailsMonthlyEstimatedRevenueAmount as AccountTokenCreateParamsIdentityBusinessDetailsMonthlyEstimatedRevenueAmount, AccountTokenCreateParamsIdentityBusinessDetailsRegistrationDate as AccountTokenCreateParamsIdentityBusinessDetailsRegistrationDate, AccountTokenCreateParamsIdentityBusinessDetailsScriptAddresses as AccountTokenCreateParamsIdentityBusinessDetailsScriptAddresses, AccountTokenCreateParamsIdentityBusinessDetailsScriptAddressesKana as AccountTokenCreateParamsIdentityBusinessDetailsScriptAddressesKana, @@ -358,7 +354,6 @@ AccountUpdateParamsIdentityBusinessDetails as AccountUpdateParamsIdentityBusinessDetails, AccountUpdateParamsIdentityBusinessDetailsAddress as AccountUpdateParamsIdentityBusinessDetailsAddress, AccountUpdateParamsIdentityBusinessDetailsAnnualRevenue as AccountUpdateParamsIdentityBusinessDetailsAnnualRevenue, - AccountUpdateParamsIdentityBusinessDetailsAnnualRevenueAmount as AccountUpdateParamsIdentityBusinessDetailsAnnualRevenueAmount, AccountUpdateParamsIdentityBusinessDetailsDocuments as AccountUpdateParamsIdentityBusinessDetailsDocuments, AccountUpdateParamsIdentityBusinessDetailsDocumentsBankAccountOwnershipVerification as AccountUpdateParamsIdentityBusinessDetailsDocumentsBankAccountOwnershipVerification, AccountUpdateParamsIdentityBusinessDetailsDocumentsCompanyLicense as AccountUpdateParamsIdentityBusinessDetailsDocumentsCompanyLicense, @@ -373,7 +368,6 @@ AccountUpdateParamsIdentityBusinessDetailsDocumentsProofOfUltimateBeneficialOwnership as AccountUpdateParamsIdentityBusinessDetailsDocumentsProofOfUltimateBeneficialOwnership, AccountUpdateParamsIdentityBusinessDetailsIdNumber as AccountUpdateParamsIdentityBusinessDetailsIdNumber, AccountUpdateParamsIdentityBusinessDetailsMonthlyEstimatedRevenue as AccountUpdateParamsIdentityBusinessDetailsMonthlyEstimatedRevenue, - AccountUpdateParamsIdentityBusinessDetailsMonthlyEstimatedRevenueAmount as AccountUpdateParamsIdentityBusinessDetailsMonthlyEstimatedRevenueAmount, AccountUpdateParamsIdentityBusinessDetailsRegistrationDate as AccountUpdateParamsIdentityBusinessDetailsRegistrationDate, AccountUpdateParamsIdentityBusinessDetailsScriptAddresses as AccountUpdateParamsIdentityBusinessDetailsScriptAddresses, AccountUpdateParamsIdentityBusinessDetailsScriptAddressesKana as AccountUpdateParamsIdentityBusinessDetailsScriptAddressesKana, @@ -403,9 +397,21 @@ AccountUpdateParamsIdentityIndividualScriptNamesKana as AccountUpdateParamsIdentityIndividualScriptNamesKana, AccountUpdateParamsIdentityIndividualScriptNamesKanji as AccountUpdateParamsIdentityIndividualScriptNamesKanji, ) + from stripe.params.v2.core._batch_job_cancel_params import ( + BatchJobCancelParams as BatchJobCancelParams, + ) + from stripe.params.v2.core._batch_job_create_params import ( + BatchJobCreateParams as BatchJobCreateParams, + BatchJobCreateParamsEndpoint as BatchJobCreateParamsEndpoint, + BatchJobCreateParamsNotificationSuppression as BatchJobCreateParamsNotificationSuppression, + ) + from stripe.params.v2.core._batch_job_retrieve_params import ( + BatchJobRetrieveParams as BatchJobRetrieveParams, + ) from stripe.params.v2.core._event_destination_create_params import ( EventDestinationCreateParams as EventDestinationCreateParams, EventDestinationCreateParamsAmazonEventbridge as EventDestinationCreateParamsAmazonEventbridge, + EventDestinationCreateParamsAzureEventGrid as EventDestinationCreateParamsAzureEventGrid, EventDestinationCreateParamsWebhookEndpoint as EventDestinationCreateParamsWebhookEndpoint, ) from stripe.params.v2.core._event_destination_delete_params import ( @@ -898,10 +904,6 @@ "stripe.params.v2.core._account_create_params", False, ), - "AccountCreateParamsIdentityBusinessDetailsAnnualRevenueAmount": ( - "stripe.params.v2.core._account_create_params", - False, - ), "AccountCreateParamsIdentityBusinessDetailsDocuments": ( "stripe.params.v2.core._account_create_params", False, @@ -958,10 +960,6 @@ "stripe.params.v2.core._account_create_params", False, ), - "AccountCreateParamsIdentityBusinessDetailsMonthlyEstimatedRevenueAmount": ( - "stripe.params.v2.core._account_create_params", - False, - ), "AccountCreateParamsIdentityBusinessDetailsRegistrationDate": ( "stripe.params.v2.core._account_create_params", False, @@ -1155,10 +1153,6 @@ "stripe.params.v2.core._account_token_create_params", False, ), - "AccountTokenCreateParamsIdentityBusinessDetailsAnnualRevenueAmount": ( - "stripe.params.v2.core._account_token_create_params", - False, - ), "AccountTokenCreateParamsIdentityBusinessDetailsDocuments": ( "stripe.params.v2.core._account_token_create_params", False, @@ -1215,10 +1209,6 @@ "stripe.params.v2.core._account_token_create_params", False, ), - "AccountTokenCreateParamsIdentityBusinessDetailsMonthlyEstimatedRevenueAmount": ( - "stripe.params.v2.core._account_token_create_params", - False, - ), "AccountTokenCreateParamsIdentityBusinessDetailsRegistrationDate": ( "stripe.params.v2.core._account_token_create_params", False, @@ -1791,10 +1781,6 @@ "stripe.params.v2.core._account_update_params", False, ), - "AccountUpdateParamsIdentityBusinessDetailsAnnualRevenueAmount": ( - "stripe.params.v2.core._account_update_params", - False, - ), "AccountUpdateParamsIdentityBusinessDetailsDocuments": ( "stripe.params.v2.core._account_update_params", False, @@ -1851,10 +1837,6 @@ "stripe.params.v2.core._account_update_params", False, ), - "AccountUpdateParamsIdentityBusinessDetailsMonthlyEstimatedRevenueAmount": ( - "stripe.params.v2.core._account_update_params", - False, - ), "AccountUpdateParamsIdentityBusinessDetailsRegistrationDate": ( "stripe.params.v2.core._account_update_params", False, @@ -1967,6 +1949,26 @@ "stripe.params.v2.core._account_update_params", False, ), + "BatchJobCancelParams": ( + "stripe.params.v2.core._batch_job_cancel_params", + False, + ), + "BatchJobCreateParams": ( + "stripe.params.v2.core._batch_job_create_params", + False, + ), + "BatchJobCreateParamsEndpoint": ( + "stripe.params.v2.core._batch_job_create_params", + False, + ), + "BatchJobCreateParamsNotificationSuppression": ( + "stripe.params.v2.core._batch_job_create_params", + False, + ), + "BatchJobRetrieveParams": ( + "stripe.params.v2.core._batch_job_retrieve_params", + False, + ), "EventDestinationCreateParams": ( "stripe.params.v2.core._event_destination_create_params", False, @@ -1975,6 +1977,10 @@ "stripe.params.v2.core._event_destination_create_params", False, ), + "EventDestinationCreateParamsAzureEventGrid": ( + "stripe.params.v2.core._event_destination_create_params", + False, + ), "EventDestinationCreateParamsWebhookEndpoint": ( "stripe.params.v2.core._event_destination_create_params", False, diff --git a/stripe/params/v2/core/_account_create_params.py b/stripe/params/v2/core/_account_create_params.py index 90256cff0..ceb57199b 100644 --- a/stripe/params/v2/core/_account_create_params.py +++ b/stripe/params/v2/core/_account_create_params.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec +from stripe.v2._amount import AmountParam from typing import Dict, List from typing_extensions import Literal, NotRequired, TypedDict @@ -1604,6 +1605,10 @@ class AccountCreateParamsDefaults(TypedDict): """ Default responsibilities held by either Stripe or the platform. """ + timezone: NotRequired[str] + """ + The Account's local timezone. A list of possible time zone values is maintained at the [IANA Time Zone Database](https://www.iana.org/time-zones). + """ class AccountCreateParamsDefaultsProfile(TypedDict): @@ -1937,9 +1942,7 @@ class AccountCreateParamsIdentityBusinessDetailsAddress(TypedDict): class AccountCreateParamsIdentityBusinessDetailsAnnualRevenue(TypedDict): - amount: NotRequired[ - "AccountCreateParamsIdentityBusinessDetailsAnnualRevenueAmount" - ] + amount: NotRequired[AmountParam] """ A non-negative integer representing the amount in the smallest currency unit. """ @@ -1949,17 +1952,6 @@ class AccountCreateParamsIdentityBusinessDetailsAnnualRevenue(TypedDict): """ -class AccountCreateParamsIdentityBusinessDetailsAnnualRevenueAmount(TypedDict): - value: int - """ - A non-negative integer representing how much to charge in the [smallest currency unit](https://docs.stripe.com/currencies#minor-units). - """ - 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). - """ - - class AccountCreateParamsIdentityBusinessDetailsDocuments(TypedDict): bank_account_ownership_verification: NotRequired[ "AccountCreateParamsIdentityBusinessDetailsDocumentsBankAccountOwnershipVerification" @@ -2300,27 +2292,12 @@ class AccountCreateParamsIdentityBusinessDetailsIdNumber(TypedDict): class AccountCreateParamsIdentityBusinessDetailsMonthlyEstimatedRevenue( TypedDict, ): - amount: NotRequired[ - "AccountCreateParamsIdentityBusinessDetailsMonthlyEstimatedRevenueAmount" - ] + amount: NotRequired[AmountParam] """ A non-negative integer representing the amount in the smallest currency unit. """ -class AccountCreateParamsIdentityBusinessDetailsMonthlyEstimatedRevenueAmount( - TypedDict, -): - value: int - """ - A non-negative integer representing how much to charge in the [smallest currency unit](https://docs.stripe.com/currencies#minor-units). - """ - 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). - """ - - class AccountCreateParamsIdentityBusinessDetailsRegistrationDate(TypedDict): day: int """ diff --git a/stripe/params/v2/core/_account_token_create_params.py b/stripe/params/v2/core/_account_token_create_params.py index 70763f870..d9953f06e 100644 --- a/stripe/params/v2/core/_account_token_create_params.py +++ b/stripe/params/v2/core/_account_token_create_params.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec +from stripe.v2._amount import AmountParam from typing import Dict, List, Optional from typing_extensions import Literal, NotRequired, TypedDict @@ -292,9 +293,7 @@ class AccountTokenCreateParamsIdentityBusinessDetailsAddress(TypedDict): class AccountTokenCreateParamsIdentityBusinessDetailsAnnualRevenue(TypedDict): - amount: NotRequired[ - "AccountTokenCreateParamsIdentityBusinessDetailsAnnualRevenueAmount" - ] + amount: NotRequired[AmountParam] """ A non-negative integer representing the amount in the smallest currency unit. """ @@ -304,19 +303,6 @@ class AccountTokenCreateParamsIdentityBusinessDetailsAnnualRevenue(TypedDict): """ -class AccountTokenCreateParamsIdentityBusinessDetailsAnnualRevenueAmount( - TypedDict, -): - value: int - """ - A non-negative integer representing how much to charge in the [smallest currency unit](https://docs.stripe.com/currencies#minor-units). - """ - 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). - """ - - class AccountTokenCreateParamsIdentityBusinessDetailsDocuments(TypedDict): bank_account_ownership_verification: NotRequired[ "AccountTokenCreateParamsIdentityBusinessDetailsDocumentsBankAccountOwnershipVerification" @@ -657,27 +643,12 @@ class AccountTokenCreateParamsIdentityBusinessDetailsIdNumber(TypedDict): class AccountTokenCreateParamsIdentityBusinessDetailsMonthlyEstimatedRevenue( TypedDict, ): - amount: NotRequired[ - "AccountTokenCreateParamsIdentityBusinessDetailsMonthlyEstimatedRevenueAmount" - ] + amount: NotRequired[AmountParam] """ A non-negative integer representing the amount in the smallest currency unit. """ -class AccountTokenCreateParamsIdentityBusinessDetailsMonthlyEstimatedRevenueAmount( - TypedDict, -): - value: int - """ - A non-negative integer representing how much to charge in the [smallest currency unit](https://docs.stripe.com/currencies#minor-units). - """ - 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). - """ - - class AccountTokenCreateParamsIdentityBusinessDetailsRegistrationDate( TypedDict, ): diff --git a/stripe/params/v2/core/_account_update_params.py b/stripe/params/v2/core/_account_update_params.py index 2a79bb0e6..067456cf0 100644 --- a/stripe/params/v2/core/_account_update_params.py +++ b/stripe/params/v2/core/_account_update_params.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec +from stripe.v2._amount import AmountParam from typing import Dict, List, Optional from typing_extensions import Literal, NotRequired, TypedDict @@ -1632,6 +1633,10 @@ class AccountUpdateParamsDefaults(TypedDict): """ Default responsibilities held by either Stripe or the platform. """ + timezone: NotRequired[str] + """ + The Account's local timezone. A list of possible time zone values is maintained at the [IANA Time Zone Database](https://www.iana.org/time-zones). + """ class AccountUpdateParamsDefaultsProfile(TypedDict): @@ -1988,9 +1993,7 @@ class AccountUpdateParamsIdentityBusinessDetailsAddress(TypedDict): class AccountUpdateParamsIdentityBusinessDetailsAnnualRevenue(TypedDict): - amount: NotRequired[ - "AccountUpdateParamsIdentityBusinessDetailsAnnualRevenueAmount" - ] + amount: NotRequired[AmountParam] """ A non-negative integer representing the amount in the smallest currency unit. """ @@ -2000,17 +2003,6 @@ class AccountUpdateParamsIdentityBusinessDetailsAnnualRevenue(TypedDict): """ -class AccountUpdateParamsIdentityBusinessDetailsAnnualRevenueAmount(TypedDict): - value: int - """ - A non-negative integer representing how much to charge in the [smallest currency unit](https://docs.stripe.com/currencies#minor-units). - """ - 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). - """ - - class AccountUpdateParamsIdentityBusinessDetailsDocuments(TypedDict): bank_account_ownership_verification: NotRequired[ "AccountUpdateParamsIdentityBusinessDetailsDocumentsBankAccountOwnershipVerification" @@ -2351,27 +2343,12 @@ class AccountUpdateParamsIdentityBusinessDetailsIdNumber(TypedDict): class AccountUpdateParamsIdentityBusinessDetailsMonthlyEstimatedRevenue( TypedDict, ): - amount: NotRequired[ - "AccountUpdateParamsIdentityBusinessDetailsMonthlyEstimatedRevenueAmount" - ] + amount: NotRequired[AmountParam] """ A non-negative integer representing the amount in the smallest currency unit. """ -class AccountUpdateParamsIdentityBusinessDetailsMonthlyEstimatedRevenueAmount( - TypedDict, -): - value: int - """ - A non-negative integer representing how much to charge in the [smallest currency unit](https://docs.stripe.com/currencies#minor-units). - """ - 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). - """ - - class AccountUpdateParamsIdentityBusinessDetailsRegistrationDate(TypedDict): day: int """ diff --git a/stripe/params/v2/core/_batch_job_cancel_params.py b/stripe/params/v2/core/_batch_job_cancel_params.py new file mode 100644 index 000000000..2d03ba46c --- /dev/null +++ b/stripe/params/v2/core/_batch_job_cancel_params.py @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from typing_extensions import TypedDict + + +class BatchJobCancelParams(TypedDict): + pass diff --git a/stripe/params/v2/core/_batch_job_create_params.py b/stripe/params/v2/core/_batch_job_create_params.py new file mode 100644 index 000000000..c2899d618 --- /dev/null +++ b/stripe/params/v2/core/_batch_job_create_params.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from typing import Dict +from typing_extensions import Literal, NotRequired, TypedDict + + +class BatchJobCreateParams(TypedDict): + endpoint: "BatchJobCreateParamsEndpoint" + """ + The endpoint configuration for the batch job. + """ + maximum_rps: NotRequired[int] + """ + Optional field that allows the user to control how fast they want this batch job to run. + Gives them a control over the number of webhooks they receive. + """ + metadata: Dict[str, str] + """ + The metadata of the `BatchJob` object. + """ + notification_suppression: NotRequired[ + "BatchJobCreateParamsNotificationSuppression" + ] + """ + Notification suppression settings for the batch job. + """ + skip_validation: bool + """ + Allows the user to skip validation. + """ + + +class BatchJobCreateParamsEndpoint(TypedDict): + http_method: Literal["post"] + """ + The HTTP method to use when calling the endpoint. + """ + path: str + """ + The path of the endpoint to run this batch job against. + In the form used in the documentation. For instance, for + subscription migration this would be `/v1/subscriptions/:id/migrate`. + """ + + +class BatchJobCreateParamsNotificationSuppression(TypedDict): + scope: Literal["all", "none"] + """ + The scope of notification suppression. + """ diff --git a/stripe/params/v2/core/_batch_job_retrieve_params.py b/stripe/params/v2/core/_batch_job_retrieve_params.py new file mode 100644 index 000000000..a569ad464 --- /dev/null +++ b/stripe/params/v2/core/_batch_job_retrieve_params.py @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from typing_extensions import TypedDict + + +class BatchJobRetrieveParams(TypedDict): + pass diff --git a/stripe/params/v2/core/_event_destination_create_params.py b/stripe/params/v2/core/_event_destination_create_params.py index 63aee13ee..d74a2d187 100644 --- a/stripe/params/v2/core/_event_destination_create_params.py +++ b/stripe/params/v2/core/_event_destination_create_params.py @@ -17,9 +17,13 @@ class EventDestinationCreateParams(TypedDict): """ Payload type of events being subscribed to. """ - events_from: NotRequired[List[Literal["other_accounts", "self"]]] + events_from: NotRequired[List[str]] """ - Where events should be routed from. + Specifies which accounts' events route to this destination. + `@self`: Receive events from the account that owns the event destination. + `@accounts`: Receive events emitted from other accounts you manage which includes your v1 and v2 accounts. + `@organization_members`: Receive events from accounts directly linked to the organization. + `@organization_members/@accounts`: Receive events from all accounts connected to any platform accounts in the organization. """ include: NotRequired[ List[ @@ -41,7 +45,7 @@ class EventDestinationCreateParams(TypedDict): """ If using the snapshot event payload, the API version events are rendered as. """ - type: Literal["amazon_eventbridge", "webhook_endpoint"] + type: Literal["amazon_eventbridge", "azure_event_grid", "webhook_endpoint"] """ Event destination type. """ @@ -51,6 +55,10 @@ class EventDestinationCreateParams(TypedDict): """ Amazon EventBridge configuration. """ + azure_event_grid: NotRequired["EventDestinationCreateParamsAzureEventGrid"] + """ + Azure Event Grid configuration. + """ webhook_endpoint: NotRequired[ "EventDestinationCreateParamsWebhookEndpoint" ] @@ -70,6 +78,21 @@ class EventDestinationCreateParamsAmazonEventbridge(TypedDict): """ +class EventDestinationCreateParamsAzureEventGrid(TypedDict): + azure_region: str + """ + The Azure region. + """ + azure_resource_group_name: str + """ + The name of the Azure resource group. + """ + azure_subscription_id: str + """ + The Azure subscription ID. + """ + + class EventDestinationCreateParamsWebhookEndpoint(TypedDict): url: str """ diff --git a/stripe/params/v2/core/vault/_gb_bank_account_create_params.py b/stripe/params/v2/core/vault/_gb_bank_account_create_params.py index 9fc659bc2..da013f908 100644 --- a/stripe/params/v2/core/vault/_gb_bank_account_create_params.py +++ b/stripe/params/v2/core/vault/_gb_bank_account_create_params.py @@ -4,7 +4,7 @@ class GbBankAccountCreateParams(TypedDict): - account_number: str + account_number: NotRequired[str] """ The Account Number of the bank account. """ @@ -20,7 +20,15 @@ class GbBankAccountCreateParams(TypedDict): against what was provided by the bank. Doing so is required for all bank accounts not owned by you before making domestic UK OutboundPayments. """ - sort_code: str + currency: str + """ + The currency of the bank account. + """ + iban: NotRequired[str] + """ + The IBAN of the bank account. + """ + sort_code: NotRequired[str] """ The Sort Code of the bank account. """ diff --git a/stripe/params/v2/core/vault/_us_bank_account_create_params.py b/stripe/params/v2/core/vault/_us_bank_account_create_params.py index b319c3f32..2f9137510 100644 --- a/stripe/params/v2/core/vault/_us_bank_account_create_params.py +++ b/stripe/params/v2/core/vault/_us_bank_account_create_params.py @@ -12,6 +12,10 @@ class UsBankAccountCreateParams(TypedDict): """ Closed Enum. The type of the bank account (checking or savings). """ + currency: str + """ + The currency of the bank account. + """ fedwire_routing_number: NotRequired[str] """ The fedwire routing number of the bank account. Note that certain banks have the same ACH and wire routing number. diff --git a/stripe/params/v2/money_management/__init__.py b/stripe/params/v2/money_management/__init__.py index dc9dc1c1e..f8dd9ccf7 100644 --- a/stripe/params/v2/money_management/__init__.py +++ b/stripe/params/v2/money_management/__init__.py @@ -38,7 +38,6 @@ ) from stripe.params.v2.money_management._inbound_transfer_create_params import ( InboundTransferCreateParams as InboundTransferCreateParams, - InboundTransferCreateParamsAmount as InboundTransferCreateParamsAmount, InboundTransferCreateParamsFrom as InboundTransferCreateParamsFrom, InboundTransferCreateParamsTo as InboundTransferCreateParamsTo, ) @@ -53,7 +52,6 @@ ) from stripe.params.v2.money_management._outbound_payment_create_params import ( OutboundPaymentCreateParams as OutboundPaymentCreateParams, - OutboundPaymentCreateParamsAmount as OutboundPaymentCreateParamsAmount, OutboundPaymentCreateParamsDeliveryOptions as OutboundPaymentCreateParamsDeliveryOptions, OutboundPaymentCreateParamsFrom as OutboundPaymentCreateParamsFrom, OutboundPaymentCreateParamsRecipientNotification as OutboundPaymentCreateParamsRecipientNotification, @@ -64,7 +62,6 @@ ) from stripe.params.v2.money_management._outbound_payment_quote_create_params import ( OutboundPaymentQuoteCreateParams as OutboundPaymentQuoteCreateParams, - OutboundPaymentQuoteCreateParamsAmount as OutboundPaymentQuoteCreateParamsAmount, OutboundPaymentQuoteCreateParamsDeliveryOptions as OutboundPaymentQuoteCreateParamsDeliveryOptions, OutboundPaymentQuoteCreateParamsFrom as OutboundPaymentQuoteCreateParamsFrom, OutboundPaymentQuoteCreateParamsTo as OutboundPaymentQuoteCreateParamsTo, @@ -101,7 +98,6 @@ ) from stripe.params.v2.money_management._outbound_transfer_create_params import ( OutboundTransferCreateParams as OutboundTransferCreateParams, - OutboundTransferCreateParamsAmount as OutboundTransferCreateParamsAmount, OutboundTransferCreateParamsDeliveryOptions as OutboundTransferCreateParamsDeliveryOptions, OutboundTransferCreateParamsFrom as OutboundTransferCreateParamsFrom, OutboundTransferCreateParamsTo as OutboundTransferCreateParamsTo, @@ -207,10 +203,6 @@ "stripe.params.v2.money_management._inbound_transfer_create_params", False, ), - "InboundTransferCreateParamsAmount": ( - "stripe.params.v2.money_management._inbound_transfer_create_params", - False, - ), "InboundTransferCreateParamsFrom": ( "stripe.params.v2.money_management._inbound_transfer_create_params", False, @@ -235,10 +227,6 @@ "stripe.params.v2.money_management._outbound_payment_create_params", False, ), - "OutboundPaymentCreateParamsAmount": ( - "stripe.params.v2.money_management._outbound_payment_create_params", - False, - ), "OutboundPaymentCreateParamsDeliveryOptions": ( "stripe.params.v2.money_management._outbound_payment_create_params", False, @@ -263,10 +251,6 @@ "stripe.params.v2.money_management._outbound_payment_quote_create_params", False, ), - "OutboundPaymentQuoteCreateParamsAmount": ( - "stripe.params.v2.money_management._outbound_payment_quote_create_params", - False, - ), "OutboundPaymentQuoteCreateParamsDeliveryOptions": ( "stripe.params.v2.money_management._outbound_payment_quote_create_params", False, @@ -339,10 +323,6 @@ "stripe.params.v2.money_management._outbound_transfer_create_params", False, ), - "OutboundTransferCreateParamsAmount": ( - "stripe.params.v2.money_management._outbound_transfer_create_params", - False, - ), "OutboundTransferCreateParamsDeliveryOptions": ( "stripe.params.v2.money_management._outbound_transfer_create_params", False, diff --git a/stripe/params/v2/money_management/_inbound_transfer_create_params.py b/stripe/params/v2/money_management/_inbound_transfer_create_params.py index 715086b0e..db5250ed2 100644 --- a/stripe/params/v2/money_management/_inbound_transfer_create_params.py +++ b/stripe/params/v2/money_management/_inbound_transfer_create_params.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec +from stripe.v2._amount import AmountParam from typing_extensions import NotRequired, TypedDict _InboundTransferCreateParamsBase = TypedDict( @@ -9,7 +10,7 @@ class InboundTransferCreateParams(_InboundTransferCreateParamsBase): - amount: "InboundTransferCreateParamsAmount" + amount: AmountParam """ The amount, in specified currency, by which the FinancialAccount balance will increase due to the InboundTransfer. """ @@ -23,17 +24,6 @@ class InboundTransferCreateParams(_InboundTransferCreateParamsBase): """ -class InboundTransferCreateParamsAmount(TypedDict): - value: int - """ - A non-negative integer representing how much to charge in the [smallest currency unit](https://docs.stripe.com/currencies#minor-units). - """ - 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). - """ - - class InboundTransferCreateParamsFrom(TypedDict): currency: NotRequired[str] """ 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 91dc6d4b6..6916f08dd 100644 --- a/stripe/params/v2/money_management/_outbound_payment_create_params.py +++ b/stripe/params/v2/money_management/_outbound_payment_create_params.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec +from stripe.v2._amount import AmountParam from typing import Dict from typing_extensions import Literal, NotRequired, TypedDict @@ -10,7 +11,7 @@ class OutboundPaymentCreateParams(_OutboundPaymentCreateParamsBase): - amount: "OutboundPaymentCreateParamsAmount" + amount: AmountParam """ The "presentment amount" to be sent to the recipient. """ @@ -46,17 +47,6 @@ class OutboundPaymentCreateParams(_OutboundPaymentCreateParamsBase): """ -class OutboundPaymentCreateParamsAmount(TypedDict): - value: int - """ - A non-negative integer representing how much to charge in the [smallest currency unit](https://docs.stripe.com/currencies#minor-units). - """ - 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). - """ - - class OutboundPaymentCreateParamsDeliveryOptions(TypedDict): bank_account: NotRequired[Literal["automatic", "local", "wire"]] """ 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 00b9bc002..dda1272cd 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 @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec +from stripe.v2._amount import AmountParam from typing_extensions import Literal, NotRequired, TypedDict _OutboundPaymentQuoteCreateParamsBase = TypedDict( @@ -9,7 +10,7 @@ class OutboundPaymentQuoteCreateParams(_OutboundPaymentQuoteCreateParamsBase): - amount: "OutboundPaymentQuoteCreateParamsAmount" + amount: AmountParam """ The "presentment amount" to be sent to the recipient. """ @@ -25,17 +26,6 @@ class OutboundPaymentQuoteCreateParams(_OutboundPaymentQuoteCreateParamsBase): """ -class OutboundPaymentQuoteCreateParamsAmount(TypedDict): - value: int - """ - A non-negative integer representing how much to charge in the [smallest currency unit](https://docs.stripe.com/currencies#minor-units). - """ - 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). - """ - - class OutboundPaymentQuoteCreateParamsDeliveryOptions(TypedDict): bank_account: NotRequired[Literal["automatic", "local", "wire"]] """ diff --git a/stripe/params/v2/money_management/_outbound_setup_intent_create_params.py b/stripe/params/v2/money_management/_outbound_setup_intent_create_params.py index f71e18773..4fac71174 100644 --- a/stripe/params/v2/money_management/_outbound_setup_intent_create_params.py +++ b/stripe/params/v2/money_management/_outbound_setup_intent_create_params.py @@ -57,6 +57,10 @@ class OutboundSetupIntentCreateParamsPayoutMethodDataBankAccount(TypedDict): """ The country code of the bank account. """ + currency: str + """ + The currency of the bank account. + """ routing_number: NotRequired[str] """ The routing number of the bank account, if present. @@ -68,6 +72,10 @@ class OutboundSetupIntentCreateParamsPayoutMethodDataBankAccount(TypedDict): class OutboundSetupIntentCreateParamsPayoutMethodDataCard(TypedDict): + currency: str + """ + The currency of the card. + """ exp_month: str """ The expiration month of the card. diff --git a/stripe/params/v2/money_management/_outbound_setup_intent_update_params.py b/stripe/params/v2/money_management/_outbound_setup_intent_update_params.py index ab465e10f..395351972 100644 --- a/stripe/params/v2/money_management/_outbound_setup_intent_update_params.py +++ b/stripe/params/v2/money_management/_outbound_setup_intent_update_params.py @@ -51,6 +51,10 @@ class OutboundSetupIntentUpdateParamsPayoutMethodDataBankAccount(TypedDict): """ The country code of the bank account. """ + currency: str + """ + The currency of the bank account. + """ routing_number: NotRequired[str] """ The routing number of the bank account, if present. @@ -62,6 +66,10 @@ class OutboundSetupIntentUpdateParamsPayoutMethodDataBankAccount(TypedDict): class OutboundSetupIntentUpdateParamsPayoutMethodDataCard(TypedDict): + currency: NotRequired[str] + """ + The currency of the card. + """ exp_month: NotRequired[str] """ The expiration month of the card. diff --git a/stripe/params/v2/money_management/_outbound_transfer_create_params.py b/stripe/params/v2/money_management/_outbound_transfer_create_params.py index 3893e711d..5955628f4 100644 --- a/stripe/params/v2/money_management/_outbound_transfer_create_params.py +++ b/stripe/params/v2/money_management/_outbound_transfer_create_params.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec +from stripe.v2._amount import AmountParam from typing import Dict from typing_extensions import Literal, NotRequired, TypedDict @@ -10,7 +11,7 @@ class OutboundTransferCreateParams(_OutboundTransferCreateParamsBase): - amount: "OutboundTransferCreateParamsAmount" + amount: AmountParam """ The "presentment amount" for the OutboundPayment. """ @@ -34,17 +35,6 @@ class OutboundTransferCreateParams(_OutboundTransferCreateParamsBase): """ -class OutboundTransferCreateParamsAmount(TypedDict): - value: int - """ - A non-negative integer representing how much to charge in the [smallest currency unit](https://docs.stripe.com/currencies#minor-units). - """ - 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). - """ - - class OutboundTransferCreateParamsDeliveryOptions(TypedDict): bank_account: NotRequired[Literal["automatic", "local", "wire"]] """ diff --git a/stripe/params/v2/test_helpers/__init__.py b/stripe/params/v2/test_helpers/__init__.py index 9a48a10c7..07c7ea915 100644 --- a/stripe/params/v2/test_helpers/__init__.py +++ b/stripe/params/v2/test_helpers/__init__.py @@ -6,7 +6,6 @@ if TYPE_CHECKING: from stripe.params.v2.test_helpers._financial_address_credit_params import ( FinancialAddressCreditParams as FinancialAddressCreditParams, - FinancialAddressCreditParamsAmount as FinancialAddressCreditParamsAmount, ) from stripe.params.v2.test_helpers._financial_address_generate_microdeposits_params import ( FinancialAddressGenerateMicrodepositsParams as FinancialAddressGenerateMicrodepositsParams, @@ -18,10 +17,6 @@ "stripe.params.v2.test_helpers._financial_address_credit_params", False, ), - "FinancialAddressCreditParamsAmount": ( - "stripe.params.v2.test_helpers._financial_address_credit_params", - False, - ), "FinancialAddressGenerateMicrodepositsParams": ( "stripe.params.v2.test_helpers._financial_address_generate_microdeposits_params", False, diff --git a/stripe/params/v2/test_helpers/_financial_address_credit_params.py b/stripe/params/v2/test_helpers/_financial_address_credit_params.py index 8ebebb0e8..99625b139 100644 --- a/stripe/params/v2/test_helpers/_financial_address_credit_params.py +++ b/stripe/params/v2/test_helpers/_financial_address_credit_params.py @@ -1,10 +1,11 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec +from stripe.v2._amount import AmountParam from typing_extensions import Literal, NotRequired, TypedDict class FinancialAddressCreditParams(TypedDict): - amount: "FinancialAddressCreditParamsAmount" + amount: AmountParam """ Object containing the amount value and currency to credit. """ @@ -16,14 +17,3 @@ class FinancialAddressCreditParams(TypedDict): """ String explaining funds flow. Use this field to populate the statement descriptor of the ReceivedCredit created as an eventual result of this simulation. """ - - -class FinancialAddressCreditParamsAmount(TypedDict): - value: int - """ - A non-negative integer representing how much to charge in the [smallest currency unit](https://docs.stripe.com/currencies#minor-units). - """ - 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). - """ diff --git a/stripe/privacy/_redaction_job.py b/stripe/privacy/_redaction_job.py index 33ed842cb..e338657d9 100644 --- a/stripe/privacy/_redaction_job.py +++ b/stripe/privacy/_redaction_job.py @@ -105,7 +105,7 @@ class Objects(StripeObject): """ livemode: bool """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ object: Literal["privacy.redaction_job"] """ @@ -190,7 +190,7 @@ def cancel( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/privacy/redaction_jobs/{job}/cancel".format( - job=sanitize_id(self.get("id")) + job=sanitize_id(self._data.get("id")) ), params=params, ), @@ -253,7 +253,7 @@ async def cancel_async( # pyright: ignore[reportGeneralTypeIssues] await self._request_async( "post", "/v1/privacy/redaction_jobs/{job}/cancel".format( - job=sanitize_id(self.get("id")) + job=sanitize_id(self._data.get("id")) ), params=params, ), @@ -454,7 +454,7 @@ def run( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/privacy/redaction_jobs/{job}/run".format( - job=sanitize_id(self.get("id")) + job=sanitize_id(self._data.get("id")) ), params=params, ), @@ -525,7 +525,7 @@ async def run_async( # pyright: ignore[reportGeneralTypeIssues] await self._request_async( "post", "/v1/privacy/redaction_jobs/{job}/run".format( - job=sanitize_id(self.get("id")) + job=sanitize_id(self._data.get("id")) ), params=params, ), @@ -596,7 +596,7 @@ def validate( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/privacy/redaction_jobs/{job}/validate".format( - job=sanitize_id(self.get("id")) + job=sanitize_id(self._data.get("id")) ), params=params, ), @@ -667,7 +667,7 @@ async def validate_async( # pyright: ignore[reportGeneralTypeIssues] await self._request_async( "post", "/v1/privacy/redaction_jobs/{job}/validate".format( - job=sanitize_id(self.get("id")) + job=sanitize_id(self._data.get("id")) ), params=params, ), diff --git a/stripe/product_catalog/__init__.py b/stripe/product_catalog/__init__.py new file mode 100644 index 000000000..e9169be92 --- /dev/null +++ b/stripe/product_catalog/__init__.py @@ -0,0 +1,34 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from importlib import import_module +from typing_extensions import TYPE_CHECKING + +if TYPE_CHECKING: + from stripe.product_catalog._trial_offer import TrialOffer as TrialOffer + from stripe.product_catalog._trial_offer_service import ( + TrialOfferService as TrialOfferService, + ) + +# name -> (import_target, is_submodule) +_import_map = { + "TrialOffer": ("stripe.product_catalog._trial_offer", False), + "TrialOfferService": ( + "stripe.product_catalog._trial_offer_service", + False, + ), +} +if not TYPE_CHECKING: + + def __getattr__(name): + try: + target, is_submodule = _import_map[name] + module = import_module(target) + if is_submodule: + return module + + return getattr( + module, + name, + ) + except KeyError: + raise AttributeError() diff --git a/stripe/product_catalog/_trial_offer.py b/stripe/product_catalog/_trial_offer.py new file mode 100644 index 000000000..40253cfe5 --- /dev/null +++ b/stripe/product_catalog/_trial_offer.py @@ -0,0 +1,109 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._createable_api_resource import CreateableAPIResource +from stripe._expandable_field import ExpandableField +from stripe._stripe_object import StripeObject +from typing import ClassVar, Optional, cast +from typing_extensions import Literal, Unpack, TYPE_CHECKING + +if TYPE_CHECKING: + from stripe._price import Price + from stripe.params.product_catalog._trial_offer_create_params import ( + TrialOfferCreateParams, + ) + + +class TrialOffer(CreateableAPIResource["TrialOffer"]): + """ + Resource for the TrialOffer API, used to describe a subscription item's trial period settings. + Renders a TrialOffer object that describes the price, duration, end_behavior of a trial offer. + """ + + OBJECT_NAME: ClassVar[Literal["product_catalog.trial_offer"]] = ( + "product_catalog.trial_offer" + ) + + class Duration(StripeObject): + class Relative(StripeObject): + iterations: int + """ + The number of iterations of the price's interval for this trial offer. + """ + + relative: Optional[Relative] + type: Literal["relative", "timestamp"] + """ + The type of trial offer duration. + """ + _inner_class_types = {"relative": Relative} + + class EndBehavior(StripeObject): + class Transition(StripeObject): + price: str + """ + The new price to use at the end of the trial offer period. + """ + + transition: Transition + type: Literal["transition"] + """ + The type of behavior when the trial offer ends. + """ + _inner_class_types = {"transition": Transition} + + duration: Duration + end_behavior: EndBehavior + 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`. + """ + name: Optional[str] + """ + A brief, user-friendly name for the trial offer-for identification purposes. + """ + object: Literal["product_catalog.trial_offer"] + """ + String representing the object's type. Objects of the same type share the same value. + """ + price: ExpandableField["Price"] + """ + The price during the trial offer. + """ + + @classmethod + def create( + cls, **params: Unpack["TrialOfferCreateParams"] + ) -> "TrialOffer": + """ + Creates a trial offer. + """ + return cast( + "TrialOffer", + cls._static_request( + "post", + cls.class_url(), + params=params, + ), + ) + + @classmethod + async def create_async( + cls, **params: Unpack["TrialOfferCreateParams"] + ) -> "TrialOffer": + """ + Creates a trial offer. + """ + return cast( + "TrialOffer", + await cls._static_request_async( + "post", + cls.class_url(), + params=params, + ), + ) + + _inner_class_types = {"duration": Duration, "end_behavior": EndBehavior} diff --git a/stripe/product_catalog/_trial_offer_service.py b/stripe/product_catalog/_trial_offer_service.py new file mode 100644 index 000000000..21086018e --- /dev/null +++ b/stripe/product_catalog/_trial_offer_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.product_catalog._trial_offer_create_params import ( + TrialOfferCreateParams, + ) + from stripe.product_catalog._trial_offer import TrialOffer + + +class TrialOfferService(StripeService): + def create( + self, + params: "TrialOfferCreateParams", + options: Optional["RequestOptions"] = None, + ) -> "TrialOffer": + """ + Creates a trial offer. + """ + return cast( + "TrialOffer", + self._request( + "post", + "/v1/product_catalog/trial_offers", + base_address="api", + params=params, + options=options, + ), + ) + + async def create_async( + self, + params: "TrialOfferCreateParams", + options: Optional["RequestOptions"] = None, + ) -> "TrialOffer": + """ + Creates a trial offer. + """ + return cast( + "TrialOffer", + await self._request_async( + "post", + "/v1/product_catalog/trial_offers", + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/radar/_early_fraud_warning.py b/stripe/radar/_early_fraud_warning.py index 63defa05f..81c6af07e 100644 --- a/stripe/radar/_early_fraud_warning.py +++ b/stripe/radar/_early_fraud_warning.py @@ -50,7 +50,7 @@ class EarlyFraudWarning(ListableAPIResource["EarlyFraudWarning"]): """ livemode: bool """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ object: Literal["radar.early_fraud_warning"] """ diff --git a/stripe/radar/_payment_evaluation.py b/stripe/radar/_payment_evaluation.py index d64a2ecba..6b976347d 100644 --- a/stripe/radar/_payment_evaluation.py +++ b/stripe/radar/_payment_evaluation.py @@ -177,27 +177,6 @@ class UserInterventionResolved(StripeObject): "user_intervention_resolved": UserInterventionResolved, } - class Insights(StripeObject): - class FraudulentDispute(StripeObject): - recommended_action: Literal["block", "continue"] - """ - Recommended action based on the risk score. Possible values are `block` and `continue`. - """ - risk_score: int - """ - Stripe Radar's evaluation of the risk level of the payment. Possible values for evaluated payments are between 0 and 100, with higher scores indicating higher risk. - """ - - evaluated_at: int - """ - The timestamp when the evaluation was performed. - """ - fraudulent_dispute: FraudulentDispute - """ - Scores, insights and recommended action for one scorer for this PaymentEvaluation. - """ - _inner_class_types = {"fraudulent_dispute": FraudulentDispute} - class Outcome(StripeObject): class MerchantBlocked(StripeObject): reason: Literal[ @@ -466,6 +445,27 @@ class Address(StripeObject): "shipping_details": ShippingDetails, } + class Signals(StripeObject): + class FraudulentPayment(StripeObject): + evaluated_at: int + """ + The time when this signal was evaluated. + """ + risk_level: Literal["elevated", "highest", "normal"] + """ + Risk level of this signal, based on the score. + """ + score: float + """ + Score for this insight. Possible values for evaluated payments are -1 and any value between 0 and 100. The value is returned with two decimal places. A score of -1 indicates a test integration and higher scores indicate a higher likelihood of the signal being true. + """ + + fraudulent_payment: FraudulentPayment + """ + A payment evaluation signal with evaluated_at, risk_level, and score fields. + """ + _inner_class_types = {"fraudulent_payment": FraudulentPayment} + client_device_metadata_details: Optional[ClientDeviceMetadataDetails] """ Client device metadata attached to this payment evaluation. @@ -486,13 +486,9 @@ class Address(StripeObject): """ Unique identifier for the object. """ - insights: Insights - """ - Collection of scores and insights for this payment evaluation. - """ livemode: bool """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ metadata: Optional[Dict[str, str]] """ @@ -510,6 +506,14 @@ class Address(StripeObject): """ Payment details attached to this payment evaluation. """ + recommended_action: Literal["block", "continue"] + """ + Recommended action based on the score of the fraudulent_payment signal. Possible values are `block` and `continue`. + """ + signals: Signals + """ + Collection of signals for this payment evaluation. + """ @classmethod def create( @@ -547,7 +551,7 @@ async def create_async( "client_device_metadata_details": ClientDeviceMetadataDetails, "customer_details": CustomerDetails, "events": Event, - "insights": Insights, "outcome": Outcome, "payment_details": PaymentDetails, + "signals": Signals, } diff --git a/stripe/radar/_value_list.py b/stripe/radar/_value_list.py index 6192c53d5..bc4521b6a 100644 --- a/stripe/radar/_value_list.py +++ b/stripe/radar/_value_list.py @@ -64,6 +64,7 @@ class ValueList( "card_fingerprint", "case_sensitive_string", "country", + "crypto_fingerprint", "customer_id", "email", "ip_address", @@ -72,7 +73,7 @@ class ValueList( "us_bank_account_fingerprint", ] """ - The type of items in the value list. One of `card_fingerprint`, `card_bin`, `email`, `ip_address`, `country`, `string`, `case_sensitive_string`, `customer_id`, `sepa_debit_fingerprint`, or `us_bank_account_fingerprint`. + The type of items in the value list. One of `card_fingerprint`, `card_bin`, `crypto_fingerprint`, `email`, `ip_address`, `country`, `string`, `case_sensitive_string`, `customer_id`, `sepa_debit_fingerprint`, or `us_bank_account_fingerprint`. """ list_items: ListObject["ValueListItem"] """ @@ -80,7 +81,7 @@ class ValueList( """ livemode: bool """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ metadata: Dict[str, str] """ diff --git a/stripe/radar/_value_list_item.py b/stripe/radar/_value_list_item.py index 8c680a31b..b9010a26c 100644 --- a/stripe/radar/_value_list_item.py +++ b/stripe/radar/_value_list_item.py @@ -55,7 +55,7 @@ class ValueListItem( """ livemode: bool """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ object: Literal["radar.value_list_item"] """ diff --git a/stripe/reporting/_report_type.py b/stripe/reporting/_report_type.py index 1cf2a57f2..9b0c487a4 100644 --- a/stripe/reporting/_report_type.py +++ b/stripe/reporting/_report_type.py @@ -47,7 +47,7 @@ class ReportType(ListableAPIResource["ReportType"]): """ livemode: bool """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ name: str """ diff --git a/stripe/reserve/_hold.py b/stripe/reserve/_hold.py index bb2a5ac67..1e803bb87 100644 --- a/stripe/reserve/_hold.py +++ b/stripe/reserve/_hold.py @@ -61,7 +61,7 @@ class ReleaseSchedule(StripeObject): """ livemode: bool """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ metadata: Optional[Dict[str, str]] """ diff --git a/stripe/reserve/_plan.py b/stripe/reserve/_plan.py index fefe87453..0b2b47d37 100644 --- a/stripe/reserve/_plan.py +++ b/stripe/reserve/_plan.py @@ -59,7 +59,7 @@ class RollingRelease(StripeObject): """ livemode: bool """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ metadata: Optional[Dict[str, str]] """ diff --git a/stripe/reserve/_release.py b/stripe/reserve/_release.py index e82474628..4c8f55ca4 100644 --- a/stripe/reserve/_release.py +++ b/stripe/reserve/_release.py @@ -61,7 +61,7 @@ class SourceTransaction(StripeObject): """ livemode: bool """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ metadata: Optional[Dict[str, str]] """ diff --git a/stripe/sigma/_scheduled_query_run.py b/stripe/sigma/_scheduled_query_run.py index 29cae6df0..00e1460bd 100644 --- a/stripe/sigma/_scheduled_query_run.py +++ b/stripe/sigma/_scheduled_query_run.py @@ -53,7 +53,7 @@ class Error(StripeObject): """ livemode: bool """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ object: Literal["scheduled_query_run"] """ diff --git a/stripe/tax/__init__.py b/stripe/tax/__init__.py index f820b52f4..43c706c5e 100644 --- a/stripe/tax/__init__.py +++ b/stripe/tax/__init__.py @@ -20,6 +20,8 @@ ) from stripe.tax._form import Form as Form from stripe.tax._form_service import FormService as FormService + from stripe.tax._location import Location as Location + from stripe.tax._location_service import LocationService as LocationService from stripe.tax._registration import Registration as Registration from stripe.tax._registration_service import ( RegistrationService as RegistrationService, @@ -50,6 +52,8 @@ "CalculationService": ("stripe.tax._calculation_service", False), "Form": ("stripe.tax._form", False), "FormService": ("stripe.tax._form_service", False), + "Location": ("stripe.tax._location", False), + "LocationService": ("stripe.tax._location_service", False), "Registration": ("stripe.tax._registration", False), "RegistrationService": ("stripe.tax._registration_service", False), "Settings": ("stripe.tax._settings", False), diff --git a/stripe/tax/_calculation.py b/stripe/tax/_calculation.py index 344fdfe23..e404e2e70 100644 --- a/stripe/tax/_calculation.py +++ b/stripe/tax/_calculation.py @@ -266,19 +266,27 @@ class TaxRateDetails(StripeObject): The tax rate percentage as a string. For example, 8.5% is represented as "8.5". """ tax_type: Literal[ + "admissions_tax", "amusement_tax", + "attendance_tax", "communications_tax", + "entertainment_tax", + "gross_receipts_tax", "gst", + "hospitality_tax", "hst", "igst", "jct", "lease_tax", + "luxury_tax", "pst", "qst", + "resort_tax", "retail_delivery_fee", "rst", "sales_tax", "service_tax", + "tourism_tax", "vat", ] """ @@ -287,10 +295,10 @@ class TaxRateDetails(StripeObject): amount: int """ - The amount of tax, in the [smallest currency unit](https://docs.stripe.com/currencies#zero-decimal). + The amount of tax, in the [smallest currency unit](https://docs.stripe.com/currencies#minor-units). """ jurisdiction: Jurisdiction - sourcing: Literal["destination", "origin"] + sourcing: Literal["destination", "origin", "performance"] """ Indicates whether the jurisdiction was determined by the origin (merchant's address) or destination (customer's address). """ @@ -320,7 +328,7 @@ class TaxRateDetails(StripeObject): """ taxable_amount: int """ - The amount on which tax is calculated, in the [smallest currency unit](https://docs.stripe.com/currencies#zero-decimal). + The amount on which tax is calculated, in the [smallest currency unit](https://docs.stripe.com/currencies#minor-units). """ _inner_class_types = { "jurisdiction": Jurisdiction, @@ -329,11 +337,11 @@ class TaxRateDetails(StripeObject): amount: int """ - The shipping amount in the [smallest currency unit](https://docs.stripe.com/currencies#zero-decimal). If `tax_behavior=inclusive`, then this amount includes taxes. Otherwise, taxes were calculated on top of this amount. + The shipping amount in the [smallest currency unit](https://docs.stripe.com/currencies#minor-units). If `tax_behavior=inclusive`, then this amount includes taxes. Otherwise, taxes were calculated on top of this amount. """ amount_tax: int """ - The amount of tax calculated for shipping, in the [smallest currency unit](https://docs.stripe.com/currencies#zero-decimal). + The amount of tax calculated for shipping, in the [smallest currency unit](https://docs.stripe.com/currencies#minor-units). """ shipping_rate: Optional[str] """ @@ -387,19 +395,27 @@ class FlatAmount(StripeObject): """ tax_type: Optional[ Literal[ + "admissions_tax", "amusement_tax", + "attendance_tax", "communications_tax", + "entertainment_tax", + "gross_receipts_tax", "gst", + "hospitality_tax", "hst", "igst", "jct", "lease_tax", + "luxury_tax", "pst", "qst", + "resort_tax", "retail_delivery_fee", "rst", "sales_tax", "service_tax", + "tourism_tax", "vat", ] ] @@ -410,7 +426,7 @@ class FlatAmount(StripeObject): amount: int """ - The amount of tax, in the [smallest currency unit](https://docs.stripe.com/currencies#zero-decimal). + The amount of tax, in the [smallest currency unit](https://docs.stripe.com/currencies#minor-units). """ inclusive: bool """ @@ -439,13 +455,13 @@ class FlatAmount(StripeObject): """ taxable_amount: int """ - The amount on which tax is calculated, in the [smallest currency unit](https://docs.stripe.com/currencies#zero-decimal). + The amount on which tax is calculated, in the [smallest currency unit](https://docs.stripe.com/currencies#minor-units). """ _inner_class_types = {"tax_rate_details": TaxRateDetails} amount_total: int """ - Total amount after taxes in the [smallest currency unit](https://docs.stripe.com/currencies#zero-decimal). + Total amount after taxes in the [smallest currency unit](https://docs.stripe.com/currencies#minor-units). """ currency: str """ @@ -470,7 +486,7 @@ class FlatAmount(StripeObject): """ livemode: bool """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ object: Literal["tax.calculation"] """ @@ -584,7 +600,7 @@ def list_line_items( # pyright: ignore[reportGeneralTypeIssues] self._request( "get", "/v1/tax/calculations/{calculation}/line_items".format( - calculation=sanitize_id(self.get("id")) + calculation=sanitize_id(self._data.get("id")) ), params=params, ), @@ -641,7 +657,7 @@ async def list_line_items_async( # pyright: ignore[reportGeneralTypeIssues] await self._request_async( "get", "/v1/tax/calculations/{calculation}/line_items".format( - calculation=sanitize_id(self.get("id")) + calculation=sanitize_id(self._data.get("id")) ), params=params, ), diff --git a/stripe/tax/_calculation_line_item.py b/stripe/tax/_calculation_line_item.py index 702b039e6..eba66eb18 100644 --- a/stripe/tax/_calculation_line_item.py +++ b/stripe/tax/_calculation_line_item.py @@ -39,19 +39,27 @@ class TaxRateDetails(StripeObject): The tax rate percentage as a string. For example, 8.5% is represented as "8.5". """ tax_type: Literal[ + "admissions_tax", "amusement_tax", + "attendance_tax", "communications_tax", + "entertainment_tax", + "gross_receipts_tax", "gst", + "hospitality_tax", "hst", "igst", "jct", "lease_tax", + "luxury_tax", "pst", "qst", + "resort_tax", "retail_delivery_fee", "rst", "sales_tax", "service_tax", + "tourism_tax", "vat", ] """ @@ -60,10 +68,10 @@ class TaxRateDetails(StripeObject): amount: int """ - The amount of tax, in the [smallest currency unit](https://docs.stripe.com/currencies#zero-decimal). + The amount of tax, in the [smallest currency unit](https://docs.stripe.com/currencies#minor-units). """ jurisdiction: Jurisdiction - sourcing: Literal["destination", "origin"] + sourcing: Literal["destination", "origin", "performance"] """ Indicates whether the jurisdiction was determined by the origin (merchant's address) or destination (customer's address). """ @@ -93,7 +101,7 @@ class TaxRateDetails(StripeObject): """ taxable_amount: int """ - The amount on which tax is calculated, in the [smallest currency unit](https://docs.stripe.com/currencies#zero-decimal). + The amount on which tax is calculated, in the [smallest currency unit](https://docs.stripe.com/currencies#minor-units). """ _inner_class_types = { "jurisdiction": Jurisdiction, @@ -102,11 +110,11 @@ class TaxRateDetails(StripeObject): amount: int """ - The line item amount in the [smallest currency unit](https://docs.stripe.com/currencies#zero-decimal). If `tax_behavior=inclusive`, then this amount includes taxes. Otherwise, taxes were calculated on top of this amount. + The line item amount in the [smallest currency unit](https://docs.stripe.com/currencies#minor-units). If `tax_behavior=inclusive`, then this amount includes taxes. Otherwise, taxes were calculated on top of this amount. """ amount_tax: int """ - The amount of tax calculated for this line item, in the [smallest currency unit](https://docs.stripe.com/currencies#zero-decimal). + The amount of tax calculated for this line item, in the [smallest currency unit](https://docs.stripe.com/currencies#minor-units). """ id: str """ @@ -114,7 +122,7 @@ class TaxRateDetails(StripeObject): """ livemode: bool """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ metadata: Optional[Dict[str, str]] """ @@ -124,6 +132,10 @@ class TaxRateDetails(StripeObject): """ String representing the object's type. Objects of the same type share the same value. """ + performance_location: Optional[str] + """ + Indicates the line item represents a performance where the venue location might determine the tax, not the customer address. Leave empty if the tax code doesn't require a tax location. If you provide this value for tax codes with an `optional` location requirement, it overrides the customer address. + """ product: Optional[str] """ The ID of an existing [Product](https://docs.stripe.com/api/products/object). diff --git a/stripe/tax/_form.py b/stripe/tax/_form.py index f00726af7..c96db9566 100644 --- a/stripe/tax/_form.py +++ b/stripe/tax/_form.py @@ -154,7 +154,7 @@ class Us1099Nec(StripeObject): """ livemode: bool """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ nz_mrdp: Optional[NzMrdp] object: Literal["tax.form"] @@ -259,7 +259,7 @@ def pdf( # pyright: ignore[reportGeneralTypeIssues] self._request_stream( "get", "/v1/tax/forms/{id}/pdf".format( - id=sanitize_id(self.get("id")) + id=sanitize_id(self._data.get("id")) ), params=params, base_address="files", @@ -310,7 +310,7 @@ async def pdf_async( # pyright: ignore[reportGeneralTypeIssues] await self._request_stream_async( "get", "/v1/tax/forms/{id}/pdf".format( - id=sanitize_id(self.get("id")) + id=sanitize_id(self._data.get("id")) ), params=params, base_address="files", diff --git a/stripe/tax/_location.py b/stripe/tax/_location.py new file mode 100644 index 000000000..1fda99425 --- /dev/null +++ b/stripe/tax/_location.py @@ -0,0 +1,172 @@ +# -*- 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, cast +from typing_extensions import Literal, Unpack, TYPE_CHECKING + +if TYPE_CHECKING: + from stripe.params.tax._location_create_params import LocationCreateParams + from stripe.params.tax._location_list_params import LocationListParams + from stripe.params.tax._location_retrieve_params import ( + LocationRetrieveParams, + ) + + +class Location( + CreateableAPIResource["Location"], + ListableAPIResource["Location"], +): + """ + Tax locations represent venues for services, tickets, or other product types. + """ + + OBJECT_NAME: ClassVar[Literal["tax.location"]] = "tax.location" + + 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 + description: Optional[str] + """ + A descriptive text providing additional context about the tax location. This can include information about the venue, types of events held, services available, or any relevant details for better identification (e.g., "A spacious auditorium suitable for large concerts and events."). + """ + id: str + """ + Unique identifier for the object. + """ + object: Literal["tax.location"] + """ + String representing the object's type. Objects of the same type share the same value. + """ + type: Literal["performance"] + """ + The type of tax location to be defined. Currently the only option is `performance`. + """ + + @classmethod + def create(cls, **params: Unpack["LocationCreateParams"]) -> "Location": + """ + Create a tax location to use in calculating taxes for a service, ticket, or other type of product. The resulting object contains the id, address, name, description, and current operational status of the tax location. + """ + return cast( + "Location", + cls._static_request( + "post", + cls.class_url(), + params=params, + ), + ) + + @classmethod + async def create_async( + cls, **params: Unpack["LocationCreateParams"] + ) -> "Location": + """ + Create a tax location to use in calculating taxes for a service, ticket, or other type of product. The resulting object contains the id, address, name, description, and current operational status of the tax location. + """ + return cast( + "Location", + await cls._static_request_async( + "post", + cls.class_url(), + params=params, + ), + ) + + @classmethod + def list( + cls, **params: Unpack["LocationListParams"] + ) -> ListObject["Location"]: + """ + Retrieve a list of all tax locations. Tax locations can represent the venues for services, tickets, or other product types. + + The response includes detailed information for each tax location, such as its address, name, description, and current operational status. + + You can paginate through the list by using the limit parameter to control the number of results returned in each request. + """ + 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["LocationListParams"] + ) -> ListObject["Location"]: + """ + Retrieve a list of all tax locations. Tax locations can represent the venues for services, tickets, or other product types. + + The response includes detailed information for each tax location, such as its address, name, description, and current operational status. + + You can paginate through the list by using the limit parameter to control the number of results returned in each request. + """ + 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 retrieve( + cls, id: str, **params: Unpack["LocationRetrieveParams"] + ) -> "Location": + """ + Fetch the details of a specific tax location using its unique identifier. Use a tax location to calculate taxes based on the location of the end product, such as a performance, instead of the customer address. For more details, check the [integration guide](https://docs.stripe.com/tax/tax-for-tickets/integration-guide). + """ + instance = cls(id, **params) + instance.refresh() + return instance + + @classmethod + async def retrieve_async( + cls, id: str, **params: Unpack["LocationRetrieveParams"] + ) -> "Location": + """ + Fetch the details of a specific tax location using its unique identifier. Use a tax location to calculate taxes based on the location of the end product, such as a performance, instead of the customer address. For more details, check the [integration guide](https://docs.stripe.com/tax/tax-for-tickets/integration-guide). + """ + instance = cls(id, **params) + await instance.refresh_async() + return instance + + _inner_class_types = {"address": Address} diff --git a/stripe/tax/_location_service.py b/stripe/tax/_location_service.py new file mode 100644 index 000000000..3d33322b7 --- /dev/null +++ b/stripe/tax/_location_service.py @@ -0,0 +1,146 @@ +# -*- 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.params.tax._location_create_params import LocationCreateParams + from stripe.params.tax._location_list_params import LocationListParams + from stripe.params.tax._location_retrieve_params import ( + LocationRetrieveParams, + ) + from stripe.tax._location import Location + + +class LocationService(StripeService): + def list( + self, + params: "LocationListParams", + options: Optional["RequestOptions"] = None, + ) -> "ListObject[Location]": + """ + Retrieve a list of all tax locations. Tax locations can represent the venues for services, tickets, or other product types. + + The response includes detailed information for each tax location, such as its address, name, description, and current operational status. + + You can paginate through the list by using the limit parameter to control the number of results returned in each request. + """ + return cast( + "ListObject[Location]", + self._request( + "get", + "/v1/tax/locations", + base_address="api", + params=params, + options=options, + ), + ) + + async def list_async( + self, + params: "LocationListParams", + options: Optional["RequestOptions"] = None, + ) -> "ListObject[Location]": + """ + Retrieve a list of all tax locations. Tax locations can represent the venues for services, tickets, or other product types. + + The response includes detailed information for each tax location, such as its address, name, description, and current operational status. + + You can paginate through the list by using the limit parameter to control the number of results returned in each request. + """ + return cast( + "ListObject[Location]", + await self._request_async( + "get", + "/v1/tax/locations", + base_address="api", + params=params, + options=options, + ), + ) + + def create( + self, + params: "LocationCreateParams", + options: Optional["RequestOptions"] = None, + ) -> "Location": + """ + Create a tax location to use in calculating taxes for a service, ticket, or other type of product. The resulting object contains the id, address, name, description, and current operational status of the tax location. + """ + return cast( + "Location", + self._request( + "post", + "/v1/tax/locations", + base_address="api", + params=params, + options=options, + ), + ) + + async def create_async( + self, + params: "LocationCreateParams", + options: Optional["RequestOptions"] = None, + ) -> "Location": + """ + Create a tax location to use in calculating taxes for a service, ticket, or other type of product. The resulting object contains the id, address, name, description, and current operational status of the tax location. + """ + return cast( + "Location", + await self._request_async( + "post", + "/v1/tax/locations", + base_address="api", + params=params, + options=options, + ), + ) + + def retrieve( + self, + location: str, + params: Optional["LocationRetrieveParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "Location": + """ + Fetch the details of a specific tax location using its unique identifier. Use a tax location to calculate taxes based on the location of the end product, such as a performance, instead of the customer address. For more details, check the [integration guide](https://docs.stripe.com/tax/tax-for-tickets/integration-guide). + """ + return cast( + "Location", + self._request( + "get", + "/v1/tax/locations/{location}".format( + location=sanitize_id(location), + ), + base_address="api", + params=params, + options=options, + ), + ) + + async def retrieve_async( + self, + location: str, + params: Optional["LocationRetrieveParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "Location": + """ + Fetch the details of a specific tax location using its unique identifier. Use a tax location to calculate taxes based on the location of the end product, such as a performance, instead of the customer address. For more details, check the [integration guide](https://docs.stripe.com/tax/tax-for-tickets/integration-guide). + """ + return cast( + "Location", + await self._request_async( + "get", + "/v1/tax/locations/{location}".format( + location=sanitize_id(location), + ), + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/tax/_registration.py b/stripe/tax/_registration.py index aef4287f0..fffbe49af 100644 --- a/stripe/tax/_registration.py +++ b/stripe/tax/_registration.py @@ -947,6 +947,36 @@ class Ug(StripeObject): """ class Us(StripeObject): + class AdmissionsTax(StripeObject): + jurisdiction: str + """ + A [jurisdiction code](https://docs.stripe.com/tax/registering?type=admissions_tax#registration-types) representing the local jurisdiction. + """ + + class AttendanceTax(StripeObject): + jurisdiction: str + """ + A [jurisdiction code](https://docs.stripe.com/tax/registering?type=attendance_tax#registration-types) representing the local jurisdiction. + """ + + class EntertainmentTax(StripeObject): + jurisdiction: str + """ + A [jurisdiction code](https://docs.stripe.com/tax/registering?type=entertainment_tax#registration-types) representing the local jurisdiction. + """ + + class GrossReceiptsTax(StripeObject): + jurisdiction: str + """ + A [jurisdiction code](https://docs.stripe.com/tax/registering?type=gross_receipts_tax#registration-types) representing the local jurisdiction. + """ + + class HospitalityTax(StripeObject): + jurisdiction: str + """ + A [jurisdiction code](https://docs.stripe.com/tax/registering?type=hospitality_tax#registration-types) representing the local jurisdiction. + """ + class LocalAmusementTax(StripeObject): jurisdiction: str """ @@ -959,6 +989,18 @@ class LocalLeaseTax(StripeObject): A [FIPS code](https://www.census.gov/library/reference/code-lists/ansi.html) representing the local jurisdiction. """ + class LuxuryTax(StripeObject): + jurisdiction: str + """ + A [jurisdiction code](https://docs.stripe.com/tax/registering?type=luxury_tax#registration-types) representing the local jurisdiction. + """ + + class ResortTax(StripeObject): + jurisdiction: str + """ + A [jurisdiction code](https://docs.stripe.com/tax/registering?type=resort_tax#registration-types) representing the local jurisdiction. + """ + class StateSalesTax(StripeObject): class Election(StripeObject): jurisdiction: Optional[str] @@ -980,27 +1022,57 @@ class Election(StripeObject): """ _inner_class_types = {"elections": Election} + class TourismTax(StripeObject): + jurisdiction: str + """ + A [jurisdiction code](https://docs.stripe.com/tax/registering?type=tourism_tax#registration-types) representing the local jurisdiction. + """ + + admissions_tax: Optional[AdmissionsTax] + attendance_tax: Optional[AttendanceTax] + entertainment_tax: Optional[EntertainmentTax] + gross_receipts_tax: Optional[GrossReceiptsTax] + hospitality_tax: Optional[HospitalityTax] local_amusement_tax: Optional[LocalAmusementTax] local_lease_tax: Optional[LocalLeaseTax] + luxury_tax: Optional[LuxuryTax] + resort_tax: Optional[ResortTax] state: str """ Two-letter US state code ([ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2)). """ state_sales_tax: Optional[StateSalesTax] + tourism_tax: Optional[TourismTax] type: Literal[ + "admissions_tax", + "attendance_tax", + "entertainment_tax", + "gross_receipts_tax", + "hospitality_tax", "local_amusement_tax", "local_lease_tax", + "luxury_tax", + "resort_tax", "state_communications_tax", "state_retail_delivery_fee", "state_sales_tax", + "tourism_tax", ] """ Type of registration in the US. """ _inner_class_types = { + "admissions_tax": AdmissionsTax, + "attendance_tax": AttendanceTax, + "entertainment_tax": EntertainmentTax, + "gross_receipts_tax": GrossReceiptsTax, + "hospitality_tax": HospitalityTax, "local_amusement_tax": LocalAmusementTax, "local_lease_tax": LocalLeaseTax, + "luxury_tax": LuxuryTax, + "resort_tax": ResortTax, "state_sales_tax": StateSalesTax, + "tourism_tax": TourismTax, } class Uy(StripeObject): @@ -1268,7 +1340,7 @@ class Zw(StripeObject): """ livemode: bool """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ object: Literal["tax.registration"] """ diff --git a/stripe/tax/_settings.py b/stripe/tax/_settings.py index 7a3f7988d..1fefd5321 100644 --- a/stripe/tax/_settings.py +++ b/stripe/tax/_settings.py @@ -92,7 +92,7 @@ class Pending(StripeObject): """ livemode: bool """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ object: Literal["tax.settings"] """ diff --git a/stripe/tax/_transaction.py b/stripe/tax/_transaction.py index 79bfe9fe4..af28080a4 100644 --- a/stripe/tax/_transaction.py +++ b/stripe/tax/_transaction.py @@ -275,19 +275,27 @@ class TaxRateDetails(StripeObject): The tax rate percentage as a string. For example, 8.5% is represented as "8.5". """ tax_type: Literal[ + "admissions_tax", "amusement_tax", + "attendance_tax", "communications_tax", + "entertainment_tax", + "gross_receipts_tax", "gst", + "hospitality_tax", "hst", "igst", "jct", "lease_tax", + "luxury_tax", "pst", "qst", + "resort_tax", "retail_delivery_fee", "rst", "sales_tax", "service_tax", + "tourism_tax", "vat", ] """ @@ -296,10 +304,10 @@ class TaxRateDetails(StripeObject): amount: int """ - The amount of tax, in the [smallest currency unit](https://docs.stripe.com/currencies#zero-decimal). + The amount of tax, in the [smallest currency unit](https://docs.stripe.com/currencies#minor-units). """ jurisdiction: Jurisdiction - sourcing: Literal["destination", "origin"] + sourcing: Literal["destination", "origin", "performance"] """ Indicates whether the jurisdiction was determined by the origin (merchant's address) or destination (customer's address). """ @@ -329,7 +337,7 @@ class TaxRateDetails(StripeObject): """ taxable_amount: int """ - The amount on which tax is calculated, in the [smallest currency unit](https://docs.stripe.com/currencies#zero-decimal). + The amount on which tax is calculated, in the [smallest currency unit](https://docs.stripe.com/currencies#minor-units). """ _inner_class_types = { "jurisdiction": Jurisdiction, @@ -338,11 +346,11 @@ class TaxRateDetails(StripeObject): amount: int """ - The shipping amount in the [smallest currency unit](https://docs.stripe.com/currencies#zero-decimal). If `tax_behavior=inclusive`, then this amount includes taxes. Otherwise, taxes were calculated on top of this amount. + The shipping amount in the [smallest currency unit](https://docs.stripe.com/currencies#minor-units). If `tax_behavior=inclusive`, then this amount includes taxes. Otherwise, taxes were calculated on top of this amount. """ amount_tax: int """ - The amount of tax calculated for shipping, in the [smallest currency unit](https://docs.stripe.com/currencies#zero-decimal). + The amount of tax calculated for shipping, in the [smallest currency unit](https://docs.stripe.com/currencies#minor-units). """ shipping_rate: Optional[str] """ @@ -385,7 +393,7 @@ class TaxRateDetails(StripeObject): """ livemode: bool """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ metadata: Optional[Dict[str, str]] """ @@ -539,7 +547,7 @@ def list_line_items( # pyright: ignore[reportGeneralTypeIssues] self._request( "get", "/v1/tax/transactions/{transaction}/line_items".format( - transaction=sanitize_id(self.get("id")) + transaction=sanitize_id(self._data.get("id")) ), params=params, ), @@ -596,7 +604,7 @@ async def list_line_items_async( # pyright: ignore[reportGeneralTypeIssues] await self._request_async( "get", "/v1/tax/transactions/{transaction}/line_items".format( - transaction=sanitize_id(self.get("id")) + transaction=sanitize_id(self._data.get("id")) ), params=params, ), diff --git a/stripe/tax/_transaction_line_item.py b/stripe/tax/_transaction_line_item.py index 9f575613d..d8190d602 100644 --- a/stripe/tax/_transaction_line_item.py +++ b/stripe/tax/_transaction_line_item.py @@ -18,11 +18,11 @@ class Reversal(StripeObject): amount: int """ - The line item amount in the [smallest currency unit](https://docs.stripe.com/currencies#zero-decimal). If `tax_behavior=inclusive`, then this amount includes taxes. Otherwise, taxes were calculated on top of this amount. + The line item amount in the [smallest currency unit](https://docs.stripe.com/currencies#minor-units). If `tax_behavior=inclusive`, then this amount includes taxes. Otherwise, taxes were calculated on top of this amount. """ amount_tax: int """ - The amount of tax calculated for this line item, in the [smallest currency unit](https://docs.stripe.com/currencies#zero-decimal). + The amount of tax calculated for this line item, in the [smallest currency unit](https://docs.stripe.com/currencies#minor-units). """ id: str """ @@ -30,7 +30,7 @@ class Reversal(StripeObject): """ livemode: bool """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ metadata: Optional[Dict[str, str]] """ diff --git a/stripe/terminal/_configuration.py b/stripe/terminal/_configuration.py index 2cf253006..5ac56a0f2 100644 --- a/stripe/terminal/_configuration.py +++ b/stripe/terminal/_configuration.py @@ -526,7 +526,7 @@ class PersonalPsk(StripeObject): """ livemode: bool """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ name: Optional[str] """ diff --git a/stripe/terminal/_location.py b/stripe/terminal/_location.py index 03cb2a0db..77fec24cf 100644 --- a/stripe/terminal/_location.py +++ b/stripe/terminal/_location.py @@ -155,7 +155,7 @@ class AddressKanji(StripeObject): """ livemode: bool """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ metadata: Dict[str, str] """ diff --git a/stripe/terminal/_reader.py b/stripe/terminal/_reader.py index 97ce814fa..97177e852 100644 --- a/stripe/terminal/_reader.py +++ b/stripe/terminal/_reader.py @@ -574,7 +574,7 @@ class LineItem(StripeObject): """ livemode: bool """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ location: Optional[ExpandableField["Location"]] """ @@ -646,7 +646,7 @@ def cancel_action( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/terminal/readers/{reader}/cancel_action".format( - reader=sanitize_id(self.get("id")) + reader=sanitize_id(self._data.get("id")) ), params=params, ), @@ -701,7 +701,7 @@ async def cancel_action_async( # pyright: ignore[reportGeneralTypeIssues] await self._request_async( "post", "/v1/terminal/readers/{reader}/cancel_action".format( - reader=sanitize_id(self.get("id")) + reader=sanitize_id(self._data.get("id")) ), params=params, ), @@ -756,7 +756,7 @@ def collect_inputs( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/terminal/readers/{reader}/collect_inputs".format( - reader=sanitize_id(self.get("id")) + reader=sanitize_id(self._data.get("id")) ), params=params, ), @@ -811,7 +811,7 @@ async def collect_inputs_async( # pyright: ignore[reportGeneralTypeIssues] await self._request_async( "post", "/v1/terminal/readers/{reader}/collect_inputs".format( - reader=sanitize_id(self.get("id")) + reader=sanitize_id(self._data.get("id")) ), params=params, ), @@ -866,7 +866,7 @@ def collect_payment_method( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/terminal/readers/{reader}/collect_payment_method".format( - reader=sanitize_id(self.get("id")) + reader=sanitize_id(self._data.get("id")) ), params=params, ), @@ -921,7 +921,7 @@ async def collect_payment_method_async( # pyright: ignore[reportGeneralTypeIssu await self._request_async( "post", "/v1/terminal/readers/{reader}/collect_payment_method".format( - reader=sanitize_id(self.get("id")) + reader=sanitize_id(self._data.get("id")) ), params=params, ), @@ -976,7 +976,7 @@ def confirm_payment_intent( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/terminal/readers/{reader}/confirm_payment_intent".format( - reader=sanitize_id(self.get("id")) + reader=sanitize_id(self._data.get("id")) ), params=params, ), @@ -1031,7 +1031,7 @@ async def confirm_payment_intent_async( # pyright: ignore[reportGeneralTypeIssu await self._request_async( "post", "/v1/terminal/readers/{reader}/confirm_payment_intent".format( - reader=sanitize_id(self.get("id")) + reader=sanitize_id(self._data.get("id")) ), params=params, ), @@ -1284,7 +1284,7 @@ def process_payment_intent( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/terminal/readers/{reader}/process_payment_intent".format( - reader=sanitize_id(self.get("id")) + reader=sanitize_id(self._data.get("id")) ), params=params, ), @@ -1339,7 +1339,7 @@ async def process_payment_intent_async( # pyright: ignore[reportGeneralTypeIssu await self._request_async( "post", "/v1/terminal/readers/{reader}/process_payment_intent".format( - reader=sanitize_id(self.get("id")) + reader=sanitize_id(self._data.get("id")) ), params=params, ), @@ -1394,7 +1394,7 @@ def process_setup_intent( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/terminal/readers/{reader}/process_setup_intent".format( - reader=sanitize_id(self.get("id")) + reader=sanitize_id(self._data.get("id")) ), params=params, ), @@ -1449,7 +1449,7 @@ async def process_setup_intent_async( # pyright: ignore[reportGeneralTypeIssues await self._request_async( "post", "/v1/terminal/readers/{reader}/process_setup_intent".format( - reader=sanitize_id(self.get("id")) + reader=sanitize_id(self._data.get("id")) ), params=params, ), @@ -1504,7 +1504,7 @@ def refund_payment( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/terminal/readers/{reader}/refund_payment".format( - reader=sanitize_id(self.get("id")) + reader=sanitize_id(self._data.get("id")) ), params=params, ), @@ -1559,7 +1559,7 @@ async def refund_payment_async( # pyright: ignore[reportGeneralTypeIssues] await self._request_async( "post", "/v1/terminal/readers/{reader}/refund_payment".format( - reader=sanitize_id(self.get("id")) + reader=sanitize_id(self._data.get("id")) ), params=params, ), @@ -1636,7 +1636,7 @@ def set_reader_display( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/terminal/readers/{reader}/set_reader_display".format( - reader=sanitize_id(self.get("id")) + reader=sanitize_id(self._data.get("id")) ), params=params, ), @@ -1691,7 +1691,7 @@ async def set_reader_display_async( # pyright: ignore[reportGeneralTypeIssues] await self._request_async( "post", "/v1/terminal/readers/{reader}/set_reader_display".format( - reader=sanitize_id(self.get("id")) + reader=sanitize_id(self._data.get("id")) ), params=params, ), @@ -1751,7 +1751,7 @@ def present_payment_method( # pyright: ignore[reportGeneralTypeIssues] self.resource._request( "post", "/v1/test_helpers/terminal/readers/{reader}/present_payment_method".format( - reader=sanitize_id(self.resource.get("id")) + reader=sanitize_id(self.resource._data.get("id")) ), params=params, ), @@ -1808,7 +1808,7 @@ async def present_payment_method_async( # pyright: ignore[reportGeneralTypeIssu await self.resource._request_async( "post", "/v1/test_helpers/terminal/readers/{reader}/present_payment_method".format( - reader=sanitize_id(self.resource.get("id")) + reader=sanitize_id(self.resource._data.get("id")) ), params=params, ), @@ -1865,7 +1865,7 @@ def succeed_input_collection( # pyright: ignore[reportGeneralTypeIssues] self.resource._request( "post", "/v1/test_helpers/terminal/readers/{reader}/succeed_input_collection".format( - reader=sanitize_id(self.resource.get("id")) + reader=sanitize_id(self.resource._data.get("id")) ), params=params, ), @@ -1922,7 +1922,7 @@ async def succeed_input_collection_async( # pyright: ignore[reportGeneralTypeIs await self.resource._request_async( "post", "/v1/test_helpers/terminal/readers/{reader}/succeed_input_collection".format( - reader=sanitize_id(self.resource.get("id")) + reader=sanitize_id(self.resource._data.get("id")) ), params=params, ), @@ -1979,7 +1979,7 @@ def timeout_input_collection( # pyright: ignore[reportGeneralTypeIssues] self.resource._request( "post", "/v1/test_helpers/terminal/readers/{reader}/timeout_input_collection".format( - reader=sanitize_id(self.resource.get("id")) + reader=sanitize_id(self.resource._data.get("id")) ), params=params, ), @@ -2036,7 +2036,7 @@ async def timeout_input_collection_async( # pyright: ignore[reportGeneralTypeIs await self.resource._request_async( "post", "/v1/test_helpers/terminal/readers/{reader}/timeout_input_collection".format( - reader=sanitize_id(self.resource.get("id")) + reader=sanitize_id(self.resource._data.get("id")) ), params=params, ), diff --git a/stripe/terminal/_reader_collected_data.py b/stripe/terminal/_reader_collected_data.py index 68d348e85..6f1311cb9 100644 --- a/stripe/terminal/_reader_collected_data.py +++ b/stripe/terminal/_reader_collected_data.py @@ -36,7 +36,7 @@ class Magstripe(StripeObject): """ livemode: bool """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ magstripe: Optional[Magstripe] """ diff --git a/stripe/test_helpers/_test_clock.py b/stripe/test_helpers/_test_clock.py index ebc506b42..7e011186b 100644 --- a/stripe/test_helpers/_test_clock.py +++ b/stripe/test_helpers/_test_clock.py @@ -74,7 +74,7 @@ class Advancing(StripeObject): """ livemode: bool """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ name: Optional[str] """ @@ -139,7 +139,7 @@ def advance( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/test_helpers/test_clocks/{test_clock}/advance".format( - test_clock=sanitize_id(self.get("id")) + test_clock=sanitize_id(self._data.get("id")) ), params=params, ), @@ -194,7 +194,7 @@ async def advance_async( # pyright: ignore[reportGeneralTypeIssues] await self._request_async( "post", "/v1/test_helpers/test_clocks/{test_clock}/advance".format( - test_clock=sanitize_id(self.get("id")) + test_clock=sanitize_id(self._data.get("id")) ), params=params, ), diff --git a/stripe/treasury/_credit_reversal.py b/stripe/treasury/_credit_reversal.py index d3724e5df..d92fc01a6 100644 --- a/stripe/treasury/_credit_reversal.py +++ b/stripe/treasury/_credit_reversal.py @@ -65,7 +65,7 @@ class StatusTransitions(StripeObject): """ livemode: bool """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ metadata: Dict[str, str] """ diff --git a/stripe/treasury/_debit_reversal.py b/stripe/treasury/_debit_reversal.py index 3a32d5778..078a99f74 100644 --- a/stripe/treasury/_debit_reversal.py +++ b/stripe/treasury/_debit_reversal.py @@ -75,7 +75,7 @@ class StatusTransitions(StripeObject): """ livemode: bool """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ metadata: Dict[str, str] """ diff --git a/stripe/treasury/_financial_account.py b/stripe/treasury/_financial_account.py index e7141ff82..e1a93c59d 100644 --- a/stripe/treasury/_financial_account.py +++ b/stripe/treasury/_financial_account.py @@ -178,7 +178,7 @@ class Closed(StripeObject): is_default: Optional[bool] livemode: bool """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ metadata: Optional[Dict[str, str]] """ @@ -297,7 +297,7 @@ def close( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/treasury/financial_accounts/{financial_account}/close".format( - financial_account=sanitize_id(self.get("id")) + financial_account=sanitize_id(self._data.get("id")) ), params=params, ), @@ -354,7 +354,7 @@ async def close_async( # pyright: ignore[reportGeneralTypeIssues] await self._request_async( "post", "/v1/treasury/financial_accounts/{financial_account}/close".format( - financial_account=sanitize_id(self.get("id")) + financial_account=sanitize_id(self._data.get("id")) ), params=params, ), @@ -540,7 +540,7 @@ def retrieve_features( # pyright: ignore[reportGeneralTypeIssues] self._request( "get", "/v1/treasury/financial_accounts/{financial_account}/features".format( - financial_account=sanitize_id(self.get("id")) + financial_account=sanitize_id(self._data.get("id")) ), params=params, ), @@ -598,7 +598,7 @@ async def retrieve_features_async( # pyright: ignore[reportGeneralTypeIssues] await self._request_async( "get", "/v1/treasury/financial_accounts/{financial_account}/features".format( - financial_account=sanitize_id(self.get("id")) + financial_account=sanitize_id(self._data.get("id")) ), params=params, ), @@ -656,7 +656,7 @@ def update_features( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/treasury/financial_accounts/{financial_account}/features".format( - financial_account=sanitize_id(self.get("id")) + financial_account=sanitize_id(self._data.get("id")) ), params=params, ), @@ -714,7 +714,7 @@ async def update_features_async( # pyright: ignore[reportGeneralTypeIssues] await self._request_async( "post", "/v1/treasury/financial_accounts/{financial_account}/features".format( - financial_account=sanitize_id(self.get("id")) + financial_account=sanitize_id(self._data.get("id")) ), params=params, ), diff --git a/stripe/treasury/_inbound_transfer.py b/stripe/treasury/_inbound_transfer.py index 7c7704948..a97dd7f58 100644 --- a/stripe/treasury/_inbound_transfer.py +++ b/stripe/treasury/_inbound_transfer.py @@ -213,7 +213,7 @@ class StatusTransitions(StripeObject): linked_flows: LinkedFlows livemode: bool """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ metadata: Dict[str, str] """ @@ -300,7 +300,7 @@ def cancel( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/treasury/inbound_transfers/{inbound_transfer}/cancel".format( - inbound_transfer=sanitize_id(self.get("id")) + inbound_transfer=sanitize_id(self._data.get("id")) ), params=params, ), @@ -357,7 +357,7 @@ async def cancel_async( # pyright: ignore[reportGeneralTypeIssues] await self._request_async( "post", "/v1/treasury/inbound_transfers/{inbound_transfer}/cancel".format( - inbound_transfer=sanitize_id(self.get("id")) + inbound_transfer=sanitize_id(self._data.get("id")) ), params=params, ), @@ -509,7 +509,7 @@ def fail( # pyright: ignore[reportGeneralTypeIssues] self.resource._request( "post", "/v1/test_helpers/treasury/inbound_transfers/{id}/fail".format( - id=sanitize_id(self.resource.get("id")) + id=sanitize_id(self.resource._data.get("id")) ), params=params, ), @@ -564,7 +564,7 @@ async def fail_async( # pyright: ignore[reportGeneralTypeIssues] await self.resource._request_async( "post", "/v1/test_helpers/treasury/inbound_transfers/{id}/fail".format( - id=sanitize_id(self.resource.get("id")) + id=sanitize_id(self.resource._data.get("id")) ), params=params, ), @@ -624,7 +624,7 @@ def return_inbound_transfer( # pyright: ignore[reportGeneralTypeIssues] self.resource._request( "post", "/v1/test_helpers/treasury/inbound_transfers/{id}/return".format( - id=sanitize_id(self.resource.get("id")) + id=sanitize_id(self.resource._data.get("id")) ), params=params, ), @@ -684,7 +684,7 @@ async def return_inbound_transfer_async( # pyright: ignore[reportGeneralTypeIss await self.resource._request_async( "post", "/v1/test_helpers/treasury/inbound_transfers/{id}/return".format( - id=sanitize_id(self.resource.get("id")) + id=sanitize_id(self.resource._data.get("id")) ), params=params, ), @@ -739,7 +739,7 @@ def succeed( # pyright: ignore[reportGeneralTypeIssues] self.resource._request( "post", "/v1/test_helpers/treasury/inbound_transfers/{id}/succeed".format( - id=sanitize_id(self.resource.get("id")) + id=sanitize_id(self.resource._data.get("id")) ), params=params, ), @@ -794,7 +794,7 @@ async def succeed_async( # pyright: ignore[reportGeneralTypeIssues] await self.resource._request_async( "post", "/v1/test_helpers/treasury/inbound_transfers/{id}/succeed".format( - id=sanitize_id(self.resource.get("id")) + id=sanitize_id(self.resource._data.get("id")) ), params=params, ), diff --git a/stripe/treasury/_outbound_payment.py b/stripe/treasury/_outbound_payment.py index d855c0ffc..f2e3bba34 100644 --- a/stripe/treasury/_outbound_payment.py +++ b/stripe/treasury/_outbound_payment.py @@ -285,7 +285,7 @@ class UsDomesticWire(StripeObject): """ livemode: bool """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ metadata: Dict[str, str] """ @@ -366,7 +366,7 @@ def cancel( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/treasury/outbound_payments/{id}/cancel".format( - id=sanitize_id(self.get("id")) + id=sanitize_id(self._data.get("id")) ), params=params, ), @@ -421,7 +421,7 @@ async def cancel_async( # pyright: ignore[reportGeneralTypeIssues] await self._request_async( "post", "/v1/treasury/outbound_payments/{id}/cancel".format( - id=sanitize_id(self.get("id")) + id=sanitize_id(self._data.get("id")) ), params=params, ), @@ -573,7 +573,7 @@ def fail( # pyright: ignore[reportGeneralTypeIssues] self.resource._request( "post", "/v1/test_helpers/treasury/outbound_payments/{id}/fail".format( - id=sanitize_id(self.resource.get("id")) + id=sanitize_id(self.resource._data.get("id")) ), params=params, ), @@ -628,7 +628,7 @@ async def fail_async( # pyright: ignore[reportGeneralTypeIssues] await self.resource._request_async( "post", "/v1/test_helpers/treasury/outbound_payments/{id}/fail".format( - id=sanitize_id(self.resource.get("id")) + id=sanitize_id(self.resource._data.get("id")) ), params=params, ), @@ -683,7 +683,7 @@ def post( # pyright: ignore[reportGeneralTypeIssues] self.resource._request( "post", "/v1/test_helpers/treasury/outbound_payments/{id}/post".format( - id=sanitize_id(self.resource.get("id")) + id=sanitize_id(self.resource._data.get("id")) ), params=params, ), @@ -738,7 +738,7 @@ async def post_async( # pyright: ignore[reportGeneralTypeIssues] await self.resource._request_async( "post", "/v1/test_helpers/treasury/outbound_payments/{id}/post".format( - id=sanitize_id(self.resource.get("id")) + id=sanitize_id(self.resource._data.get("id")) ), params=params, ), @@ -798,7 +798,7 @@ def return_outbound_payment( # pyright: ignore[reportGeneralTypeIssues] self.resource._request( "post", "/v1/test_helpers/treasury/outbound_payments/{id}/return".format( - id=sanitize_id(self.resource.get("id")) + id=sanitize_id(self.resource._data.get("id")) ), params=params, ), @@ -858,7 +858,7 @@ async def return_outbound_payment_async( # pyright: ignore[reportGeneralTypeIss await self.resource._request_async( "post", "/v1/test_helpers/treasury/outbound_payments/{id}/return".format( - id=sanitize_id(self.resource.get("id")) + id=sanitize_id(self.resource._data.get("id")) ), params=params, ), @@ -913,7 +913,7 @@ def update( # pyright: ignore[reportGeneralTypeIssues] self.resource._request( "post", "/v1/test_helpers/treasury/outbound_payments/{id}".format( - id=sanitize_id(self.resource.get("id")) + id=sanitize_id(self.resource._data.get("id")) ), params=params, ), @@ -968,7 +968,7 @@ async def update_async( # pyright: ignore[reportGeneralTypeIssues] await self.resource._request_async( "post", "/v1/test_helpers/treasury/outbound_payments/{id}".format( - id=sanitize_id(self.resource.get("id")) + id=sanitize_id(self.resource._data.get("id")) ), params=params, ), diff --git a/stripe/treasury/_outbound_transfer.py b/stripe/treasury/_outbound_transfer.py index 3e281e539..a1f0b1cf0 100644 --- a/stripe/treasury/_outbound_transfer.py +++ b/stripe/treasury/_outbound_transfer.py @@ -279,7 +279,7 @@ class UsDomesticWire(StripeObject): """ livemode: bool """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ metadata: Dict[str, str] """ @@ -367,7 +367,7 @@ def cancel( # pyright: ignore[reportGeneralTypeIssues] self._request( "post", "/v1/treasury/outbound_transfers/{outbound_transfer}/cancel".format( - outbound_transfer=sanitize_id(self.get("id")) + outbound_transfer=sanitize_id(self._data.get("id")) ), params=params, ), @@ -425,7 +425,7 @@ async def cancel_async( # pyright: ignore[reportGeneralTypeIssues] await self._request_async( "post", "/v1/treasury/outbound_transfers/{outbound_transfer}/cancel".format( - outbound_transfer=sanitize_id(self.get("id")) + outbound_transfer=sanitize_id(self._data.get("id")) ), params=params, ), @@ -580,7 +580,9 @@ def fail( # pyright: ignore[reportGeneralTypeIssues] self.resource._request( "post", "/v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}/fail".format( - outbound_transfer=sanitize_id(self.resource.get("id")) + outbound_transfer=sanitize_id( + self.resource._data.get("id") + ) ), params=params, ), @@ -638,7 +640,9 @@ async def fail_async( # pyright: ignore[reportGeneralTypeIssues] await self.resource._request_async( "post", "/v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}/fail".format( - outbound_transfer=sanitize_id(self.resource.get("id")) + outbound_transfer=sanitize_id( + self.resource._data.get("id") + ) ), params=params, ), @@ -696,7 +700,9 @@ def post( # pyright: ignore[reportGeneralTypeIssues] self.resource._request( "post", "/v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}/post".format( - outbound_transfer=sanitize_id(self.resource.get("id")) + outbound_transfer=sanitize_id( + self.resource._data.get("id") + ) ), params=params, ), @@ -754,7 +760,9 @@ async def post_async( # pyright: ignore[reportGeneralTypeIssues] await self.resource._request_async( "post", "/v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}/post".format( - outbound_transfer=sanitize_id(self.resource.get("id")) + outbound_transfer=sanitize_id( + self.resource._data.get("id") + ) ), params=params, ), @@ -814,7 +822,9 @@ def return_outbound_transfer( # pyright: ignore[reportGeneralTypeIssues] self.resource._request( "post", "/v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}/return".format( - outbound_transfer=sanitize_id(self.resource.get("id")) + outbound_transfer=sanitize_id( + self.resource._data.get("id") + ) ), params=params, ), @@ -874,7 +884,9 @@ async def return_outbound_transfer_async( # pyright: ignore[reportGeneralTypeIs await self.resource._request_async( "post", "/v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}/return".format( - outbound_transfer=sanitize_id(self.resource.get("id")) + outbound_transfer=sanitize_id( + self.resource._data.get("id") + ) ), params=params, ), @@ -932,7 +944,9 @@ def update( # pyright: ignore[reportGeneralTypeIssues] self.resource._request( "post", "/v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}".format( - outbound_transfer=sanitize_id(self.resource.get("id")) + outbound_transfer=sanitize_id( + self.resource._data.get("id") + ) ), params=params, ), @@ -990,7 +1004,9 @@ async def update_async( # pyright: ignore[reportGeneralTypeIssues] await self.resource._request_async( "post", "/v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}".format( - outbound_transfer=sanitize_id(self.resource.get("id")) + outbound_transfer=sanitize_id( + self.resource._data.get("id") + ) ), params=params, ), diff --git a/stripe/treasury/_received_credit.py b/stripe/treasury/_received_credit.py index 193c7f0ff..112c27a03 100644 --- a/stripe/treasury/_received_credit.py +++ b/stripe/treasury/_received_credit.py @@ -272,7 +272,7 @@ class ReversalDetails(StripeObject): linked_flows: LinkedFlows livemode: bool """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ network: Literal["ach", "card", "stripe", "us_domestic_wire"] """ diff --git a/stripe/treasury/_received_debit.py b/stripe/treasury/_received_debit.py index 577682baf..98b5a2517 100644 --- a/stripe/treasury/_received_debit.py +++ b/stripe/treasury/_received_debit.py @@ -229,7 +229,7 @@ class ReversalDetails(StripeObject): linked_flows: LinkedFlows livemode: bool """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ network: Literal["ach", "card", "stripe"] """ diff --git a/stripe/treasury/_transaction.py b/stripe/treasury/_transaction.py index d747cffef..69837c541 100644 --- a/stripe/treasury/_transaction.py +++ b/stripe/treasury/_transaction.py @@ -175,7 +175,7 @@ class StatusTransitions(StripeObject): """ livemode: bool """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ object: Literal["treasury.transaction"] """ diff --git a/stripe/treasury/_transaction_entry.py b/stripe/treasury/_transaction_entry.py index 66845f811..1a4bb4568 100644 --- a/stripe/treasury/_transaction_entry.py +++ b/stripe/treasury/_transaction_entry.py @@ -158,7 +158,7 @@ class FlowDetails(StripeObject): """ livemode: bool """ - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + If the object exists in live mode, the value is `true`. If the object exists in test mode, the value is `false`. """ object: Literal["treasury.transaction_entry"] """ diff --git a/stripe/v2/_core_service.py b/stripe/v2/_core_service.py index 35a600637..734688018 100644 --- a/stripe/v2/_core_service.py +++ b/stripe/v2/_core_service.py @@ -8,6 +8,7 @@ from stripe.v2.core._account_link_service import AccountLinkService from stripe.v2.core._account_service import AccountService from stripe.v2.core._account_token_service import AccountTokenService + from stripe.v2.core._batch_job_service import BatchJobService from stripe.v2.core._event_destination_service import ( EventDestinationService, ) @@ -24,6 +25,7 @@ "stripe.v2.core._account_token_service", "AccountTokenService", ], + "batch_jobs": ["stripe.v2.core._batch_job_service", "BatchJobService"], "events": ["stripe.v2.core._event_service", "EventService"], "event_destinations": [ "stripe.v2.core._event_destination_service", @@ -37,6 +39,7 @@ class CoreService(StripeService): accounts: "AccountService" account_links: "AccountLinkService" account_tokens: "AccountTokenService" + batch_jobs: "BatchJobService" events: "EventService" event_destinations: "EventDestinationService" vault: "VaultService" diff --git a/stripe/v2/_financial_address_generated_microdeposits.py b/stripe/v2/_financial_address_generated_microdeposits.py index f53dfcf52..f1c345be7 100644 --- a/stripe/v2/_financial_address_generated_microdeposits.py +++ b/stripe/v2/_financial_address_generated_microdeposits.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._stripe_object import StripeObject +from stripe.v2._amount import Amount from typing import ClassVar, List from typing_extensions import Literal @@ -13,17 +14,6 @@ class FinancialAddressGeneratedMicrodeposits(StripeObject): OBJECT_NAME: ClassVar[ Literal["financial_address_generated_microdeposits"] ] = "financial_address_generated_microdeposits" - - class Amount(StripeObject): - 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). - """ - value: int - """ - A non-negative integer representing how much to charge in the [smallest currency unit](https://docs.stripe.com/currencies#minor-units). - """ - amounts: List[Amount] """ The amounts of the microdeposits that were generated. @@ -40,4 +30,3 @@ class Amount(StripeObject): """ Closed Enum. The status of the request. """ - _inner_class_types = {"amounts": Amount} diff --git a/stripe/v2/_list_object.py b/stripe/v2/_list_object.py index a314650c6..8e301edce 100644 --- a/stripe/v2/_list_object.py +++ b/stripe/v2/_list_object.py @@ -22,7 +22,7 @@ class ListObject(StripeObject, Generic[T]): def __getitem__(self, k): if isinstance(k, str): # type: ignore - return super(ListObject, self).__getitem__(k) + return super().__getitem__(k) else: raise KeyError( "You tried to access the %s index, but ListObjectV2 types only " diff --git a/stripe/v2/core/__init__.py b/stripe/v2/core/__init__.py index 3ca3fb1cf..c694e2591 100644 --- a/stripe/v2/core/__init__.py +++ b/stripe/v2/core/__init__.py @@ -29,6 +29,10 @@ from stripe.v2.core._account_token_service import ( AccountTokenService as AccountTokenService, ) + from stripe.v2.core._batch_job import BatchJob as BatchJob + from stripe.v2.core._batch_job_service import ( + BatchJobService as BatchJobService, + ) from stripe.v2.core._event import Event as Event from stripe.v2.core._event_destination import ( EventDestination as EventDestination, @@ -51,6 +55,8 @@ "AccountService": ("stripe.v2.core._account_service", False), "AccountToken": ("stripe.v2.core._account_token", False), "AccountTokenService": ("stripe.v2.core._account_token_service", False), + "BatchJob": ("stripe.v2.core._batch_job", False), + "BatchJobService": ("stripe.v2.core._batch_job_service", False), "Event": ("stripe.v2.core._event", False), "EventDestination": ("stripe.v2.core._event_destination", False), "EventDestinationService": ( diff --git a/stripe/v2/core/_account.py b/stripe/v2/core/_account.py index 578e60edd..5de573943 100644 --- a/stripe/v2/core/_account.py +++ b/stripe/v2/core/_account.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._stripe_object import StripeObject +from stripe.v2._amount import Amount from typing import ClassVar, Dict, List, Optional from typing_extensions import Literal @@ -2428,6 +2429,7 @@ class DefaultOutboundDestination(StripeObject): "ag_bank_account", "al_bank_account", "am_bank_account", + "ar_bank_account", "at_bank_account", "au_bank_account", "ba_bank_account", @@ -2443,6 +2445,7 @@ class DefaultOutboundDestination(StripeObject): "ca_bank_account", "ch_bank_account", "ci_bank_account", + "co_bank_account", "crypto_wallet", "cr_bank_account", "cy_bank_account", @@ -2453,6 +2456,7 @@ class DefaultOutboundDestination(StripeObject): "dz_bank_account", "ec_bank_account", "ee_bank_account", + "eg_bank_account", "es_bank_account", "et_bank_account", "fi_bank_account", @@ -3163,6 +3167,10 @@ class Responsibilities(StripeObject): """ Default responsibilities held by either Stripe or the platform. """ + timezone: Optional[str] + """ + The Account's local timezone. A list of possible time zone values is maintained at the [IANA Time Zone Database](https://www.iana.org/time-zones). + """ _inner_class_types = { "profile": Profile, "responsibilities": Responsibilities, @@ -3632,16 +3640,6 @@ class Address(StripeObject): """ class AnnualRevenue(StripeObject): - class Amount(StripeObject): - 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). - """ - value: int - """ - A non-negative integer representing how much to charge in the [smallest currency unit](https://docs.stripe.com/currencies#minor-units). - """ - amount: Optional[Amount] """ Annual revenue amount in minor currency units (for example, '123' for 1.23 USD). @@ -3650,7 +3648,6 @@ class Amount(StripeObject): """ The close-out date of the preceding fiscal year in ISO 8601 format. E.g. 2023-12-31 for the 31st of December, 2023. """ - _inner_class_types = {"amount": Amount} class Documents(StripeObject): class BankAccountOwnershipVerification(StripeObject): @@ -3952,21 +3949,10 @@ class IdNumber(StripeObject): """ class MonthlyEstimatedRevenue(StripeObject): - class Amount(StripeObject): - 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). - """ - value: int - """ - A non-negative integer representing how much to charge in the [smallest currency unit](https://docs.stripe.com/currencies#minor-units). - """ - amount: Optional[Amount] """ Estimated monthly revenue amount in minor currency units (for example, '123' for 1.23 USD). """ - _inner_class_types = {"amount": Amount} class RegistrationDate(StripeObject): day: int diff --git a/stripe/v2/core/_batch_job.py b/stripe/v2/core/_batch_job.py new file mode 100644 index 000000000..cd8e7ea4e --- /dev/null +++ b/stripe/v2/core/_batch_job.py @@ -0,0 +1,306 @@ +# -*- coding: utf-8 -*- +# File generated from our OpenAPI spec +from stripe._stripe_object import StripeObject +from typing import ClassVar, Dict, Optional +from typing_extensions import Literal + + +class BatchJob(StripeObject): + """ + BatchJob resource. + """ + + OBJECT_NAME: ClassVar[Literal["v2.core.batch_job"]] = "v2.core.batch_job" + + class StatusDetails(StripeObject): + class BatchFailed(StripeObject): + error: str + """ + Details about the `BatchJob` failure. + """ + + class Canceled(StripeObject): + class OutputFile(StripeObject): + class DownloadUrl(StripeObject): + expires_at: Optional[str] + """ + The time that the URL expires. + """ + url: str + """ + The URL that can be used for accessing the file. + """ + + content_type: str + """ + The content type of the file. + """ + download_url: DownloadUrl + """ + A pre-signed URL that allows secure, time-limited access to download the file. + """ + size: int + """ + The total size of the file in bytes. + """ + _inner_class_types = {"download_url": DownloadUrl} + + failure_count: int + """ + The total number of records that failed processing. + """ + output_file: OutputFile + """ + The output file details. If BatchJob is cancelled it's provided only if there is already output at this point. + """ + success_count: int + """ + The total number of records that were successfully processed. + """ + _inner_class_types = {"output_file": OutputFile} + + class Complete(StripeObject): + class OutputFile(StripeObject): + class DownloadUrl(StripeObject): + expires_at: Optional[str] + """ + The time that the URL expires. + """ + url: str + """ + The URL that can be used for accessing the file. + """ + + content_type: str + """ + The content type of the file. + """ + download_url: DownloadUrl + """ + A pre-signed URL that allows secure, time-limited access to download the file. + """ + size: int + """ + The total size of the file in bytes. + """ + _inner_class_types = {"download_url": DownloadUrl} + + failure_count: int + """ + The total number of records that failed processing. + """ + output_file: OutputFile + """ + The output file details. If BatchJob is cancelled it's provided only if there is already output at this point. + """ + success_count: int + """ + The total number of records that were successfully processed. + """ + _inner_class_types = {"output_file": OutputFile} + + class InProgress(StripeObject): + failure_count: int + """ + The number of records that failed processing so far. + """ + success_count: int + """ + The number of records that were successfully processed so far. + """ + + class ReadyForUpload(StripeObject): + class UploadUrl(StripeObject): + expires_at: Optional[str] + """ + The time that the URL expires. + """ + url: str + """ + The URL that can be used for accessing the file. + """ + + upload_url: UploadUrl + """ + The upload file details. + """ + _inner_class_types = {"upload_url": UploadUrl} + + class Timeout(StripeObject): + class OutputFile(StripeObject): + class DownloadUrl(StripeObject): + expires_at: Optional[str] + """ + The time that the URL expires. + """ + url: str + """ + The URL that can be used for accessing the file. + """ + + content_type: str + """ + The content type of the file. + """ + download_url: DownloadUrl + """ + A pre-signed URL that allows secure, time-limited access to download the file. + """ + size: int + """ + The total size of the file in bytes. + """ + _inner_class_types = {"download_url": DownloadUrl} + + failure_count: int + """ + The total number of records that failed processing. + """ + output_file: OutputFile + """ + The output file details. If BatchJob is cancelled it's provided only if there is already output at this point. + """ + success_count: int + """ + The total number of records that were successfully processed. + """ + _inner_class_types = {"output_file": OutputFile} + + class Validating(StripeObject): + validated_count: int + """ + The number of records that were validated. Note that there is no failure counter here; + once we have any validation failures we give up. + """ + + class ValidationFailed(StripeObject): + class OutputFile(StripeObject): + class DownloadUrl(StripeObject): + expires_at: Optional[str] + """ + The time that the URL expires. + """ + url: str + """ + The URL that can be used for accessing the file. + """ + + content_type: str + """ + The content type of the file. + """ + download_url: DownloadUrl + """ + A pre-signed URL that allows secure, time-limited access to download the file. + """ + size: int + """ + The total size of the file in bytes. + """ + _inner_class_types = {"download_url": DownloadUrl} + + failure_count: int + """ + The total number of records that failed processing. + """ + output_file: OutputFile + """ + The output file details. If BatchJob is cancelled it's provided only if there is already output at this point. + """ + success_count: int + """ + The total number of records that were successfully processed. + """ + _inner_class_types = {"output_file": OutputFile} + + batch_failed: Optional[BatchFailed] + """ + Additional details for the `BATCH_FAILED` status of the `BatchJob`. + """ + canceled: Optional[Canceled] + """ + Additional details for the `CANCELED` status of the `BatchJob`. + """ + complete: Optional[Complete] + """ + Additional details for the `COMPLETE` status of the `BatchJob`. + """ + in_progress: Optional[InProgress] + """ + Additional details for the `IN_PROGRESS` status of the `BatchJob`. + """ + ready_for_upload: Optional[ReadyForUpload] + """ + Additional details for the `READY_FOR_UPLOAD` status of the `BatchJob`. + """ + timeout: Optional[Timeout] + """ + Additional details for the `TIMEOUT` status of the `BatchJob`. + """ + validating: Optional[Validating] + """ + Additional details for the `VALIDATING` status of the `BatchJob`. + """ + validation_failed: Optional[ValidationFailed] + """ + Additional details for the `VALIDATION_FAILED` status of the `BatchJob`. + """ + _inner_class_types = { + "batch_failed": BatchFailed, + "canceled": Canceled, + "complete": Complete, + "in_progress": InProgress, + "ready_for_upload": ReadyForUpload, + "timeout": Timeout, + "validating": Validating, + "validation_failed": ValidationFailed, + } + + created: str + """ + Timestamp at which BatchJob was created. + """ + id: str + """ + Unique identifier for the BatchJob. + """ + livemode: bool + """ + Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + """ + maximum_rps: int + """ + The maximum rps defined for the `BatchJob`. + """ + metadata: Dict[str, str] + """ + The metadata of the `BatchJob` object. + """ + object: Literal["v2.core.batch_job"] + """ + String representing the object's type. Objects of the same type share the same value of the object field. + """ + skip_validation: bool + """ + If the validation will be run previous to the execution of the `BatchJob`. + """ + status: Literal[ + "batch_failed", + "canceled", + "cancelling", + "complete", + "in_progress", + "ready_for_upload", + "timeout", + "upload_timeout", + "validating", + "validation_failed", + ] + """ + The current status of the `BatchJob`. + """ + status_details: Optional[StatusDetails] + """ + Additional details about the current state of the `BatchJob`. + """ + _inner_class_types = {"status_details": StatusDetails} diff --git a/stripe/v2/core/_batch_job_service.py b/stripe/v2/core/_batch_job_service.py new file mode 100644 index 000000000..4028e4d7f --- /dev/null +++ b/stripe/v2/core/_batch_job_service.py @@ -0,0 +1,139 @@ +# -*- 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._request_options import RequestOptions + from stripe.params.v2.core._batch_job_cancel_params import ( + BatchJobCancelParams, + ) + from stripe.params.v2.core._batch_job_create_params import ( + BatchJobCreateParams, + ) + from stripe.params.v2.core._batch_job_retrieve_params import ( + BatchJobRetrieveParams, + ) + from stripe.v2.core._batch_job import BatchJob + + +class BatchJobService(StripeService): + def create( + self, + params: "BatchJobCreateParams", + options: Optional["RequestOptions"] = None, + ) -> "BatchJob": + """ + Creates a new batch job. + """ + return cast( + "BatchJob", + self._request( + "post", + "/v2/core/batch_jobs", + base_address="api", + params=params, + options=options, + ), + ) + + async def create_async( + self, + params: "BatchJobCreateParams", + options: Optional["RequestOptions"] = None, + ) -> "BatchJob": + """ + Creates a new batch job. + """ + return cast( + "BatchJob", + await self._request_async( + "post", + "/v2/core/batch_jobs", + base_address="api", + params=params, + options=options, + ), + ) + + def retrieve( + self, + id: str, + params: Optional["BatchJobRetrieveParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "BatchJob": + """ + Retrieves an existing batch job. + """ + return cast( + "BatchJob", + self._request( + "get", + "/v2/core/batch_jobs/{id}".format(id=sanitize_id(id)), + base_address="api", + params=params, + options=options, + ), + ) + + async def retrieve_async( + self, + id: str, + params: Optional["BatchJobRetrieveParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "BatchJob": + """ + Retrieves an existing batch job. + """ + return cast( + "BatchJob", + await self._request_async( + "get", + "/v2/core/batch_jobs/{id}".format(id=sanitize_id(id)), + base_address="api", + params=params, + options=options, + ), + ) + + def cancel( + self, + id: str, + params: Optional["BatchJobCancelParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "BatchJob": + """ + Cancels an existing batch job. + """ + return cast( + "BatchJob", + self._request( + "post", + "/v2/core/batch_jobs/{id}/cancel".format(id=sanitize_id(id)), + base_address="api", + params=params, + options=options, + ), + ) + + async def cancel_async( + self, + id: str, + params: Optional["BatchJobCancelParams"] = None, + options: Optional["RequestOptions"] = None, + ) -> "BatchJob": + """ + Cancels an existing batch job. + """ + return cast( + "BatchJob", + await self._request_async( + "post", + "/v2/core/batch_jobs/{id}/cancel".format(id=sanitize_id(id)), + base_address="api", + params=params, + options=options, + ), + ) diff --git a/stripe/v2/core/_event_destination.py b/stripe/v2/core/_event_destination.py index 02d4ca172..90cf9482d 100644 --- a/stripe/v2/core/_event_destination.py +++ b/stripe/v2/core/_event_destination.py @@ -30,9 +30,37 @@ class AmazonEventbridge(StripeObject): The state of the AWS event source. """ + class AzureEventGrid(StripeObject): + azure_partner_topic_name: str + """ + The name of the Azure partner topic. + """ + azure_partner_topic_status: Literal[ + "activated", "deleted", "never_activated", "unknown" + ] + """ + The status of the Azure partner topic. + """ + azure_region: str + """ + The Azure region. + """ + azure_resource_group_name: str + """ + The name of the Azure resource group. + """ + azure_subscription_id: str + """ + The Azure subscription ID. + """ + class StatusDetails(StripeObject): class Disabled(StripeObject): - reason: Literal["no_aws_event_source_exists", "user"] + reason: Literal[ + "no_aws_event_source_exists", + "no_azure_partner_topic_exists", + "user", + ] """ Reason event destination has been disabled. """ @@ -57,6 +85,10 @@ class WebhookEndpoint(StripeObject): """ Amazon EventBridge configuration. """ + azure_event_grid: Optional[AzureEventGrid] + """ + Azure Event Grid configuration. + """ created: str """ Time at which the object was created. @@ -73,9 +105,13 @@ class WebhookEndpoint(StripeObject): """ Payload type of events being subscribed to. """ - events_from: Optional[List[Literal["other_accounts", "self"]]] + events_from: Optional[List[str]] """ - Where events should be routed from. + Specifies which accounts' events route to this destination. + `@self`: Receive events from the account that owns the event destination. + `@accounts`: Receive events emitted from other accounts you manage which includes your v1 and v2 accounts. + `@organization_members`: Receive events from accounts directly linked to the organization. + `@organization_members/@accounts`: Receive events from all accounts connected to any platform accounts in the organization. """ id: str """ @@ -109,7 +145,7 @@ class WebhookEndpoint(StripeObject): """ Additional information about event destination status. """ - type: Literal["amazon_eventbridge", "webhook_endpoint"] + type: Literal["amazon_eventbridge", "azure_event_grid", "webhook_endpoint"] """ Event destination type. """ @@ -123,6 +159,7 @@ class WebhookEndpoint(StripeObject): """ _inner_class_types = { "amazon_eventbridge": AmazonEventbridge, + "azure_event_grid": AzureEventGrid, "status_details": StatusDetails, "webhook_endpoint": WebhookEndpoint, } diff --git a/stripe/v2/core/vault/_gb_bank_account.py b/stripe/v2/core/vault/_gb_bank_account.py index 52572adde..36545b39d 100644 --- a/stripe/v2/core/vault/_gb_bank_account.py +++ b/stripe/v2/core/vault/_gb_bank_account.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, List, Optional from typing_extensions import Literal @@ -124,10 +124,14 @@ class Provided(StripeObject): """ String representing the object's type. Objects of the same type share the same value of the object field. """ - sort_code: str + sort_code: Optional[str] """ The Sort Code of the bank account. """ + supported_currencies: List[str] + """ + The list of currencies supported by this bank account. + """ _inner_class_types = { "alternative_reference": AlternativeReference, "confirmation_of_payee": ConfirmationOfPayee, diff --git a/stripe/v2/core/vault/_us_bank_account.py b/stripe/v2/core/vault/_us_bank_account.py index b5827050a..00d58cd2c 100644 --- a/stripe/v2/core/vault/_us_bank_account.py +++ b/stripe/v2/core/vault/_us_bank_account.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, List, Optional from typing_extensions import Literal @@ -106,6 +106,10 @@ class MicrodepositVerificationDetails(StripeObject): """ The ACH routing number of the bank account. """ + supported_currencies: List[str] + """ + The list of currencies supported by this bank account. + """ verification: Verification """ The bank account verification details. diff --git a/stripe/v2/money_management/_adjustment.py b/stripe/v2/money_management/_adjustment.py index 87542ba4e..6006e2db5 100644 --- a/stripe/v2/money_management/_adjustment.py +++ b/stripe/v2/money_management/_adjustment.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._stripe_object import StripeObject +from stripe.v2._amount import Amount from typing import ClassVar, Optional from typing_extensions import Literal @@ -53,16 +54,6 @@ class AdjustedFlow(StripeObject): Closed Enum. If applicable, the type of flow linked to this Adjustment. The field matching this value will contain the ID of the flow. """ - class Amount(StripeObject): - 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). - """ - value: int - """ - A non-negative integer representing how much to charge in the [smallest currency unit](https://docs.stripe.com/currencies#minor-units). - """ - adjusted_flow: Optional[AdjustedFlow] """ If applicable, contains information about the original flow linked to this Adjustment. @@ -99,4 +90,4 @@ class Amount(StripeObject): """ A link to the Stripe-hosted receipt that is provided when money movement is considered regulated under Stripe's money transmission licenses. The receipt link remains active for 60 days from the Adjustment creation date. After this period, the link will expire and the receipt url value will be null. """ - _inner_class_types = {"adjusted_flow": AdjustedFlow, "amount": Amount} + _inner_class_types = {"adjusted_flow": AdjustedFlow} diff --git a/stripe/v2/money_management/_financial_account.py b/stripe/v2/money_management/_financial_account.py index f0c62c00a..a82cf048d 100644 --- a/stripe/v2/money_management/_financial_account.py +++ b/stripe/v2/money_management/_financial_account.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._stripe_object import StripeObject +from stripe.v2._amount import Amount from typing import ClassVar, Dict, List, Optional from typing_extensions import Literal @@ -15,58 +16,18 @@ class FinancialAccount(StripeObject): ) class Balance(StripeObject): - class Available(StripeObject): - 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). - """ - value: int - """ - A non-negative integer representing how much to charge in the [smallest currency unit](https://docs.stripe.com/currencies#minor-units). - """ - - class InboundPending(StripeObject): - 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). - """ - value: int - """ - A non-negative integer representing how much to charge in the [smallest currency unit](https://docs.stripe.com/currencies#minor-units). - """ - - class OutboundPending(StripeObject): - 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). - """ - value: int - """ - A non-negative integer representing how much to charge in the [smallest currency unit](https://docs.stripe.com/currencies#minor-units). - """ - - available: Dict[str, Available] + available: Dict[str, Amount] """ Balance that can be used for money movement. """ - inbound_pending: Dict[str, InboundPending] + inbound_pending: Dict[str, Amount] """ Balance of inbound funds that will later transition to the `available` balance. """ - outbound_pending: Dict[str, OutboundPending] + outbound_pending: Dict[str, Amount] """ Balance of funds that are being used for a pending outbound money movement. """ - _inner_class_types = { - "available": Available, - "inbound_pending": InboundPending, - "outbound_pending": OutboundPending, - } - _inner_class_dicts = [ - "available", - "inbound_pending", - "outbound_pending", - ] class Other(StripeObject): type: str @@ -87,10 +48,19 @@ class ForwardingSettings(StripeObject): """ forwarding_settings: Optional[ForwardingSettings] + """ + The forwarding settings for the closed FinancialAccount. + """ reason: Literal["account_closed", "closed_by_platform", "other"] + """ + The reason the FinancialAccount was closed. + """ _inner_class_types = {"forwarding_settings": ForwardingSettings} closed: Optional[Closed] + """ + Details related to the closed state of the FinancialAccount. + """ _inner_class_types = {"closed": Closed} class Storage(StripeObject): @@ -140,6 +110,9 @@ class Storage(StripeObject): Closed Enum. An enum representing the status of the FinancialAccount. This indicates whether or not the FinancialAccount can be used for any money movement flows. """ status_details: Optional[StatusDetails] + """ + Additional details related to the status of the FinancialAccount. + """ storage: Optional[Storage] """ If this is a `storage` FinancialAccount, this hash includes details specific to `storage` FinancialAccounts. diff --git a/stripe/v2/money_management/_inbound_transfer.py b/stripe/v2/money_management/_inbound_transfer.py index 463523c93..c08bda17a 100644 --- a/stripe/v2/money_management/_inbound_transfer.py +++ b/stripe/v2/money_management/_inbound_transfer.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._stripe_object import StripeObject +from stripe.v2._amount import Amount from typing import Any, ClassVar, Dict, List, Optional from typing_extensions import Literal @@ -15,27 +16,7 @@ class InboundTransfer(StripeObject): "v2.money_management.inbound_transfer" ) - class Amount(StripeObject): - 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). - """ - value: int - """ - A non-negative integer representing how much to charge in the [smallest currency unit](https://docs.stripe.com/currencies#minor-units). - """ - class From(StripeObject): - class Debited(StripeObject): - 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). - """ - value: int - """ - A non-negative integer representing how much to charge in the [smallest currency unit](https://docs.stripe.com/currencies#minor-units). - """ - class PaymentMethod(StripeObject): type: str """ @@ -46,7 +27,7 @@ class PaymentMethod(StripeObject): The destination US bank account identifier. eg "usba_***". """ - debited: Debited + debited: Amount """ The amount in specified currency that was debited from the Payment Method. """ @@ -54,23 +35,10 @@ class PaymentMethod(StripeObject): """ The Payment Method object used to create the InboundTransfer. """ - _inner_class_types = { - "debited": Debited, - "payment_method": PaymentMethod, - } + _inner_class_types = {"payment_method": PaymentMethod} class To(StripeObject): - class Credited(StripeObject): - 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). - """ - value: int - """ - A non-negative integer representing how much to charge in the [smallest currency unit](https://docs.stripe.com/currencies#minor-units). - """ - - credited: Credited + credited: Amount """ The amount by which the FinancialAccount balance is credited. """ @@ -78,7 +46,6 @@ class Credited(StripeObject): """ The FinancialAccount that funds will land in. """ - _inner_class_types = {"credited": Credited} class TransferHistory(StripeObject): class BankDebitFailed(StripeObject): @@ -197,7 +164,6 @@ class BankDebitReturned(StripeObject): A list of history objects, representing changes in the state of the InboundTransfer. """ _inner_class_types = { - "amount": Amount, "from": From, "to": To, "transfer_history": TransferHistory, diff --git a/stripe/v2/money_management/_outbound_payment.py b/stripe/v2/money_management/_outbound_payment.py index a67272608..c531b3366 100644 --- a/stripe/v2/money_management/_outbound_payment.py +++ b/stripe/v2/money_management/_outbound_payment.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._stripe_object import StripeObject +from stripe.v2._amount import Amount from typing import ClassVar, Dict, Optional from typing_extensions import Literal @@ -14,16 +15,6 @@ class OutboundPayment(StripeObject): "v2.money_management.outbound_payment" ) - class Amount(StripeObject): - 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). - """ - value: int - """ - A non-negative integer representing how much to charge in the [smallest currency unit](https://docs.stripe.com/currencies#minor-units). - """ - class DeliveryOptions(StripeObject): bank_account: Optional[Literal["automatic", "local", "wire"]] """ @@ -31,17 +22,7 @@ class DeliveryOptions(StripeObject): """ class From(StripeObject): - class Debited(StripeObject): - 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). - """ - value: int - """ - A non-negative integer representing how much to charge in the [smallest currency unit](https://docs.stripe.com/currencies#minor-units). - """ - - debited: Debited + debited: Amount """ The monetary amount debited from the sender, only set on responses. """ @@ -49,7 +30,6 @@ class Debited(StripeObject): """ The FinancialAccount that funds were pulled from. """ - _inner_class_types = {"debited": Debited} class RecipientNotification(StripeObject): setting: Literal["configured", "none"] @@ -123,17 +103,7 @@ class StatusTransitions(StripeObject): """ class To(StripeObject): - class Credited(StripeObject): - 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). - """ - value: int - """ - A non-negative integer representing how much to charge in the [smallest currency unit](https://docs.stripe.com/currencies#minor-units). - """ - - credited: Credited + credited: Amount """ The monetary amount being credited to the destination. """ @@ -145,7 +115,6 @@ class Credited(StripeObject): """ To which account the OutboundPayment is sent. """ - _inner_class_types = {"credited": Credited} class TraceId(StripeObject): status: Literal["pending", "supported", "unsupported"] @@ -247,10 +216,9 @@ class TraceId(StripeObject): """ trace_id: TraceId """ - A unique identifier that can be used to track this OutboundPayment with recipient bank. Banks might call this a “reference number” or something similar. + A unique identifier that can be used to track this OutboundPayment with recipient bank. Banks might call this a "reference number" or something similar. """ _inner_class_types = { - "amount": Amount, "delivery_options": DeliveryOptions, "from": From, "recipient_notification": RecipientNotification, diff --git a/stripe/v2/money_management/_outbound_payment_quote.py b/stripe/v2/money_management/_outbound_payment_quote.py index 2e9667f7c..e918e753a 100644 --- a/stripe/v2/money_management/_outbound_payment_quote.py +++ b/stripe/v2/money_management/_outbound_payment_quote.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._stripe_object import StripeObject +from stripe.v2._amount import Amount from typing import ClassVar, Dict, List, Optional from typing_extensions import Literal @@ -14,16 +15,6 @@ class OutboundPaymentQuote(StripeObject): Literal["v2.money_management.outbound_payment_quote"] ] = "v2.money_management.outbound_payment_quote" - class Amount(StripeObject): - 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). - """ - value: int - """ - A non-negative integer representing how much to charge in the [smallest currency unit](https://docs.stripe.com/currencies#minor-units). - """ - class DeliveryOptions(StripeObject): bank_account: Optional[Literal["automatic", "local", "wire"]] """ @@ -31,16 +22,6 @@ class DeliveryOptions(StripeObject): """ class EstimatedFee(StripeObject): - class Amount(StripeObject): - 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). - """ - value: int - """ - A non-negative integer representing how much to charge in the [smallest currency unit](https://docs.stripe.com/currencies#minor-units). - """ - amount: Amount """ The fee amount for corresponding fee type. @@ -55,20 +36,9 @@ class Amount(StripeObject): """ The fee type. """ - _inner_class_types = {"amount": Amount} class From(StripeObject): - class Debited(StripeObject): - 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). - """ - value: int - """ - A non-negative integer representing how much to charge in the [smallest currency unit](https://docs.stripe.com/currencies#minor-units). - """ - - debited: Debited + debited: Amount """ The monetary amount debited from the sender, only set on responses. """ @@ -76,7 +46,6 @@ class Debited(StripeObject): """ The FinancialAccount that funds were pulled from. """ - _inner_class_types = {"debited": Debited} class FxQuote(StripeObject): class Rates(StripeObject): @@ -109,17 +78,7 @@ class Rates(StripeObject): _inner_class_dicts = ["rates"] class To(StripeObject): - class Credited(StripeObject): - 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). - """ - value: int - """ - A non-negative integer representing how much to charge in the [smallest currency unit](https://docs.stripe.com/currencies#minor-units). - """ - - credited: Credited + credited: Amount """ The monetary amount being credited to the destination. """ @@ -131,7 +90,6 @@ class Credited(StripeObject): """ To which account the OutboundPayment is sent. """ - _inner_class_types = {"credited": Credited} amount: Amount """ @@ -175,7 +133,6 @@ class Credited(StripeObject): Details about the recipient of an OutboundPaymentQuote. """ _inner_class_types = { - "amount": Amount, "delivery_options": DeliveryOptions, "estimated_fees": EstimatedFee, "from": From, diff --git a/stripe/v2/money_management/_outbound_transfer.py b/stripe/v2/money_management/_outbound_transfer.py index 31714ceec..159872998 100644 --- a/stripe/v2/money_management/_outbound_transfer.py +++ b/stripe/v2/money_management/_outbound_transfer.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._stripe_object import StripeObject +from stripe.v2._amount import Amount from typing import ClassVar, Dict, Optional from typing_extensions import Literal @@ -14,16 +15,6 @@ class OutboundTransfer(StripeObject): "v2.money_management.outbound_transfer" ) - class Amount(StripeObject): - 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). - """ - value: int - """ - A non-negative integer representing how much to charge in the [smallest currency unit](https://docs.stripe.com/currencies#minor-units). - """ - class DeliveryOptions(StripeObject): bank_account: Optional[Literal["automatic", "local", "wire"]] """ @@ -31,17 +22,7 @@ class DeliveryOptions(StripeObject): """ class From(StripeObject): - class Debited(StripeObject): - 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). - """ - value: int - """ - A non-negative integer representing how much to charge in the [smallest currency unit](https://docs.stripe.com/currencies#minor-units). - """ - - debited: Debited + debited: Amount """ The monetary amount debited from the sender, only set on responses. """ @@ -49,7 +30,6 @@ class Debited(StripeObject): """ The FinancialAccount that funds were pulled from. """ - _inner_class_types = {"debited": Debited} class StatusDetails(StripeObject): class Failed(StripeObject): @@ -116,17 +96,7 @@ class StatusTransitions(StripeObject): """ class To(StripeObject): - class Credited(StripeObject): - 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). - """ - value: int - """ - A non-negative integer representing how much to charge in the [smallest currency unit](https://docs.stripe.com/currencies#minor-units). - """ - - credited: Credited + credited: Amount """ The monetary amount being credited to the destination. """ @@ -134,7 +104,6 @@ class Credited(StripeObject): """ The payout method which the OutboundTransfer uses to send payout. """ - _inner_class_types = {"credited": Credited} class TraceId(StripeObject): status: Literal["pending", "supported", "unsupported"] @@ -224,10 +193,9 @@ class TraceId(StripeObject): """ trace_id: TraceId """ - A unique identifier that can be used to track this OutboundTransfer with recipient bank. Banks might call this a “reference number” or something similar. + A unique identifier that can be used to track this OutboundTransfer with recipient bank. Banks might call this a "reference number" or something similar. """ _inner_class_types = { - "amount": Amount, "delivery_options": DeliveryOptions, "from": From, "status_details": StatusDetails, diff --git a/stripe/v2/money_management/_payout_method.py b/stripe/v2/money_management/_payout_method.py index 47dcba258..baf4381b3 100644 --- a/stripe/v2/money_management/_payout_method.py +++ b/stripe/v2/money_management/_payout_method.py @@ -96,6 +96,10 @@ class Card(StripeObject): """ The last 4 digits of the card number. """ + supported_currencies: List[str] + """ + The list of currencies supported by this bank account. + """ class UsageStatus(StripeObject): payments: Literal["eligible", "invalid", "requires_action"] @@ -143,6 +147,11 @@ class UsageStatus(StripeObject): """ String representing the object's type. Objects of the same type share the same value of the object field. """ + restricted: bool + """ + Whether the Payout Method is currently unusable for money movement, despite potentially being correctly set up. + Please reach out to Stripe Support for more information. + """ type: Literal["bank_account", "card", "crypto_wallet"] """ Closed Enum. The type of payout method. diff --git a/stripe/v2/money_management/_payout_methods_bank_account_spec.py b/stripe/v2/money_management/_payout_methods_bank_account_spec.py index 1042f9223..16ef81889 100644 --- a/stripe/v2/money_management/_payout_methods_bank_account_spec.py +++ b/stripe/v2/money_management/_payout_methods_bank_account_spec.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._stripe_object import StripeObject -from typing import ClassVar, Dict, List +from typing import ClassVar, Dict, List, Optional from typing_extensions import Literal @@ -26,6 +26,10 @@ class LocalNameHuman(StripeObject): A unique key representing the instance of this localizable string. """ + currencies: Optional[List[str]] + """ + The currencies supported by the corresponding credentials for bank accounts in the specified country. + """ local_name: str """ The local name of the field. diff --git a/stripe/v2/money_management/_received_credit.py b/stripe/v2/money_management/_received_credit.py index 902d05a58..b09feeebe 100644 --- a/stripe/v2/money_management/_received_credit.py +++ b/stripe/v2/money_management/_received_credit.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._stripe_object import StripeObject +from stripe.v2._amount import Amount from typing import ClassVar, Optional from typing_extensions import Literal @@ -14,16 +15,6 @@ class ReceivedCredit(StripeObject): "v2.money_management.received_credit" ) - class Amount(StripeObject): - 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). - """ - value: int - """ - A non-negative integer representing how much to charge in the [smallest currency unit](https://docs.stripe.com/currencies#minor-units). - """ - class BalanceTransfer(StripeObject): from_account: Optional[str] """ @@ -254,7 +245,6 @@ class StatusTransitions(StripeObject): Open Enum. The type of flow that caused the ReceivedCredit. """ _inner_class_types = { - "amount": Amount, "balance_transfer": BalanceTransfer, "bank_transfer": BankTransfer, "status_details": StatusDetails, diff --git a/stripe/v2/money_management/_received_debit.py b/stripe/v2/money_management/_received_debit.py index f0dead6d5..b50f6b432 100644 --- a/stripe/v2/money_management/_received_debit.py +++ b/stripe/v2/money_management/_received_debit.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._stripe_object import StripeObject +from stripe.v2._amount import Amount from typing import ClassVar, Optional from typing_extensions import Literal @@ -14,16 +15,6 @@ class ReceivedDebit(StripeObject): "v2.money_management.received_debit" ) - class Amount(StripeObject): - 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). - """ - value: int - """ - A non-negative integer representing how much to charge in the [smallest currency unit](https://docs.stripe.com/currencies#minor-units). - """ - class BankTransfer(StripeObject): class UsBankAccount(StripeObject): bank_name: Optional[str] @@ -143,10 +134,9 @@ class StatusTransitions(StripeObject): """ type: Literal["bank_transfer", "external_debit"] """ - Open enum, the type of the received debit. + Open Enum. The type of the ReceivedDebit. """ _inner_class_types = { - "amount": Amount, "bank_transfer": BankTransfer, "status_details": StatusDetails, "status_transitions": StatusTransitions, diff --git a/stripe/v2/money_management/_transaction.py b/stripe/v2/money_management/_transaction.py index 4065a9a9e..abcd7e4ee 100644 --- a/stripe/v2/money_management/_transaction.py +++ b/stripe/v2/money_management/_transaction.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._stripe_object import StripeObject +from stripe.v2._amount import Amount from typing import ClassVar, Optional from typing_extensions import Literal @@ -14,64 +15,25 @@ class Transaction(StripeObject): "v2.money_management.transaction" ) - class Amount(StripeObject): - 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). - """ - value: int - """ - A non-negative integer representing how much to charge in the [smallest currency unit](https://docs.stripe.com/currencies#minor-units). - """ - class BalanceImpact(StripeObject): - class Available(StripeObject): - 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). - """ - value: int - """ - A non-negative integer representing how much to charge in the [smallest currency unit](https://docs.stripe.com/currencies#minor-units). - """ - - class InboundPending(StripeObject): - 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). - """ - value: int - """ - A non-negative integer representing how much to charge in the [smallest currency unit](https://docs.stripe.com/currencies#minor-units). - """ - - class OutboundPending(StripeObject): - 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). - """ - value: int - """ - A non-negative integer representing how much to charge in the [smallest currency unit](https://docs.stripe.com/currencies#minor-units). - """ - - available: Available + available: Amount """ Impact to the available balance. """ - inbound_pending: InboundPending + inbound_pending: Amount """ Impact to the inbound_pending balance. """ - outbound_pending: OutboundPending + outbound_pending: Amount """ Impact to the outbound_pending balance. """ - _inner_class_types = { - "available": Available, - "inbound_pending": InboundPending, - "outbound_pending": OutboundPending, - } + + class Counterparty(StripeObject): + name: Optional[str] + """ + Name of the counterparty. + """ class Flow(StripeObject): adjustment: Optional[str] @@ -153,10 +115,19 @@ class StatusTransitions(StripeObject): """ Open Enum. A descriptive category used to classify the Transaction. """ + counterparty: Optional[Counterparty] + """ + Counterparty to this Transaction. + """ created: str """ Time at which the object was created. Represented as a RFC 3339 date & time UTC value in millisecond precision, for example: 2022-09-18T13:22:18.123Z. """ + description: Optional[str] + """ + Description of this Transaction. When applicable, the description is copied from the Flow object at the time + of transaction creation. + """ financial_account: str """ Indicates the FinancialAccount affected by this Transaction. @@ -190,8 +161,8 @@ class StatusTransitions(StripeObject): Timestamps for when the Transaction transitioned to a particular status. """ _inner_class_types = { - "amount": Amount, "balance_impact": BalanceImpact, + "counterparty": Counterparty, "flow": Flow, "status_transitions": StatusTransitions, } diff --git a/stripe/v2/money_management/_transaction_entry.py b/stripe/v2/money_management/_transaction_entry.py index 072f3f0c5..9ddf572ce 100644 --- a/stripe/v2/money_management/_transaction_entry.py +++ b/stripe/v2/money_management/_transaction_entry.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._stripe_object import StripeObject +from stripe.v2._amount import Amount from typing import ClassVar, Optional from typing_extensions import Literal @@ -15,53 +16,18 @@ class TransactionEntry(StripeObject): ) class BalanceImpact(StripeObject): - class Available(StripeObject): - 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). - """ - value: int - """ - A non-negative integer representing how much to charge in the [smallest currency unit](https://docs.stripe.com/currencies#minor-units). - """ - - class InboundPending(StripeObject): - 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). - """ - value: int - """ - A non-negative integer representing how much to charge in the [smallest currency unit](https://docs.stripe.com/currencies#minor-units). - """ - - class OutboundPending(StripeObject): - 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). - """ - value: int - """ - A non-negative integer representing how much to charge in the [smallest currency unit](https://docs.stripe.com/currencies#minor-units). - """ - - available: Available + available: Amount """ Impact to the available balance. """ - inbound_pending: InboundPending + inbound_pending: Amount """ Impact to the inbound_pending balance. """ - outbound_pending: OutboundPending + outbound_pending: Amount """ Impact to the outbound_pending balance. """ - _inner_class_types = { - "available": Available, - "inbound_pending": InboundPending, - "outbound_pending": OutboundPending, - } class TransactionDetails(StripeObject): class Flow(StripeObject): diff --git a/tests/api_resources/abstract/test_custom_method.py b/tests/api_resources/abstract/test_custom_method.py index 71fc51322..1eec25a13 100644 --- a/tests/api_resources/abstract/test_custom_method.py +++ b/tests/api_resources/abstract/test_custom_method.py @@ -44,7 +44,7 @@ def do_stuff_new_codegen(self, **params): return self._request( "post", "/v1/myresources/{id}/do_the_thing".format( - id=sanitize_id(self.get("id")) + id=sanitize_id(self.id) ), params=params, ) diff --git a/tests/api_resources/abstract/test_updateable_api_resource.py b/tests/api_resources/abstract/test_updateable_api_resource.py index fe4194972..60c3b0e8f 100644 --- a/tests/api_resources/abstract/test_updateable_api_resource.py +++ b/tests/api_resources/abstract/test_updateable_api_resource.py @@ -283,7 +283,9 @@ def test_save_replace_metadata(self, http_client_mock, obj): def test_save_update_metadata(self, http_client_mock, obj): obj.baz = "updated" obj.other = "newval" - obj.metadata.update({"size": "m", "info": "a2", "score": 4}) + obj.metadata["size"] = "m" + obj.metadata["info"] = "a2" + obj.metadata["score"] = 4 self.checkSave(obj) diff --git a/tests/api_resources/test_account.py b/tests/api_resources/test_account.py index 1351099d5..1f094e241 100644 --- a/tests/api_resources/test_account.py +++ b/tests/api_resources/test_account.py @@ -54,7 +54,7 @@ def test_is_saveable_with_individual(self, http_client_mock): http_client_mock.stub_request( "post", path="/v1/accounts/%s" % TEST_RESOURCE_ID, - rbody=json.dumps(account.to_dict_recursive()), + rbody=json.dumps(account._to_dict_recursive()), ) resource = account.save() http_client_mock.assert_requested( diff --git a/tests/test_api_requestor.py b/tests/test_api_requestor.py index 17173c016..4a3de5a04 100644 --- a/tests/test_api_requestor.py +++ b/tests/test_api_requestor.py @@ -296,7 +296,7 @@ def test_empty_methods(self, requestor, http_client_mock): http_client_mock.assert_requested(meth, post_data=post_data) assert isinstance(resp, StripeObject) - assert resp == {} + assert resp.to_dict() == {} @pytest.mark.anyio async def test_empty_methods_async(self, requestor, http_client_mock): @@ -320,7 +320,7 @@ async def test_empty_methods_async(self, requestor, http_client_mock): http_client_mock.assert_requested(meth, post_data=post_data) assert isinstance(resp, StripeObject) - assert resp == {} + assert resp.to_dict() == {} @pytest.mark.anyio async def test_empty_methods_streaming_response_async( @@ -415,7 +415,7 @@ def test_methods_with_params_and_response( ) assert isinstance(resp, StripeObject) - assert resp == {"foo": "bar", "baz": 6} + assert resp.to_dict() == {"foo": "bar", "baz": 6} if method == "post": http_client_mock.assert_requested( @@ -780,6 +780,7 @@ def fail(): mocker.patch("platform.platform", side_effect=fail) + stripe.enable_telemetry = True requestor.request("get", self.v1_path, {}, {}, base_address="api") last_call = http_client_mock.get_last_call() @@ -791,6 +792,26 @@ def fail(): == "(disabled)" ) + def test_platform_only_used_with_telemetry( + self, requestor, mocker, http_client_mock + ): + http_client_mock.stub_request( + "get", path=self.v1_path, rbody="{}", rcode=200 + ) + + def fail(): + raise RuntimeError + + mocker.patch("platform.platform", side_effect=fail) + + requestor.request("get", self.v1_path, {}, {}, base_address="api") + + last_call = http_client_mock.get_last_call() + last_call.assert_method("get") + assert "platform" not in json.loads( + last_call.get_raw_header("X-Stripe-Client-User-Agent") + ) + def test_uses_given_idempotency_key(self, requestor, http_client_mock): method = "post" http_client_mock.stub_request( diff --git a/tests/test_generated_examples.py b/tests/test_generated_examples.py index 89f09ee36..aae08ca29 100644 --- a/tests/test_generated_examples.py +++ b/tests/test_generated_examples.py @@ -44593,6 +44593,76 @@ def test_v2_core_account_token_get_service( api_base="https://api.stripe.com", ) + def test_v2_core_batch_job_post_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v2/core/batch_jobs", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.core.batch_jobs.create( + { + "endpoint": {"http_method": "post", "path": "path"}, + "metadata": {"key": "metadata"}, + "skip_validation": True, + } + ) + http_client_mock.assert_requested( + "post", + path="/v2/core/batch_jobs", + query_string="", + api_base="https://api.stripe.com", + post_data='{"endpoint":{"http_method":"post","path":"path"},"metadata":{"key":"metadata"},"skip_validation":true}', + is_json=True, + ) + + def test_v2_core_batch_job_get_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "get", + "/v2/core/batch_jobs/id_123", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.core.batch_jobs.retrieve("id_123") + http_client_mock.assert_requested( + "get", + path="/v2/core/batch_jobs/id_123", + query_string="", + api_base="https://api.stripe.com", + ) + + def test_v2_core_batch_job_post_2_service( + self, http_client_mock: HTTPClientMock + ) -> None: + http_client_mock.stub_request( + "post", + "/v2/core/batch_jobs/id_123/cancel", + ) + client = StripeClient( + "sk_test_123", + http_client=http_client_mock.get_mock_http_client(), + ) + + client.v2.core.batch_jobs.cancel("id_123") + http_client_mock.assert_requested( + "post", + path="/v2/core/batch_jobs/id_123/cancel", + query_string="", + api_base="https://api.stripe.com", + post_data="{}", + is_json=True, + ) + def test_v2_core_event_get_service( self, http_client_mock: HTTPClientMock ) -> None: @@ -44842,18 +44912,13 @@ def test_v2_core_vault_gb_bank_account_post_service( http_client=http_client_mock.get_mock_http_client(), ) - client.v2.core.vault.gb_bank_accounts.create( - { - "account_number": "account_number", - "sort_code": "sort_code", - } - ) + client.v2.core.vault.gb_bank_accounts.create({"currency": "usd"}) http_client_mock.assert_requested( "post", path="/v2/core/vault/gb_bank_accounts", query_string="", api_base="https://api.stripe.com", - post_data='{"account_number":"account_number","sort_code":"sort_code"}', + post_data='{"currency":"usd"}', is_json=True, ) @@ -44982,6 +45047,7 @@ def test_v2_core_vault_us_bank_account_post_service( client.v2.core.vault.us_bank_accounts.create( { "account_number": "account_number", + "currency": "usd", } ) http_client_mock.assert_requested( @@ -44989,7 +45055,7 @@ def test_v2_core_vault_us_bank_account_post_service( path="/v2/core/vault/us_bank_accounts", query_string="", api_base="https://api.stripe.com", - post_data='{"account_number":"account_number"}', + post_data='{"account_number":"account_number","currency":"usd"}', is_json=True, ) @@ -45352,7 +45418,7 @@ def test_v2_money_management_inbound_transfer_post_service( client.v2.money_management.inbound_transfers.create( { - "amount": {"value": 111972721, "currency": "usd"}, + "amount": {"currency": "USD", "value": 96}, "from": { "currency": "usd", "payment_method": "payment_method", @@ -45368,7 +45434,7 @@ def test_v2_money_management_inbound_transfer_post_service( path="/v2/money_management/inbound_transfers", query_string="", api_base="https://api.stripe.com", - post_data='{"amount":{"value":111972721,"currency":"usd"},"from":{"currency":"usd","payment_method":"payment_method"},"to":{"currency":"usd","financial_account":"financial_account"}}', + post_data='{"amount":{"currency":"USD","value":96},"from":{"currency":"usd","payment_method":"payment_method"},"to":{"currency":"usd","financial_account":"financial_account"}}', is_json=True, ) @@ -45426,7 +45492,7 @@ def test_v2_money_management_outbound_payment_post_service( client.v2.money_management.outbound_payments.create( { - "amount": {"value": 111972721, "currency": "usd"}, + "amount": {"currency": "USD", "value": 96}, "from": { "currency": "usd", "financial_account": "financial_account", @@ -45443,7 +45509,7 @@ def test_v2_money_management_outbound_payment_post_service( path="/v2/money_management/outbound_payments", query_string="", api_base="https://api.stripe.com", - post_data='{"amount":{"value":111972721,"currency":"usd"},"from":{"currency":"usd","financial_account":"financial_account"},"to":{"currency":"usd","payout_method":"payout_method","recipient":"recipient"}}', + post_data='{"amount":{"currency":"USD","value":96},"from":{"currency":"usd","financial_account":"financial_account"},"to":{"currency":"usd","payout_method":"payout_method","recipient":"recipient"}}', is_json=True, ) @@ -45503,7 +45569,7 @@ def test_v2_money_management_outbound_payment_quote_post_service( client.v2.money_management.outbound_payment_quotes.create( { - "amount": {"value": 111972721, "currency": "usd"}, + "amount": {"currency": "USD", "value": 96}, "from": { "currency": "usd", "financial_account": "financial_account", @@ -45520,7 +45586,7 @@ def test_v2_money_management_outbound_payment_quote_post_service( path="/v2/money_management/outbound_payment_quotes", query_string="", api_base="https://api.stripe.com", - post_data='{"amount":{"value":111972721,"currency":"usd"},"from":{"currency":"usd","financial_account":"financial_account"},"to":{"currency":"usd","payout_method":"payout_method","recipient":"recipient"}}', + post_data='{"amount":{"currency":"USD","value":96},"from":{"currency":"usd","financial_account":"financial_account"},"to":{"currency":"usd","payout_method":"payout_method","recipient":"recipient"}}', is_json=True, ) @@ -45684,7 +45750,7 @@ def test_v2_money_management_outbound_transfer_post_service( client.v2.money_management.outbound_transfers.create( { - "amount": {"value": 111972721, "currency": "usd"}, + "amount": {"currency": "USD", "value": 96}, "from": { "currency": "usd", "financial_account": "financial_account", @@ -45697,7 +45763,7 @@ def test_v2_money_management_outbound_transfer_post_service( path="/v2/money_management/outbound_transfers", query_string="", api_base="https://api.stripe.com", - post_data='{"amount":{"value":111972721,"currency":"usd"},"from":{"currency":"usd","financial_account":"financial_account"},"to":{"currency":"usd","payout_method":"payout_method"}}', + post_data='{"amount":{"currency":"USD","value":96},"from":{"currency":"usd","financial_account":"financial_account"},"to":{"currency":"usd","payout_method":"payout_method"}}', is_json=True, ) @@ -46021,17 +46087,14 @@ def test_v2_test_helpers_financial_address_post_service( client.v2.test_helpers.financial_addresses.credit( "id_123", - { - "amount": {"value": 111972721, "currency": "usd"}, - "network": "rtp", - }, + {"amount": {"currency": "USD", "value": 96}, "network": "rtp"}, ) http_client_mock.assert_requested( "post", path="/v2/test_helpers/financial_addresses/id_123/credit", query_string="", api_base="https://api.stripe.com", - post_data='{"amount":{"value":111972721,"currency":"usd"},"network":"rtp"}', + post_data='{"amount":{"currency":"USD","value":96},"network":"rtp"}', is_json=True, ) @@ -46135,6 +46198,7 @@ def test_blocked_by_stripe_error_service( client.v2.core.vault.us_bank_accounts.create( { "account_number": "account_number", + "currency": "usd", } ) except _error.BlockedByStripeError: @@ -46144,7 +46208,7 @@ def test_blocked_by_stripe_error_service( path="/v2/core/vault/us_bank_accounts", query_string="", api_base="https://api.stripe.com", - post_data='{"account_number":"account_number"}', + post_data='{"account_number":"account_number","currency":"usd"}', is_json=True, ) @@ -46282,7 +46346,7 @@ def test_insufficient_funds_error_service( try: client.v2.money_management.outbound_payments.create( { - "amount": {"value": 111972721, "currency": "usd"}, + "amount": {"currency": "USD", "value": 96}, "from": { "currency": "usd", "financial_account": "financial_account", @@ -46297,7 +46361,7 @@ def test_insufficient_funds_error_service( path="/v2/money_management/outbound_payments", query_string="", api_base="https://api.stripe.com", - post_data='{"amount":{"value":111972721,"currency":"usd"},"from":{"currency":"usd","financial_account":"financial_account"},"to":{"recipient":"recipient"}}', + post_data='{"amount":{"currency":"USD","value":96},"from":{"currency":"usd","financial_account":"financial_account"},"to":{"recipient":"recipient"}}', is_json=True, ) @@ -46319,6 +46383,7 @@ def test_invalid_payment_method_error_service( client.v2.core.vault.us_bank_accounts.create( { "account_number": "account_number", + "currency": "usd", } ) except _error.InvalidPaymentMethodError: @@ -46328,7 +46393,7 @@ def test_invalid_payment_method_error_service( path="/v2/core/vault/us_bank_accounts", query_string="", api_base="https://api.stripe.com", - post_data='{"account_number":"account_number"}', + post_data='{"account_number":"account_number","currency":"usd"}', is_json=True, ) @@ -46431,6 +46496,7 @@ def test_quota_exceeded_error_service( client.v2.core.vault.us_bank_accounts.create( { "account_number": "account_number", + "currency": "usd", } ) except _error.QuotaExceededError: @@ -46440,7 +46506,7 @@ def test_quota_exceeded_error_service( path="/v2/core/vault/us_bank_accounts", query_string="", api_base="https://api.stripe.com", - post_data='{"account_number":"account_number"}', + post_data='{"account_number":"account_number","currency":"usd"}', is_json=True, ) @@ -46486,7 +46552,7 @@ def test_recipient_not_notifiable_error_service( try: client.v2.money_management.outbound_payments.create( { - "amount": {"value": 111972721, "currency": "usd"}, + "amount": {"currency": "USD", "value": 96}, "from": { "currency": "usd", "financial_account": "financial_account", @@ -46501,7 +46567,7 @@ def test_recipient_not_notifiable_error_service( path="/v2/money_management/outbound_payments", query_string="", api_base="https://api.stripe.com", - post_data='{"amount":{"value":111972721,"currency":"usd"},"from":{"currency":"usd","financial_account":"financial_account"},"to":{"recipient":"recipient"}}', + post_data='{"amount":{"currency":"USD","value":96},"from":{"currency":"usd","financial_account":"financial_account"},"to":{"recipient":"recipient"}}', is_json=True, ) diff --git a/tests/test_int64_string.py b/tests/test_int64_string.py new file mode 100644 index 000000000..44825d890 --- /dev/null +++ b/tests/test_int64_string.py @@ -0,0 +1,266 @@ +""" +Tests for V2 int64_string field encoding and decoding. + +V2 API int64 fields are encoded as strings on the wire but exposed as +native Python ints. These tests verify both directions: +- Request serialization: int → JSON string +- Response hydration: JSON string → int +""" + +from stripe._encode import _coerce_int64_string, _coerce_v2_params +from stripe._stripe_object import StripeObject + + +class TestCoerceInt64String: + """Tests for the shared bidirectional coercion helper.""" + + def test_encode_int_to_str(self): + assert _coerce_int64_string(42, encode=True) == "42" + + def test_decode_str_to_int(self): + assert _coerce_int64_string("42", encode=False) == 42 + + def test_encode_list(self): + assert _coerce_int64_string([1, 2, 3], encode=True) == ["1", "2", "3"] + + def test_decode_list(self): + assert _coerce_int64_string(["1", "2", "3"], encode=False) == [1, 2, 3] + + def test_none_passthrough(self): + assert _coerce_int64_string(None, encode=True) is None + assert _coerce_int64_string(None, encode=False) is None + + def test_wrong_type_passthrough(self): + assert ( + _coerce_int64_string("already_str", encode=True) == "already_str" + ) + assert _coerce_int64_string(42, encode=False) == 42 + + +class TestCoerceV2Params: + """Tests for outbound request coercion (int → str).""" + + def test_top_level_int64_string(self): + params = {"amount": 12345} + schema = {"amount": "int64_string"} + result = _coerce_v2_params(params, schema) + assert result == {"amount": "12345"} + + def test_nested_int64_string(self): + params = {"nested": {"count": 42}} + schema = {"nested": {"count": "int64_string"}} + result = _coerce_v2_params(params, schema) + assert result == {"nested": {"count": "42"}} + + def test_array_of_int64_string(self): + params = {"amounts": [100, 200, 300]} + schema = {"amounts": "int64_string"} + result = _coerce_v2_params(params, schema) + assert result == {"amounts": ["100", "200", "300"]} + + def test_array_of_objects_with_int64_string(self): + params = {"items": [{"amount": 100}, {"amount": 200}]} + schema = {"items": {"amount": "int64_string"}} + result = _coerce_v2_params(params, schema) + assert result == {"items": [{"amount": "100"}, {"amount": "200"}]} + + def test_unrelated_fields_unchanged(self): + params = {"name": "test", "count": 42, "amount": 100} + schema = {"amount": "int64_string"} + result = _coerce_v2_params(params, schema) + assert result == {"name": "test", "count": 42, "amount": "100"} + + def test_none_params_returns_none(self): + schema = {"amount": "int64_string"} + result = _coerce_v2_params(None, schema) + assert result is None + + def test_none_value_preserved(self): + params = {"amount": None} + schema = {"amount": "int64_string"} + result = _coerce_v2_params(params, schema) + assert result == {"amount": None} + + def test_deeply_nested_int64_string(self): + params = {"level1": {"level2": {"value": 999}}} + schema = {"level1": {"level2": {"value": "int64_string"}}} + result = _coerce_v2_params(params, schema) + assert result == {"level1": {"level2": {"value": "999"}}} + + def test_mixed_fields_only_int64_coerced(self): + params = { + "name": "test", + "amount": 100, + "metadata": {"key": "val"}, + "count": 5, + } + schema = {"amount": "int64_string", "count": "int64_string"} + result = _coerce_v2_params(params, schema) + assert result == { + "name": "test", + "amount": "100", + "metadata": {"key": "val"}, + "count": "5", + } + + def test_empty_schema_no_coercion(self): + params = {"amount": 100} + schema = {} + result = _coerce_v2_params(params, schema) + assert result == {"amount": 100} + + def test_large_int64_value(self): + params = {"amount": 9223372036854775807} # max int64 + schema = {"amount": "int64_string"} + result = _coerce_v2_params(params, schema) + assert result == {"amount": "9223372036854775807"} + + def test_zero_value(self): + params = {"amount": 0} + schema = {"amount": "int64_string"} + result = _coerce_v2_params(params, schema) + assert result == {"amount": "0"} + + def test_negative_value(self): + params = {"amount": -100} + schema = {"amount": "int64_string"} + result = _coerce_v2_params(params, schema) + assert result == {"amount": "-100"} + + +class TestResponseFieldCoercion: + """Tests for inbound response coercion (str → int) via _field_encodings.""" + + def _make_v2_class(self, field_encodings): + """Create a StripeObject subclass with given field encodings.""" + + class V2Resource(StripeObject): + _field_encodings = field_encodings + + return V2Resource + + def test_top_level_int64_string_response(self): + cls = self._make_v2_class({"amount": "int64_string"}) + obj = cls.construct_from( + {"id": "test", "amount": "12345"}, + key="sk_test", + api_mode="V2", + ) + assert obj["amount"] == 12345 + assert isinstance(obj["amount"], int) + + def test_nested_class_int64_string_response(self): + """Nested StripeObject classes coerce their own fields.""" + + class InnerObj(StripeObject): + _field_encodings = {"count": "int64_string"} + + class OuterObj(StripeObject): + _inner_class_types = {"inner": InnerObj} + + obj = OuterObj.construct_from( + {"id": "test", "inner": {"count": "42"}}, + key="sk_test", + api_mode="V2", + ) + assert obj["inner"]["count"] == 42 + assert isinstance(obj["inner"]["count"], int) + + def test_array_of_int64_string_response(self): + cls = self._make_v2_class({"amounts": "int64_string"}) + obj = cls.construct_from( + {"id": "test", "amounts": ["100", "200", "300"]}, + key="sk_test", + api_mode="V2", + ) + assert obj["amounts"] == [100, 200, 300] + assert all(isinstance(v, int) for v in obj["amounts"]) + + def test_unrelated_fields_unchanged_response(self): + cls = self._make_v2_class({"amount": "int64_string"}) + obj = cls.construct_from( + {"id": "test", "name": "hello", "amount": "100"}, + key="sk_test", + api_mode="V2", + ) + assert obj["name"] == "hello" + assert isinstance(obj["name"], str) + assert obj["amount"] == 100 + + def test_none_value_preserved_response(self): + cls = self._make_v2_class({"amount": "int64_string"}) + obj = cls.construct_from( + {"id": "test", "amount": None}, + key="sk_test", + api_mode="V2", + ) + assert obj["amount"] is None + + def test_no_field_encodings_unchanged(self): + """StripeObject without _field_encodings leaves strings as strings.""" + obj = StripeObject.construct_from( + {"id": "test", "amount": "12345"}, + key="sk_test", + api_mode="V2", + ) + assert obj["amount"] == "12345" + assert isinstance(obj["amount"], str) + + def test_large_int64_response(self): + cls = self._make_v2_class({"amount": "int64_string"}) + obj = cls.construct_from( + {"id": "test", "amount": "9223372036854775807"}, + key="sk_test", + api_mode="V2", + ) + assert obj["amount"] == 9223372036854775807 + + def test_zero_response(self): + cls = self._make_v2_class({"amount": "int64_string"}) + obj = cls.construct_from( + {"id": "test", "amount": "0"}, + key="sk_test", + api_mode="V2", + ) + assert obj["amount"] == 0 + + def test_negative_response(self): + cls = self._make_v2_class({"amount": "int64_string"}) + obj = cls.construct_from( + {"id": "test", "amount": "-100"}, + key="sk_test", + api_mode="V2", + ) + assert obj["amount"] == -100 + + +class TestV1Unchanged: + """Regression tests: V1 behavior should not be affected.""" + + def test_v1_integer_fields_stay_integers(self): + """V1 objects don't have _field_encodings, so ints stay ints.""" + obj = StripeObject.construct_from( + {"id": "test", "amount": 100}, + key="sk_test", + api_mode="V1", + ) + assert obj["amount"] == 100 + assert isinstance(obj["amount"], int) + + def test_v1_string_fields_stay_strings(self): + obj = StripeObject.construct_from( + {"id": "test", "name": "hello"}, + key="sk_test", + api_mode="V1", + ) + assert obj["name"] == "hello" + assert isinstance(obj["name"], str) + + def test_object_without_field_encodings_unchanged(self): + """Objects without _field_encodings are unaffected.""" + obj = StripeObject.construct_from( + {"id": "test", "amount": "12345", "count": 42}, + key="sk_test", + ) + assert obj["amount"] == "12345" + assert obj["count"] == 42 diff --git a/tests/test_stripe_object.py b/tests/test_stripe_object.py index a963fcc5d..430fe81cd 100644 --- a/tests/test_stripe_object.py +++ b/tests/test_stripe_object.py @@ -94,23 +94,32 @@ def test_access(self): obj.myattr with pytest.raises(KeyError): obj["myattr"] - assert obj.get("myattr", "def") == "def" - assert obj.get("myattr") is None + assert getattr(obj, "myattr", "def") == "def" + assert "myattr" not in obj # Setters obj.myattr = "myval" obj["myitem"] = "itval" - assert obj.setdefault("mydef", "sdef") == "sdef" + obj.mydef = getattr(obj, "mydef", "sdef") + assert obj.mydef == "sdef" # Getters - assert obj.setdefault("myattr", "sdef") == "myval" assert obj.myattr == "myval" assert obj["myattr"] == "myval" - assert obj.get("myattr") == "myval" - assert sorted(obj.keys()) == ["id", "myattr", "mydef", "myitem"] + assert sorted(obj.to_dict().keys()) == [ + "id", + "myattr", + "mydef", + "myitem", + ] - assert sorted(obj.values()) == ["itval", "myid", "myval", "sdef"] + assert sorted(obj.to_dict().values()) == [ + "itval", + "myid", + "myval", + "sdef", + ] # Illegal operations with pytest.raises(ValueError): @@ -351,7 +360,7 @@ def test_to_dict_recursive(self): {"empty": "", "value": "foobar", "nested": [foo, bar]}, "mykey" ) - d = obj.to_dict_recursive() + d = obj._to_dict_recursive() assert d == { "empty": "", "value": "foobar", @@ -372,6 +381,192 @@ def serialize(self, previous): assert obj.serialize(None) == {"nested": ""} + def test_serialize_empty_when_nothing_changed(self): + obj = StripeObject.construct_from({"id": "x", "name": "alice"}, "key") + assert obj.serialize(None) == {} + + def test_serialize_includes_unsaved_values(self): + obj = StripeObject.construct_from({"id": "x", "name": "alice"}, "key") + obj.name = "bob" + assert obj.serialize(None) == {"name": "bob"} + + def test_serialize_multiple_unsaved_values(self): + obj = StripeObject.construct_from( + {"id": "x", "name": "alice", "email": "a@example.com"}, "key" + ) + obj.name = "bob" + obj.email = "b@example.com" + result = obj.serialize(None) + assert result == {"name": "bob", "email": "b@example.com"} + + def test_serialize_setting_same_value_still_serializes(self): + obj = StripeObject.construct_from({"id": "x", "name": "alice"}, "key") + obj.name = "alice" + assert obj.serialize(None) == {"name": "alice"} + + def test_serialize_skips_id(self): + obj = StripeObject.construct_from({"id": "x"}, "key") + obj._unsaved_values.add("id") + assert obj.serialize(None) == {} + + def test_serialize_skips_underscore_prefixed_keys(self): + obj = StripeObject.construct_from({"id": "x", "_secret": "s"}, "key") + obj._unsaved_values.add("_secret") + assert obj.serialize(None) == {} + + def test_serialize_skips_api_resources(self): + inner = stripe.Customer.construct_from( + {"id": "cus_123", "object": "customer"}, "key" + ) + obj = StripeObject.construct_from( + {"id": "x", "customer": inner}, "key" + ) + obj._unsaved_values.add("customer") + assert obj.serialize(None) == {} + + def test_serialize_nested_changed_object(self): + obj = StripeObject.construct_from( + {"id": "x", "metadata": {"key1": "val1"}}, "key" + ) + obj.metadata["key1"] = "val2" + result = obj.serialize(None) + assert result == {"metadata": {"key1": "val2"}} + + def test_serialize_nested_unchanged_excluded(self): + obj = StripeObject.construct_from( + {"id": "x", "metadata": {"key1": "val1"}}, "key" + ) + assert obj.serialize(None) == {} + + def test_serialize_nested_new_key(self): + obj = StripeObject.construct_from( + {"id": "x", "metadata": {"key1": "val1"}}, "key" + ) + obj.metadata["key2"] = "val2" + result = obj.serialize(None) + assert result == {"metadata": {"key2": "val2"}} + + def test_serialize_deeply_nested(self): + obj = StripeObject.construct_from( + { + "id": "x", + "level1": { + "level2": {"deep": "original"}, + }, + }, + "key", + ) + obj.level1.level2.deep = "changed" + result = obj.serialize(None) + assert result == {"level1": {"level2": {"deep": "changed"}}} + + def test_serialize_diff_removed_key_becomes_empty_string(self): + obj = StripeObject.construct_from( + {"id": "x", "metadata": {"key1": "v1", "key2": "v2"}}, "key" + ) + obj.metadata = {"key1": "v1"} + result = obj.serialize(None) + assert result == {"metadata": {"key1": "v1", "key2": ""}} + + def test_serialize_unsaved_none_becomes_empty_string(self): + obj = StripeObject.construct_from({"id": "x", "name": "alice"}, "key") + obj.name = None + assert obj.serialize(None) == {"name": ""} + + def test_serialize_unsaved_empty_string(self): + # __setitem__ rejects empty strings, so construct with it + # already empty and mark it as unsaved + obj = StripeObject.construct_from({"id": "x", "name": ""}, "key") + obj._unsaved_values.add("name") + assert obj.serialize(None) == {"name": ""} + + def test_serialize_explicit_previous_used_for_diff(self): + obj = StripeObject.construct_from({"id": "x", "metadata": {}}, "key") + obj.metadata = {"key1": "new"} + previous = {"metadata": {"key1": "old", "removed_key": "gone"}} + result = obj.serialize(previous) + assert result == {"metadata": {"key1": "new", "removed_key": ""}} + + def test_serialize_previous_none_uses_internal_previous(self): + obj = StripeObject.construct_from( + {"id": "x", "metadata": {"key1": "v1", "key2": "v2"}}, "key" + ) + obj.metadata = {"key1": "v1"} + result = obj.serialize(None) + assert result == {"metadata": {"key1": "v1", "key2": ""}} + + def test_serialize_additional_owners(self): + obj = StripeObject.construct_from( + { + "id": "x", + "additional_owners": [ + {"first_name": "alice"}, + {"first_name": "bob"}, + ], + }, + "key", + ) + result = obj.serialize(None) + # additional_owners is always serialized when non-None; + # child objects have no unsaved values so they serialize to {} + assert "additional_owners" in result + assert result["additional_owners"]["0"] == {} + assert result["additional_owners"]["1"] == {} + + def test_serialize_additional_owners_none_excluded(self): + obj = StripeObject.construct_from( + {"id": "x", "additional_owners": None}, "key" + ) + assert obj.serialize(None) == {} + + def test_serialize_after_construct_and_modify(self): + obj = StripeObject.construct_from( + { + "id": "obj_123", + "name": "original", + "metadata": {"env": "test"}, + }, + "key", + ) + obj.name = "updated" + obj.metadata["env"] = "prod" + result = obj.serialize(None) + assert result == { + "name": "updated", + "metadata": {"env": "prod"}, + } + + def test_serialize_after_refresh_resets_unsaved(self): + obj = StripeObject.construct_from( + {"id": "x", "name": "original"}, "key" + ) + obj.name = "changed" + assert obj.serialize(None) == {"name": "changed"} + + obj.refresh_from({"id": "x", "name": "from_api"}, "key") + assert obj.serialize(None) == {} + + def test_serialize_after_refresh_then_modify(self): + obj = StripeObject.construct_from( + {"id": "x", "name": "v1", "email": "a@example.com"}, "key" + ) + obj.refresh_from( + {"id": "x", "name": "v2", "email": "a@example.com"}, "key" + ) + obj.email = "new@example.com" + result = obj.serialize(None) + assert result == {"email": "new@example.com"} + + def test_serialize_new_key(self): + obj = StripeObject.construct_from({"id": "x"}, "key") + obj["new_field"] = "value" + assert obj.serialize(None) == {"new_field": "value"} + + def test_serialize_new_key_via_attribute(self): + obj = StripeObject.construct_from({"id": "x"}, "key") + obj.new_field = "value" + assert obj.serialize(None) == {"new_field": "value"} + def test_field_name_remapping(self): class Foo(StripeObject): _field_remappings = {"getter_name": "data_name"} @@ -428,7 +623,7 @@ def test_can_update_api_key(self, http_client_mock): obj.api_key = "key2" obj._request("get", "/foo", base_address="api") - assert "api_key" not in obj.items() + assert "api_key" not in obj.to_dict() http_client_mock.assert_requested( api_key="key2", @@ -467,3 +662,125 @@ def is_good_error(e: Exception) -> bool: with pytest.raises(KeyError) as e: so["payment_intent"] assert not is_good_error(e.value) + + def test_eq_same_data(self): + a = StripeObject.construct_from({"id": "x", "name": "a"}, "key") + b = StripeObject.construct_from({"id": "x", "name": "a"}, "key") + assert a == b + + def test_eq_different_data(self): + a = StripeObject.construct_from({"id": "x", "name": "a"}, "key") + b = StripeObject.construct_from({"id": "x", "name": "b"}, "key") + assert a != b + + def test_eq_different_types_not_equal(self): + data = {"id": "x", "name": "a"} + invoice = stripe.Invoice.construct_from( + {**data, "object": "invoice"}, "key" + ) + customer = stripe.Customer.construct_from( + {**data, "object": "customer"}, "key" + ) + assert invoice != customer + + def test_eq_same_resource_type(self): + a = stripe.Customer.construct_from( + {"id": "cus_1", "object": "customer", "name": "alice"}, "key" + ) + b = stripe.Customer.construct_from( + {"id": "cus_1", "object": "customer", "name": "alice"}, "key" + ) + assert a == b + + def test_eq_diff_resource_type_same_data(self): + a = stripe.Customer.construct_from( + {"id": "cus_1", "object": "customer", "name": "alice"}, "key" + ) + b = stripe.Invoice.construct_from( + {"id": "cus_1", "object": "customer", "name": "alice"}, "key" + ) + assert a != b + + def test_eq_not_equal_to_dict(self): + obj = StripeObject.construct_from({"id": "x"}, "key") + assert obj != {"id": "x"} + + def test_is_not_dict(self): + obj = StripeObject("id", "key") + assert not isinstance(obj, dict) + + def test_items_field_not_shadowed_by_dict_items(self): + obj = StripeObject.construct_from( + { + "id": "sub_123", + "object": "subscription", + "items": {"object": "list", "data": [{"id": "si_123"}]}, + }, + "key", + ) + assert isinstance(obj.items, stripe.ListObject) + + def test_to_dict(self): + obj = StripeObject.construct_from( + {"id": "foo", "name": "bar"}, + "key", + ) + d = obj.to_dict() + assert d == {"id": "foo", "name": "bar"} + assert isinstance(d, dict) + assert not isinstance(d, StripeObject) + + def test_to_dict_recursive_by_default(self): + inner = StripeObject.construct_from({"nested": "val"}, "key") + obj = StripeObject.construct_from({"id": "x", "child": inner}, "key") + d = obj.to_dict() + assert d == {"id": "x", "child": {"nested": "val"}} + assert isinstance(d["child"], dict) + assert not isinstance(d["child"], StripeObject) + + def test_to_dict_non_recursive(self): + inner = StripeObject.construct_from({"nested": "val"}, "key") + obj = StripeObject.construct_from({"id": "x", "child": inner}, "key") + d = obj.to_dict(recursive=False) + assert d["id"] == "x" + # non-recursive preserves nested StripeObjects + assert isinstance(d["child"], StripeObject) + + def test_to_dict_is_a_copy(self): + obj = StripeObject.construct_from({"id": "x", "name": "a"}, "key") + d = obj.to_dict() + d["name"] = "mutated" + assert obj.name == "a" + + def test_to_dict_with_list_of_nested_objects(self): + obj = StripeObject.construct_from( + {"id": "x", "items": [{"a": 1}, {"b": 2}]}, "key" + ) + d = obj.to_dict() + assert d == {"id": "x", "items": [{"a": 1}, {"b": 2}]} + assert not isinstance(d["items"][0], StripeObject) + + def test_update_sets_values(self): + obj = StripeObject.construct_from({"id": "x", "name": "a"}, "key") + obj.update({"name": "b", "email": "b@example.com"}) + assert obj.name == "b" + assert obj.email == "b@example.com" + + def test_update_marks_keys_unsaved(self): + obj = StripeObject.construct_from({"id": "x", "name": "a"}, "key") + obj.update({"name": "b", "email": "b@example.com"}) + assert "name" in obj._unsaved_values + assert "email" in obj._unsaved_values + + def test_update_shows_in_serialize(self): + obj = StripeObject.construct_from({"id": "x", "name": "a"}, "key") + obj.update({"name": "b"}) + assert obj.serialize(None) == {"name": "b"} + + def test_update_multiple_calls(self): + obj = StripeObject.construct_from({"id": "x"}, "key") + obj.update({"a": 1}) + obj.update({"b": 2}) + assert obj.a == 1 + assert obj.b == 2 + assert obj.serialize(None) == {"a": 1, "b": 2}